From e32df85e2df9d2533fab321221fb7550a0bc3503 Mon Sep 17 00:00:00 2001 From: Zachary Hu <6426329+outsinre@users.noreply.github.com> Date: Thu, 6 Jul 2023 18:08:36 +0800 Subject: [PATCH] chore(build): upgrade Docker base image during build (#11176) --- build/dockerfiles/apk.Dockerfile | 3 ++- build/dockerfiles/deb.Dockerfile | 2 ++ build/dockerfiles/rpm.Dockerfile | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build/dockerfiles/apk.Dockerfile b/build/dockerfiles/apk.Dockerfile index ce4a0afcb87d..808b89f3aa25 100644 --- a/build/dockerfiles/apk.Dockerfile +++ b/build/dockerfiles/apk.Dockerfile @@ -17,7 +17,8 @@ ARG KONG_ARTIFACT=kong.${TARGETARCH}.apk.tar.gz ARG KONG_ARTIFACT_PATH= COPY ${KONG_ARTIFACT_PATH}${KONG_ARTIFACT} /tmp/kong.apk.tar.gz -RUN apk add --virtual .build-deps tar gzip \ +RUN apk upgrade --update-cache \ + && apk add --virtual .build-deps tar gzip \ && tar -C / -xzf /tmp/kong.apk.tar.gz \ && apk add --no-cache libstdc++ libgcc pcre perl tzdata libcap zlib zlib-dev bash yaml \ && adduser -S kong \ diff --git a/build/dockerfiles/deb.Dockerfile b/build/dockerfiles/deb.Dockerfile index 0a568272f8f0..7a45d2dcfbf1 100644 --- a/build/dockerfiles/deb.Dockerfile +++ b/build/dockerfiles/deb.Dockerfile @@ -18,6 +18,8 @@ ARG KONG_ARTIFACT_PATH= COPY ${KONG_ARTIFACT_PATH}${KONG_ARTIFACT} /tmp/kong.deb RUN apt-get update \ + && apt-get -y upgrade \ + && apt-get -y autoremove \ && apt-get install -y --no-install-recommends /tmp/kong.deb \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /tmp/kong.deb \ diff --git a/build/dockerfiles/rpm.Dockerfile b/build/dockerfiles/rpm.Dockerfile index 042081a735f9..9dd4b87ebf02 100644 --- a/build/dockerfiles/rpm.Dockerfile +++ b/build/dockerfiles/rpm.Dockerfile @@ -32,7 +32,8 @@ ARG KONG_ARTIFACT_PATH= COPY ${KONG_ARTIFACT_PATH}${KONG_ARTIFACT} /tmp/kong.rpm # hadolint ignore=DL3015 -RUN yum install -y /tmp/kong.rpm \ +RUN yum update -y \ + && yum install -y /tmp/kong.rpm \ && rm /tmp/kong.rpm \ && chown kong:0 /usr/local/bin/kong \ && chown -R kong:0 /usr/local/kong \