|
1 | | -ARG DOCKER=docker:27.3.1-dind |
| 1 | +ARG DOCKER=docker:27.5.1-dind |
2 | 2 |
|
3 | 3 | FROM $DOCKER AS docker |
4 | 4 |
|
5 | | -FROM alpine:3.20.3 AS build-container-drone |
| 5 | +FROM alpine:3.21.3 AS build-container-drone |
6 | 6 |
|
7 | 7 | # renovate: datasource=github-releases depName=docker/buildx |
8 | | -ARG BUILDX_VERSION=v0.18.0 |
| 8 | +ARG BUILDX_VERSION=v0.20.1 |
9 | 9 | # renovate: datasource=github-releases extractVersion=^v(?<version>.*)$ depName=hashicorp/terraform |
10 | 10 | ARG TERRAFORM_VERSION=1.7.3 |
11 | 11 |
|
@@ -75,40 +75,184 @@ ADD hack/scripts/ /usr/local/bin/ |
75 | 75 |
|
76 | 76 | COPY --from=docker /usr/local/bin/docker /usr/local/bin/dockerd /usr/local/bin/ |
77 | 77 |
|
78 | | -FROM ghcr.io/actions-runner-controller/actions-runner-controller/actions-runner-dind:ubuntu-22.04 AS build-container-ghaction |
| 78 | +# renovate: datasource=github-releases extractVersion=^gha-runner-scale-set-(?<version>.*)$ depName=actions/actions-runner-controller |
| 79 | +ARG ACTIONS_RUNNER_CONTROLLER_VERSION=0.10.1 |
| 80 | +FROM scratch AS actions-runner-controller-source |
| 81 | +ADD https://github.com/actions/actions-runner-controller.git#${ACTIONS_RUNNER_CONTROLLER_VERSION}:runner / |
| 82 | + |
| 83 | +# Ref: https://github.com/actions/actions-runner-controller/blob/master/runner/actions-runner-dind.ubuntu-22.04.dockerfile |
| 84 | +FROM ubuntu:25.04 AS build-container-ghaction |
| 85 | + |
| 86 | +ARG TARGETPLATFORM |
| 87 | +# renovate: datasource=github-releases extractVersion=^v(?<version>.*)$ depName=actions/runner |
| 88 | +ARG RUNNER_VERSION=2.322.0 |
| 89 | +# renovate: datasource=github-releases extractVersion=^v(?<version>.*)$ depName=actions/runner-container-hooks |
| 90 | +ARG RUNNER_CONTAINER_HOOKS_VERSION=0.6.2 |
| 91 | +# Docker and Docker Compose arguments |
| 92 | +ARG CHANNEL=stable |
| 93 | +# renovate: datasource=github-releases extractVersion=^v(?<version>.*)$ depName=moby/moby |
| 94 | +ARG DOCKER_VERSION=27.5.1 |
| 95 | +# renovate: datasource=github-releases depName=docker/compose |
| 96 | +ARG DOCKER_COMPOSE_VERSION=v2.33.0 |
| 97 | +# renovate: datasource=github-releases extractVersion=^v(?<version>.*)$ depName=yelp/dumb-init |
| 98 | +ARG DUMB_INIT_VERSION=1.2.5 |
| 99 | +ARG RUNNER_USER_UID=1001 |
| 100 | +ARG DOCKER_GROUP_GID=121 |
| 101 | + |
79 | 102 | # renovate: datasource=github-releases depName=google/go-containerregistry |
80 | | -ARG CRANE_VERSION=v0.20.2 |
| 103 | +ARG CRANE_VERSION=v0.20.3 |
81 | 104 | # renovate: datasource=github-releases depName=mikefarah/yq |
82 | | -ARG YQ_VERSION=v4.44.3 |
| 105 | +ARG YQ_VERSION=v4.45.1 |
83 | 106 | # renovate: datasource=github-releases depName=getsops/sops |
84 | | -ARG SOPS_VERSION=v3.9.1 |
| 107 | +ARG SOPS_VERSION=v3.9.4 |
85 | 108 | # renovate: datasource=github-tags depName=aws/aws-cli |
86 | | -ARG AWSCLI_VERSION=2.19.1 |
87 | | -USER root |
88 | | -RUN apt update && \ |
89 | | - apt upgrade -y && \ |
90 | | - apt install -y \ |
91 | | - --no-install-recommends \ |
92 | | - curl \ |
93 | | - diffoscope \ |
94 | | - docker.io \ |
95 | | - gh \ |
96 | | - iproute2 \ |
97 | | - iptables \ |
98 | | - make \ |
99 | | - mkisofs \ |
100 | | - openssh-client \ |
101 | | - ovmf \ |
102 | | - qemu-system \ |
103 | | - qemu-utils \ |
104 | | - socat \ |
105 | | - swtpm \ |
106 | | - tmux \ |
107 | | - unzip \ |
108 | | - zstd |
| 109 | +ARG AWSCLI_VERSION=2.24.5 |
| 110 | + |
| 111 | +ENV DEBIAN_FRONTEND=noninteractive |
| 112 | +RUN apt-get update -y \ |
| 113 | + && apt-get install -y software-properties-common \ |
| 114 | + && add-apt-repository -y ppa:git-core/ppa \ |
| 115 | + && apt-get update -y \ |
| 116 | + && apt-get install -y --no-install-recommends \ |
| 117 | + curl \ |
| 118 | + ca-certificates \ |
| 119 | + git \ |
| 120 | + iptables \ |
| 121 | + jq \ |
| 122 | + software-properties-common \ |
| 123 | + sudo \ |
| 124 | + unzip \ |
| 125 | + zip \ |
| 126 | + && rm -rf /var/lib/apt/lists/* |
| 127 | + |
| 128 | +RUN apt-get update -y && \ |
| 129 | + apt upgrade -y && \ |
| 130 | + apt install -y \ |
| 131 | + --no-install-recommends \ |
| 132 | + curl \ |
| 133 | + diffoscope \ |
| 134 | + gh \ |
| 135 | + iproute2 \ |
| 136 | + iptables \ |
| 137 | + make \ |
| 138 | + mkisofs \ |
| 139 | + openssh-client \ |
| 140 | + ovmf \ |
| 141 | + qemu-system \ |
| 142 | + qemu-utils \ |
| 143 | + socat \ |
| 144 | + swtpm \ |
| 145 | + tmux \ |
| 146 | + unzip \ |
| 147 | + zstd \ |
| 148 | + libicu76 \ |
| 149 | + net-tools \ |
| 150 | + && rm -rf /var/lib/apt/lists/* |
109 | 151 |
|
110 | 152 | RUN curl -fSL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -o /usr/bin/yq && chmod +x /usr/bin/yq |
111 | 153 | RUN curl -fSL https://github.com/google/go-containerregistry/releases/download/${CRANE_VERSION}/go-containerregistry_Linux_x86_64.tar.gz | tar xzf - -C /usr/local/bin/ crane |
112 | 154 | RUN curl -fSL https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux.amd64 -o /usr/bin/sops && chmod +x /usr/bin/sops |
113 | 155 | RUN curl -fSL https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWSCLI_VERSION}.zip -o awscliv2.zip && unzip awscliv2.zip && ./aws/install && rm -rf awscliv2.zip aws |
| 156 | + |
| 157 | +# Runner user |
| 158 | +RUN adduser --disabled-password --gecos "" --uid $RUNNER_USER_UID runner \ |
| 159 | + && groupadd docker --gid $DOCKER_GROUP_GID \ |
| 160 | + && usermod -aG sudo runner \ |
| 161 | + && usermod -aG docker runner \ |
| 162 | + && echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \ |
| 163 | + && echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers |
| 164 | + |
| 165 | +ENV HOME=/home/runner |
| 166 | + |
| 167 | +RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ |
| 168 | + && if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \ |
| 169 | + && if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x86_64 ; fi \ |
| 170 | + && curl -fLo /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_${ARCH} \ |
| 171 | + && chmod +x /usr/bin/dumb-init |
| 172 | + |
| 173 | +# installdependencies.sh is not updated for Ubuntu 25.04, so we add libicu76 manually above. |
| 174 | +ENV RUNNER_ASSETS_DIR=/runnertmp |
| 175 | +RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ |
| 176 | + && if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x64 ; fi \ |
| 177 | + && mkdir -p "$RUNNER_ASSETS_DIR" \ |
| 178 | + && cd "$RUNNER_ASSETS_DIR" \ |
| 179 | + && curl -fLo runner.tar.gz https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-${ARCH}-${RUNNER_VERSION}.tar.gz \ |
| 180 | + && tar xzf ./runner.tar.gz \ |
| 181 | + && rm -f runner.tar.gz \ |
| 182 | + && ./bin/installdependencies.sh \ |
| 183 | + # libyaml-dev is required for ruby/setup-ruby action. |
| 184 | + # It is installed after installdependencies.sh and before removing /var/lib/apt/lists |
| 185 | + # to avoid rerunning apt-update on its own. |
| 186 | + && apt-get install -y libyaml-dev \ |
| 187 | + && rm -rf /var/lib/apt/lists/* |
| 188 | + |
| 189 | +ENV RUNNER_TOOL_CACHE=/opt/hostedtoolcache |
| 190 | +RUN mkdir /opt/hostedtoolcache \ |
| 191 | + && chgrp docker /opt/hostedtoolcache \ |
| 192 | + && chmod g+rwx /opt/hostedtoolcache |
| 193 | + |
| 194 | +RUN cd "$RUNNER_ASSETS_DIR" \ |
| 195 | + && curl -fLo 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 \ |
| 196 | + && unzip ./runner-container-hooks.zip -d ./k8s \ |
| 197 | + && rm -f runner-container-hooks.zip |
| 198 | + |
| 199 | +RUN set -vx; \ |
| 200 | + export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ |
| 201 | + && if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \ |
| 202 | + && if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x86_64 ; fi \ |
| 203 | + && curl -fLo docker.tgz https://download.docker.com/linux/static/${CHANNEL}/${ARCH}/docker-${DOCKER_VERSION}.tgz \ |
| 204 | + && tar zxvf docker.tgz \ |
| 205 | + && install -o root -g root -m 755 docker/* /usr/bin/ \ |
| 206 | + && rm -rf docker docker.tgz |
| 207 | + |
| 208 | +RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ |
| 209 | + && if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \ |
| 210 | + && if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x86_64 ; fi \ |
| 211 | + && mkdir -p /usr/libexec/docker/cli-plugins \ |
| 212 | + && curl -fLo /usr/libexec/docker/cli-plugins/docker-compose https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-${ARCH} \ |
| 213 | + && chmod +x /usr/libexec/docker/cli-plugins/docker-compose \ |
| 214 | + && ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose \ |
| 215 | + && which docker-compose \ |
| 216 | + && docker compose version |
| 217 | + |
| 218 | +# We place the scripts in `/usr/bin` so that users who extend this image can |
| 219 | +# override them with scripts of the same name placed in `/usr/local/bin`. |
| 220 | +ARG RUNNER_CONTROLLER_SCRIPT_DIR_URL=https://raw.githubusercontent.com/actions/actions-runner-controller/refs/tags/gha-runner-scale-set-0.10.1/runner |
| 221 | +ADD ${RUNNER_CONTROLLER_SCRIPT_DIR_URL}/entrypoint-dind.sh \ |
| 222 | + ${RUNNER_CONTROLLER_SCRIPT_DIR_URL}/startup.sh \ |
| 223 | + ${RUNNER_CONTROLLER_SCRIPT_DIR_URL}/logger.sh \ |
| 224 | + ${RUNNER_CONTROLLER_SCRIPT_DIR_URL}/wait.sh \ |
| 225 | + ${RUNNER_CONTROLLER_SCRIPT_DIR_URL}/graceful-stop.sh \ |
| 226 | + ${RUNNER_CONTROLLER_SCRIPT_DIR_URL}/update-status \ |
| 227 | + /usr/bin/ |
| 228 | +COPY --from=actions-runner-controller-source \ |
| 229 | + /entrypoint-dind.sh \ |
| 230 | + /startup.sh \ |
| 231 | + /logger.sh \ |
| 232 | + /wait.sh \ |
| 233 | + /graceful-stop.sh \ |
| 234 | + /update-status \ |
| 235 | + /usr/bin/ |
| 236 | +RUN chmod +x /usr/bin/entrypoint-dind.sh /usr/bin/startup.sh |
| 237 | + |
| 238 | +# Copy the docker shim which propagates the docker MTU to underlying networks |
| 239 | +# to replace the docker binary in the PATH. |
| 240 | +COPY --from=actions-runner-controller-source /docker-shim.sh /usr/local/bin/docker |
| 241 | + |
| 242 | +# Configure hooks folder structure. |
| 243 | +COPY --from=actions-runner-controller-source /hooks /etc/arc/hooks/ |
| 244 | + |
| 245 | +VOLUME /var/lib/docker |
| 246 | + |
| 247 | +# Add the Python "User Script Directory" to the PATH |
| 248 | +ENV PATH="${PATH}:${HOME}/.local/bin" |
| 249 | +ENV ImageOS=ubuntu25 |
| 250 | + |
| 251 | +RUN echo "PATH=${PATH}" > /etc/environment \ |
| 252 | + && echo "ImageOS=${ImageOS}" >> /etc/environment |
| 253 | + |
| 254 | +# No group definition, as that makes it harder to run docker. |
114 | 255 | USER runner |
| 256 | + |
| 257 | +ENTRYPOINT ["/bin/bash", "-c"] |
| 258 | +CMD ["entrypoint-dind.sh"] |
0 commit comments