Skip to content

Commit 03f8284

Browse files
committed
Bump alpine/golang/helm versions
Also, inject BUILDDATE as cache-bust to ensure that packages get updated in final stage to address vulns. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
1 parent e7fde9c commit 03f8284

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

Dockerfile.dapper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.18-alpine3.15
1+
FROM golang:1.19-alpine3.16
22

33
ARG DAPPER_HOST_ARCH
44
ENV ARCH $DAPPER_HOST_ARCH

package/Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
FROM alpine:3.15 as extract
1+
FROM alpine:3.16 as extract
22
RUN apk add -U curl ca-certificates
33
ARG ARCH
44
RUN curl https://get.helm.sh/helm-v2.17.0-linux-${ARCH}.tar.gz | tar xvzf - --strip-components=1 -C /usr/bin
55
RUN mv /usr/bin/helm /usr/bin/helm_v2
6-
RUN curl https://get.helm.sh/helm-v3.8.1-linux-${ARCH}.tar.gz | tar xvzf - --strip-components=1 -C /usr/bin
6+
RUN curl https://get.helm.sh/helm-v3.10.2-linux-${ARCH}.tar.gz | tar xvzf - --strip-components=1 -C /usr/bin
77
RUN mv /usr/bin/helm /usr/bin/helm_v3
88
COPY entry /usr/bin/
99

10-
FROM golang:1.18-alpine3.15 as plugins
10+
FROM golang:1.19-alpine3.16 as plugins
1111
RUN apk add -U curl ca-certificates build-base binutils-gold
1212
ARG ARCH
1313
COPY --from=extract /usr/bin/helm_v3 /usr/bin/helm
1414
RUN mkdir -p /go/src/github.com/k3s-io/helm-set-status && \
1515
curl -sL https://github.com/k3s-io/helm-set-status/archive/refs/tags/v0.1.2.tar.gz | tar xvzf - --strip-components=1 -C /go/src/github.com/k3s-io/helm-set-status && \
1616
make -C /go/src/github.com/k3s-io/helm-set-status install
1717
RUN mkdir -p /go/src/github.com/helm/helm-mapkubeapis && \
18-
curl -sL https://github.com/helm/helm-mapkubeapis/archive/refs/tags/v0.3.0.tar.gz | tar xvzf - --strip-components=1 -C /go/src/github.com/helm/helm-mapkubeapis && \
18+
curl -sL https://github.com/helm/helm-mapkubeapis/archive/refs/tags/v0.3.2.tar.gz | tar xvzf - --strip-components=1 -C /go/src/github.com/helm/helm-mapkubeapis && \
1919
make -C /go/src/github.com/helm/helm-mapkubeapis && \
2020
mkdir -p /root/.local/share/helm/plugins/helm-mapkubeapis && \
2121
cp -vr /go/src/github.com/helm/helm-mapkubeapis/plugin.yaml \
2222
/go/src/github.com/helm/helm-mapkubeapis/bin \
2323
/go/src/github.com/helm/helm-mapkubeapis/config \
2424
/root/.local/share/helm/plugins/helm-mapkubeapis/
2525

26-
FROM alpine:3.15
27-
RUN apk add -U --no-cache ca-certificates jq bash git && \
26+
FROM alpine:3.16
27+
ARG BUILDDATE
28+
LABEL buildDate=$BUILDDATE
29+
RUN apk --no-cache upgrade && \
30+
apk add -U --no-cache ca-certificates jq bash git && \
2831
adduser -D -u 1000 -s /bin/bash klipper-helm
2932
WORKDIR /home/klipper-helm
3033
COPY --chown=1000:1000 --from=plugins /root/.local/share/helm/plugins/ /home/klipper-helm/.local/share/helm/plugins/

scripts/package

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ if [ -e ${DOCKERFILE}.${ARCH} ]; then
2121
DOCKERFILE=${DOCKERFILE}.${ARCH}
2222
fi
2323

24-
docker build --build-arg ARCH=${ARCH} -f ${DOCKERFILE} -t ${IMAGE} .
24+
docker build --build-arg ARCH=${ARCH} --build-arg BUILDDATE=$(date +%Y%m%d) -f ${DOCKERFILE} -t ${IMAGE} .
2525
echo Built ${IMAGE}

0 commit comments

Comments
 (0)