diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 939c8ee8827d..4a2f5ada3061 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -383,7 +383,7 @@ jobs: platforms: ${{ steps.docker_platforms_arg.outputs.platforms }} build-args: | KONG_BASE_IMAGE=${{ matrix.base-image }} - KONG_ARTIFACT_PATH=bazel-bin/pkg/ + KONG_ARTIFACT_PATH=bazel-bin/pkg KONG_VERSION=${{ needs.metadata.outputs.kong-version }} RPM_PLATFORM=${{ steps.docker_rpm_platform_arg.outputs.rpm_platform }} EE_PORTS=8002 8445 8003 8446 8004 8447 diff --git a/build/dockerfiles/deb.Dockerfile b/build/dockerfiles/deb.Dockerfile index c25cbadd5d53..ab81d5f04986 100644 --- a/build/dockerfiles/deb.Dockerfile +++ b/build/dockerfiles/deb.Dockerfile @@ -14,16 +14,15 @@ ARG EE_PORTS ARG TARGETARCH ARG KONG_ARTIFACT=kong.${TARGETARCH}.deb -ARG KONG_ARTIFACT_PATH= -COPY ${KONG_ARTIFACT_PATH}${KONG_ARTIFACT} /tmp/kong.deb +ARG KONG_ARTIFACT_PATH -RUN apt-get update \ +RUN --mount=type=bind,source=${KONG_ARTIFACT_PATH},target=/tmp/pkg \ + apt-get update \ && apt-get -y upgrade \ && apt-get -y autoremove \ && DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata \ - && apt-get install -y --no-install-recommends /tmp/kong.deb \ + && apt-get install -y --no-install-recommends /tmp/pkg/${KONG_ARTIFACT} \ && rm -rf /var/lib/apt/lists/* \ - && rm -rf /tmp/kong.deb \ && chown kong:0 /usr/local/bin/kong \ && chown -R kong:0 ${KONG_PREFIX} \ && ln -sf /usr/local/openresty/bin/resty /usr/local/bin/resty \ diff --git a/build/dockerfiles/rpm.Dockerfile b/build/dockerfiles/rpm.Dockerfile index 958140c98302..f05102afa2a8 100644 --- a/build/dockerfiles/rpm.Dockerfile +++ b/build/dockerfiles/rpm.Dockerfile @@ -28,13 +28,12 @@ ARG EE_PORTS ARG TARGETARCH ARG KONG_ARTIFACT=kong.${RPM_PLATFORM}.${TARGETARCH}.rpm -ARG KONG_ARTIFACT_PATH= -COPY ${KONG_ARTIFACT_PATH}${KONG_ARTIFACT} /tmp/kong.rpm +ARG KONG_ARTIFACT_PATH # hadolint ignore=DL3015 -RUN yum update -y \ - && yum install -y /tmp/kong.rpm \ - && rm /tmp/kong.rpm \ +RUN --mount=type=bind,source=${KONG_ARTIFACT_PATH},target=/tmp/pkg \ + yum update -y \ + && yum install -y /tmp/pkg/${KONG_ARTIFACT} \ && chown kong:0 /usr/local/bin/kong \ && chown -R kong:0 /usr/local/kong \ && ln -sf /usr/local/openresty/bin/resty /usr/local/bin/resty \