-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (49 loc) · 1.89 KB
/
Dockerfile
File metadata and controls
63 lines (49 loc) · 1.89 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
62
63
FROM ubuntu:24.04 AS deps
ARG RUNNER_VERSION="2.330.0"
ARG RUNNER_HOME="/opt/actions-runner"
ARG RUNNER_USER="github"
RUN apt-get update -y && apt-get upgrade -y && useradd -m ${RUNNER_USER}
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
gettext-base \
jq \
libffi-dev \
libssl-dev \
python3 \
python3-dev \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
RUN install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc \
&& chmod a+r /etc/apt/keyrings/docker.asc
RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
containerd.io \
docker-buildx-plugin \
docker-ce \
docker-ce-cli \
docker-compose-plugin \
&& usermod -a -G docker ${RUNNER_USER} \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p ${RUNNER_HOME} && chown -R ${RUNNER_USER}:${RUNNER_USER} ${RUNNER_HOME}
USER ${RUNNER_USER}
RUN cd ${RUNNER_HOME} \
&& curl -O -L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
&& tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
&& rm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz
USER root
RUN bash ${RUNNER_HOME}/bin/installdependencies.sh && rm -rf /var/lib/apt/lists/*
FROM deps AS runner
WORKDIR ${RUNNER_HOME}
# copy over scripts
COPY scripts/ .
RUN envsubst < cleanup.sh > cleanup.sh.tmp && mv cleanup.sh.tmp cleanup.sh
RUN chmod +x cleanup.sh
USER ${RUNNER_USER}