Skip to content

Commit f170082

Browse files
committed
upgrade alpine packages during image build
apk add --upgrade leaves zlib from the pinned base image in place. apk upgrade pulls the patched package so the container scan does not wait on a docker hub rebuild
1 parent 53205b6 commit f170082

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎Dockerfile‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ FROM --platform=$BUILDPLATFORM golang:1.27-alpine@sha256:8a5910f31396cd4d89662f5
55
ENV GO111MODULE=on
66
ENV CGO_ENABLED=0
77
COPY --from=xx / /
8-
RUN apk add --update --upgrade --no-cache build-base coreutils git
8+
RUN apk upgrade --no-cache \
9+
&& apk add --update --upgrade --no-cache build-base coreutils git
910
WORKDIR /src
1011

1112
FROM base AS build
@@ -39,7 +40,8 @@ FROM scratch AS artifact
3940
COPY --from=releaser /out /
4041

4142
FROM alpine:3.24@sha256:294b683cb724975bec92580e1e685676bd4b50bda910ddb8c51d4cabeaec77e6
42-
RUN apk add --update --upgrade --no-cache ca-certificates tzdata
43+
RUN apk upgrade --no-cache \
44+
&& apk add --update --upgrade --no-cache ca-certificates tzdata
4345
COPY --from=binary /deployah /usr/bin/deployah
4446
ENTRYPOINT ["deployah"]
4547
CMD ["--help"]

0 commit comments

Comments
 (0)