generated from ministryofjustice/analytical-platform-image-build-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (51 loc) · 2.35 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
#checkov:skip=CKV_DOCKER_2:actions/runner does not provider a mechanism for checking the health of the service
FROM public.ecr.aws/ubuntu/ubuntu@sha256:da20fb875cfefd317c49e7aaf3998d3e5ad42c5b20f34a0eec6dca2fe4fbb8f4
LABEL org.opencontainers.image.vendor="Ministry of Justice" \
org.opencontainers.image.authors="Analytical Platform" \
org.opencontainers.image.title="Actions Runner" \
org.opencontainers.image.description="Actions Runner image for Analytical Platform" \
org.opencontainers.image.url="https://github.com/ministryofjustice/analytical-platform-actions-runner"
ENV CONTAINER_USER="runner" \
CONTAINER_UID="10000" \
CONTAINER_GROUP="runner" \
CONTAINER_GID="10000" \
CONTAINER_HOME="/actions-runner" \
DEBIAN_FRONTEND="noninteractive" \
ACTIONS_RUNNER_VERSION="2.321.0" \
ACTIONS_RUNNER_PKG_SHA="ba46ba7ce3a4d7236b16fbe44419fb453bc08f866b24f04d549ec89f1722a29e"
SHELL ["/bin/bash", "-e", "-u", "-o", "pipefail", "-c"]
RUN <<EOF
groupadd \
--gid ${CONTAINER_GID} \
--system \
${CONTAINER_GROUP}
useradd \
--uid ${CONTAINER_UID} \
--gid ${CONTAINER_GROUP} \
--create-home \
${CONTAINER_USER}
mkdir --parents ${CONTAINER_HOME}
chown --recursive ${CONTAINER_USER}:${CONTAINER_GROUP} ${CONTAINER_HOME}
apt-get update
apt-get install --yes --no-install-recommends \
"apt-transport-https=2.7.14build2" \
"ca-certificates=20240203" \
"curl=8.5.0-2ubuntu10.5" \
"git=1:2.43.0-1ubuntu7.1" \
"jq=1.7.1-3build1" \
"libicu-dev=74.2-1ubuntu3.1" \
"lsb-release=12.0-2" \
"gcc=4:13.2.0-7ubuntu1" \
"libsqlite3-dev=3.45.1-1ubuntu2"
apt-get clean
rm -rf /var/lib/apt/lists/*
curl --location "https://github.com/actions/runner/releases/download/v${ACTIONS_RUNNER_VERSION}/actions-runner-linux-x64-${ACTIONS_RUNNER_VERSION}.tar.gz" \
--output "actions-runner-linux-x64-${ACTIONS_RUNNER_VERSION}.tar.gz"
echo "${ACTIONS_RUNNER_PKG_SHA}" "actions-runner-linux-x64-${ACTIONS_RUNNER_VERSION}.tar.gz" | /usr/bin/sha256sum --check
tar --extract --gzip --file="actions-runner-linux-x64-${ACTIONS_RUNNER_VERSION}.tar.gz" --directory="${CONTAINER_HOME}"
rm --force "actions-runner-linux-x64-${ACTIONS_RUNNER_VERSION}.tar.gz"
EOF
USER ${CONTAINER_USER}
WORKDIR ${CONTAINER_HOME}
COPY --chown=nobody:nogroup --chmod=0755 src/usr/local/bin/entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]