-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (49 loc) · 1.85 KB
/
Copy pathDockerfile
File metadata and controls
61 lines (49 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM debian:11-slim AS runner-downloader
ARG RUNNER_VERSION=2.328.0
WORKDIR /runner
ARG TARGETARCH
RUN apt update && apt install -y --no-install-recommends curl ca-certificates && \
case ${TARGETARCH} in \
amd64) ARCH_SUFFIX="x64" ;; \
arm64) ARCH_SUFFIX="arm64" ;; \
*) echo "Unsupported architecture: ${TARGETARCH}" >&2; exit 1 ;; \
esac && \
curl -o actions-runner.tar.gz -L "https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-${ARCH_SUFFIX}-${RUNNER_VERSION}.tar.gz" && \
tar xzf actions-runner.tar.gz && \
rm actions-runner.tar.gz && \
apt purge -y --auto-remove curl ca-certificates && \
rm -rf /var/lib/apt/lists/*
FROM debian:11-slim AS final
RUN set -eux; \
apt update; \
apt install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
bash \
libicu-dev \
libssl-dev; \
install -m 0755 -d /etc/apt/keyrings; \
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc; \
chmod a+r /etc/apt/keyrings/docker.asc; \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian bullseye stable" > /etc/apt/sources.list.d/docker.list; \
apt update; \
apt install -y --no-install-recommends docker-ce-cli; \
apt purge -y --auto-remove gnupg; \
apt clean && rm -rf /var/lib/apt/lists/*
WORKDIR /runner
COPY --from=runner-downloader /runner .
ENV RUNNER_ALLOW_RUNASROOT=1
RUN cat <<EOF > ./entrypoint.sh
#!/bin/bash
set -e
if [ ! -f ".runner" ]; then
echo "Configuring runner..."
./config.sh --url \$URL --token \$RUNNER_TOKEN --name \$RUNNER_NAME --unattended
else
echo "Runner already configured. Skipping config."
fi
exec ./run.sh
EOF
RUN chmod +x ./entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]