linkerd2/Dockerfile-go-deps

22 lines
936 B
Plaintext

# Go dependencies
#
# Fetches all required Go dependencies. All Conduit sources are omitted from the resulting
# image so that artifacts may be built from source over this image.
#
# When this file is changed, run `bin/update-go-deps-shas`.
# Fetch `dep` and ensure that all Go dependencies are vendored.
FROM golang:1.9.1 as build
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && chmod +x /usr/local/bin/dep
WORKDIR /go/src/github.com/runconduit/conduit
COPY . .
RUN dep ensure
# Preserve dependency sources and build artifacts without maintaining conduit
# sources/artifacts.
FROM golang:1.9.1
WORKDIR /go/src/github.com/runconduit/conduit
COPY --from=build /go/src/github.com/runconduit/conduit/vendor vendor
COPY --from=build /go/src/github.com/runconduit/conduit/Gopkg.toml Gopkg.toml
COPY --from=build /go/src/github.com/runconduit/conduit/Gopkg.lock Gopkg.lock