Dockerfile: optimize incremental build a bit, copy all binaries to output

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/58/head
Brad Fitzpatrick 5 years ago committed by Brad Fitzpatrick
parent 747c7d7ce2
commit c393f0bfae

@ -5,11 +5,15 @@
FROM golang:1.13-alpine AS build-env FROM golang:1.13-alpine AS build-env
WORKDIR /go/src/tailscale WORKDIR /go/src/tailscale
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . . COPY . .
RUN go get -d -v ./cmd/...
RUN go install -v ./cmd/... RUN go install -v ./cmd/...
FROM alpine:3.11 FROM alpine:3.11
RUN apk add --no-cache ca-certificates RUN apk add --no-cache ca-certificates
COPY --from=build-env /go/bin/tail* /usr/local/bin/ COPY --from=build-env /go/bin/* /usr/local/bin/

Loading…
Cancel
Save