Remove additional --update for apk in Dockerfile (#818)

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.
This commit is contained in:
Peter Dave Hello 2022-05-31 21:06:52 +08:00 committed by GitHub
parent c3ede62822
commit fb587c1d10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
ARG GO_VERSION ARG GO_VERSION
FROM golang:${GO_VERSION}-alpine AS builder 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 RUN mkdir -p /build
WORKDIR /build WORKDIR /build
COPY . /build/ COPY . /build/
@ -8,7 +8,7 @@ RUN go mod download
RUN make build-linux RUN make build-linux
FROM golang:${GO_VERSION}-alpine 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 ENV GO111MODULE on
COPY --from=builder /build/gosec /bin/gosec COPY --from=builder /build/gosec /bin/gosec
COPY entrypoint.sh /bin/entrypoint.sh COPY entrypoint.sh /bin/entrypoint.sh