From 02675f9b30cfe11cb14d305e54e1ab1a87723d91 Mon Sep 17 00:00:00 2001 From: Chris Cosby Date: Tue, 16 Jul 2024 00:04:48 +0000 Subject: [PATCH] Docker: Do a little cleanup on docker and plugin installations --- images/Dockerfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/images/Dockerfile b/images/Dockerfile index 9338fae7b9b..9528ebc09bf 100644 --- a/images/Dockerfile +++ b/images/Dockerfile @@ -14,25 +14,26 @@ RUN apt update -y && apt install -y --no-install-recommends curl unzip RUN export RUNNER_ARCH=${TARGETARCH} \ && if [ "$RUNNER_ARCH" = "amd64" ]; then export RUNNER_ARCH=x64 ; fi \ - && curl -f -L -o runner.tar.gz https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-${TARGETOS}-${RUNNER_ARCH}-${RUNNER_VERSION}.tar.gz \ + && curl -fsSLo runner.tar.gz https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-${TARGETOS}-${RUNNER_ARCH}-${RUNNER_VERSION}.tar.gz \ && tar xzf ./runner.tar.gz \ && rm runner.tar.gz -RUN curl -f -L -o runner-container-hooks.zip https://github.com/actions/runner-container-hooks/releases/download/v${RUNNER_CONTAINER_HOOKS_VERSION}/actions-runner-hooks-k8s-${RUNNER_CONTAINER_HOOKS_VERSION}.zip \ +RUN curl -fsSLo runner-container-hooks.zip https://github.com/actions/runner-container-hooks/releases/download/v${RUNNER_CONTAINER_HOOKS_VERSION}/actions-runner-hooks-k8s-${RUNNER_CONTAINER_HOOKS_VERSION}.zip \ && unzip ./runner-container-hooks.zip -d ./k8s \ && rm runner-container-hooks.zip -WORKDIR /actions-docker +WORKDIR /docker RUN export RUNNER_ARCH=${TARGETARCH} \ && if [ "$RUNNER_ARCH" = "amd64" ]; then export DOCKER_ARCH=x86_64 ; fi \ && if [ "$RUNNER_ARCH" = "arm64" ]; then export DOCKER_ARCH=aarch64 ; fi \ - && curl -fLo docker.tgz https://download.docker.com/${TARGETOS}/static/stable/${DOCKER_ARCH}/docker-${DOCKER_VERSION}.tgz \ + && curl -fsSLo 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 /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}" \ - && chmod +x /usr/local/lib/docker/cli-plugins/docker-buildx + # Get CLI plugins + && rm -rf plugins \ + && mkdir -p plugins \ + # docker-buildx + && curl -fsSLo plugins/docker-buildx "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-${TARGETARCH}" # Configure git-core/ppa based on guidance here: https://git-scm.com/download/linux # The second `apt update` isn't strictly necessary, but let's leave it here to force the @@ -55,8 +56,8 @@ COPY --from=build /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/ COPY --from=build /etc/apt/trusted.gpg.d/*.gpg /etc/apt/trusted.gpg.d/ # Copy Docker files from build stage -COPY --from=build --chown=root:root --chmod=0755 /actions-docker/docker/* /usr/bin/ -COPY --from=build /usr/local/lib/docker/cli-plugins/docker-buildx /usr/local/lib/docker/cli-plugins/docker-buildx +COPY --from=build --chown=root:root --chmod=0755 /docker/docker/* /usr/bin/ +COPY --from=build --chown=root:root --chmod=0755 /docker/plugins/* /usr/local/lib/docker/cli-plugins/ # Install a sane set of base utilities RUN apt update -y \