From 28257ca44e66d164b2629f5c2b4136e04786ca7d Mon Sep 17 00:00:00 2001 From: Artur Martins Date: Mon, 8 Jun 2026 15:48:37 +0100 Subject: [PATCH] Improve Dockerfile: Remove unnecessary layer Moving the docker binaries into the build layer and copy it directly to the expected path. --- images/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/images/Dockerfile b/images/Dockerfile index a33066e5e2c..01a7b91c21c 100644 --- a/images/Dockerfile +++ b/images/Dockerfile @@ -31,6 +31,9 @@ RUN export RUNNER_ARCH=${TARGETARCH} \ && curl -fLo docker.tgz https://download.docker.com/${TARGETOS}/static/stable/${DOCKER_ARCH}/docker-${DOCKER_VERSION}.tgz \ && tar zxvf docker.tgz \ && rm -rf docker.tgz \ + && mkdir -p /docker-bin \ + && install -o root -g root -m 755 docker/* /docker-bin/ \ + && rm -rf docker \ && mkdir -p /usr/local/lib/docker/cli-plugins \ && curl -fLo /usr/local/lib/docker/cli-plugins/docker-buildx \ "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-${TARGETARCH}" \ @@ -65,8 +68,8 @@ RUN adduser --disabled-password --gecos "" --uid 1001 runner \ WORKDIR /home/runner COPY --chown=runner:docker --from=build /actions-runner . -COPY --from=build /usr/local/lib/docker/cli-plugins/docker-buildx /usr/local/lib/docker/cli-plugins/docker-buildx +COPY --from=build /docker-bin/ /usr/bin/ -RUN install -o root -g root -m 755 docker/* /usr/bin/ && rm -rf docker +COPY --from=build /usr/local/lib/docker/cli-plugins/docker-buildx /usr/local/lib/docker/cli-plugins/docker-buildx USER runner