mirror of https://github.com/linkerd/linkerd2.git
Improve caching behavior of controller/Dockerfile. (#331)
Precompiling pkg/ in an earlier layer saves ~10 seconds of wall clock time on an incremental build on my machine (i9-7960x) when I update a file in controller/ such as controller/destination/server.go. This makes a significant difference in the edit-build-test loop. Signed-off-by: Brian Smith <brian@briansmith.org>
This commit is contained in:
parent
ec5a02fd64
commit
37008f9626
|
@ -2,10 +2,12 @@
|
|||
FROM gcr.io/runconduit/go-deps:749453c2 as golang
|
||||
ARG CONDUIT_VERSION
|
||||
WORKDIR /go/src/github.com/runconduit/conduit
|
||||
COPY controller controller
|
||||
COPY controller/gen controller/gen
|
||||
COPY pkg pkg
|
||||
RUN CGO_ENABLED=0 GOOS=linux go install -installsuffix cgo -ldflags "-X github.com/runconduit/conduit/pkg/version.Version=$CONDUIT_VERSION" ./pkg/...
|
||||
COPY controller controller
|
||||
# use `install` so that we produce multiple binaries
|
||||
RUN CGO_ENABLED=0 GOOS=linux go install -a -installsuffix cgo -ldflags "-X github.com/runconduit/conduit/pkg/version.Version=$CONDUIT_VERSION" ./controller/cmd/...
|
||||
RUN CGO_ENABLED=0 GOOS=linux go install -installsuffix cgo -ldflags "-X github.com/runconduit/conduit/pkg/version.Version=$CONDUIT_VERSION" ./controller/cmd/...
|
||||
|
||||
## package runtime
|
||||
FROM gcr.io/runconduit/base:2017-10-30.01
|
||||
|
|
Loading…
Reference in New Issue