Skip to content

Commit

Permalink
Decrease the time of the container image build (#1545)
Browse files Browse the repository at this point in the history
Signed-off-by: Israel Blancas <[email protected]>

Co-authored-by: Ruben Vargas <[email protected]>
  • Loading branch information
iblancasa and rubenvp8510 authored Oct 1, 2021
1 parent 175eeb6 commit c1e6ee1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Dockerfile.asserts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Build the manager binary
FROM golang:1.16 as builder

COPY . /go/src/github.com/jaegertracing/jaeger-operator/
WORKDIR /go/src/github.com/jaegertracing/jaeger-operator

# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
# Download the dependencies. Doing this, if there are changes in the source
# code but not in the dependencies to download, the tool to build the image will
# use the cached dependencies
COPY go.mod /go/src/github.com/jaegertracing/jaeger-operator/go.mod
COPY go.sum /go/src/github.com/jaegertracing/jaeger-operator/go.sum
RUN go mod download

COPY . /go/src/github.com/jaegertracing/jaeger-operator/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o ./uiconfig -a ./tests/assert-jobs/uiconfig/main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o ./reporter -a ./tests/assert-jobs/reporter/main.go
Expand Down

0 comments on commit c1e6ee1

Please sign in to comment.