Skip to content

Commit

Permalink
chore: remove redundant steps in etdcrestore docker build
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Salas <carlos.salas@suse.com>
  • Loading branch information
salasberryfin committed Oct 25, 2024
1 parent c9a8db1 commit 9ec15a2
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions exp/etcdrestore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,10 @@ ARG goproxy=https://proxy.golang.org
# Run this with docker build --build-arg package=./exp/etcdrestore
ENV GOPROXY=$goproxy

# Copy the Go Modules manifests
COPY exp/etcdrestore/go.mod /go.mod
COPY exp/etcdrestore/go.sum /go.sum

# 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
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download

# Copy the sources
COPY ./ ./

# Cache the go build into the Go’s compiler cache folder so we take benefits of compiler caching across docker build calls
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
sh -c "cd exp/etcdrestore && go build ."

# # Build
# Build
ARG ARCH
ARG ldflags

Expand All @@ -67,4 +53,4 @@ WORKDIR /
COPY --from=builder /workspace/exp/etcdrestore/manager .
# Use uid of nonroot user (65532) because kubernetes expects numeric user when applying pod security policies
USER 65532
ENTRYPOINT ["/manager"]
ENTRYPOINT ["/manager"]

0 comments on commit 9ec15a2

Please sign in to comment.