forked from beikeni/github-runner-dockerfile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (21 loc) · 1.12 KB
/
Dockerfile
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
FROM ubuntu:22.04
ARG RUNNER_VERSION="2.314.1"
# Prevents installdependencies.sh from prompting the user and blocking the image creation
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update -y && apt upgrade -y && useradd -m docker
RUN apt install -y --no-install-recommends \
curl jq build-essential libssl-dev libffi-dev python3 python3-venv python3-dev python3-pip libdigest-sha-perl git
# since the config and run script for actions are not allowed to be run by root,
# set the user to "docker" so all subsequent commands are run as the docker user
USER docker
WORKDIR /home/docker
RUN mkdir actions-runner && cd actions-runner
ADD --chown=docker:docker https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz /home/docker/actions-runner
RUN tar xzf /home/docker/actions-runner/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz -C /home/docker/actions-runner
USER root
RUN /home/docker/actions-runner/bin/installdependencies.sh
USER docker
COPY --chown=docker:docker start.sh start.sh
# make the script executable
RUN chmod +x start.sh
ENTRYPOINT ["./start.sh"]