Skip to content

Commit

Permalink
Remove additional --update for apk in Dockerfile (#818)
Browse files Browse the repository at this point in the history
There is no need to use --update with --no-cache when using apk on
Alpine Linux, as using --no-cache will fetch the index every time and
leave no local cache, so the index will always be the latest without
temporary files remain in the image.
  • Loading branch information
PeterDaveHello authored May 31, 2022
1 parent c3ede62 commit fb587c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ARG GO_VERSION
FROM golang:${GO_VERSION}-alpine AS builder
RUN apk add --update --no-cache ca-certificates make git curl gcc libc-dev
RUN apk add --no-cache ca-certificates make git curl gcc libc-dev
RUN mkdir -p /build
WORKDIR /build
COPY . /build/
RUN go mod download
RUN make build-linux

FROM golang:${GO_VERSION}-alpine
RUN apk add --update --no-cache ca-certificates bash git gcc libc-dev openssh
RUN apk add --no-cache ca-certificates bash git gcc libc-dev openssh
ENV GO111MODULE on
COPY --from=builder /build/gosec /bin/gosec
COPY entrypoint.sh /bin/entrypoint.sh
Expand Down

0 comments on commit fb587c1

Please sign in to comment.