This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
forked from SanderKnape/github-runner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
55 lines (46 loc) · 1.92 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM ubuntu:18.04
ENV GITHUB_PAT ""
ENV GITHUB_OWNER ""
ENV GITHUB_REPOSITORY ""
ENV RUNNER_WORKDIR "_work"
ENV RUNNER_LABELS ""
ENV AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
RUN apt-get update \
&& apt-get install -y \
wget \
curl \
sudo \
git \
jq \
iputils-ping \
apt-transport-https \
ca-certificates \
gnupg-agent \
software-properties-common \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - \
&& sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable" \
&& sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" \
&& wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_18.04/Release.key -O Release.key \
&& sudo apt-key add - < Release.key \
&& apt-get update \
&& apt-get install -y docker-ce docker-ce-cli containerd.io buildah \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m github \
&& usermod -aG sudo github \
&& usermod -aG docker github \
&& echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& mkdir -p opt/hostedtoolcache
RUN sudo chown github opt/hostedtoolcache/.
USER github
WORKDIR /home/github
RUN GITHUB_RUNNER_VERSION=$(curl --silent "https://api.github.com/repos/actions/runner/releases/latest" | jq -r '.tag_name[1:]') \
&& curl -Ls https://github.com/actions/runner/releases/download/v${GITHUB_RUNNER_VERSION}/actions-runner-linux-x64-${GITHUB_RUNNER_VERSION}.tar.gz | tar xz \
&& sudo ./bin/installdependencies.sh
COPY --chown=github:github entrypoint.sh runsvc.sh ./
RUN sudo chmod u+x ./entrypoint.sh ./runsvc.sh
# dummy change
ENTRYPOINT ["/home/github/entrypoint.sh"]