blob: ad37803364a4ccf6047d182440479dc672bbdd78 [file] [log] [blame]
# Copyright 2017 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
FROM golang:1.13 AS builder
LABEL maintainer ""
RUN mkdir /gocache
ENV GOCACHE /gocache
COPY go.mod /go/src/
COPY go.sum /go/src/
WORKDIR /go/src/
# Optimization for iterative docker build speed, not necessary for correctness:
# TODO: write a tool to make writing Go module-friendly Dockerfiles easier (
RUN go install
RUN go install
RUN go install
COPY cmd/pubsubhelper/pubsubtypes /go/src/
RUN go install
COPY autocertcache /go/src/
RUN go install
COPY internal /go/src/
COPY maintner /go/src/
RUN go install
COPY . /go/src/
# Install binary to /go/bin:
RUN go install
FROM debian:stretch
# netbase and ca-certificates are needed for dialing TLS.
# The rest are useful for debugging if somebody needs to exec into the container.
RUN apt-get update && apt-get install -y \
--no-install-recommends \
netbase \
ca-certificates \
curl \
strace \
procps \
lsof \
psmisc \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /go/bin/devapp /
COPY devapp/static /static
COPY devapp/templates /templates
ENTRYPOINT ["/devapp"]