forked from SanderKnape/github-runner
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
68 lines (55 loc) · 2.5 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
56
57
58
59
60
61
62
63
64
65
66
67
FROM debian:buster-slim
ENV GITHUB_PAT ""
ENV GITHUB_TOKEN ""
ENV GITHUB_OWNER ""
ENV GITHUB_REPOSITORY ""
ENV RUNNER_WORKDIR "_work"
ENV RUNNER_LABELS ""
ENV ADDITIONAL_PACKAGES ""
ADD https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz /opt/oc/release.tar.gz
RUN tar --strip-components=1 -xzvf /opt/oc/release.tar.gz -C /opt/oc/ && \
mv /opt/oc/oc /usr/bin/ && \
rm -rf /opt/oc
RUN apt-get update \
&& apt-get install -y \
curl \
sudo \
git \
jq \
iputils-ping \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m github \
&& usermod -aG sudo github \
&& echo "github ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
COPY [ "certs/AXA-Enterprise-Root-CA.crt", "certs/AXA-Proxy-ROOT-CA.crt", "/usr/local/share/ca-certificates/" ]
RUN update-ca-certificates
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 --preserve-env=HTTP_PROXY --preserve-env=HTTPS_PROXY --preserve-env=http_proxy --preserve-env=https_proxy ./bin/installdependencies.sh \
&& sudo chgrp -R 0 /home/github \
&& sudo chmod -R g+w /home/github
RUN curl -v -skL -o /tmp/helm.tar.gz https://get.helm.sh/helm-v3.10.0-linux-amd64.tar.gz && \
tar -C /tmp -xzf /tmp/helm.tar.gz && \
sudo mv /tmp/linux-amd64/helm /usr/local/bin && \
sudo chmod -R 775 /usr/local/bin/helm && \
rm -rf /tmp/helm.tar.gz && \
rm -rf /tmp/linux-amd64 && \
sudo mkdir /.kube && \
sudo chgrp -R 0 /.kube && \
sudo chmod -R g+w /.kube
COPY --chown=github:root entrypoint.sh runsvc.sh ./
RUN sudo chmod ug+x ./entrypoint.sh ./runsvc.sh
COPY --chown=github:root contrib/bin/* /usr/local/bin/
COPY --chown=github:root contrib/tmp/* /tmp/
RUN sudo chmod a+x /usr/local/bin/age && \
sudo mkdir -p "/.local/share/helm/plugins" && \
sudo tar -C "/.local/share/helm/plugins" -xzf /tmp/helm-secrets.tar.gz && \
curl -v -skL -o /tmp/sops https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux.amd64 && \
sudo mv /tmp/sops /usr/local/bin/ && \
sudo chmod -R 775 /usr/local/bin/sops && \
rm -rf /tmp/sops && \
rm /tmp/helm-secrets.tar.gz
ENTRYPOINT ["/home/github/entrypoint.sh"]