-
Notifications
You must be signed in to change notification settings - Fork 33
/
Dockerfile
70 lines (59 loc) · 2.57 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
68
69
70
#Note: This virtualenvironments image is not being updated anymore. See the README.
FROM quay.io/evryfs/base-ubuntu:focal-20221130
# This the release tag of virtual-environments: https://github.com/actions/virtual-environments/releases
ARG UBUNTU_VERSION=2004
ARG VIRTUAL_ENVIRONMENT_VERSION=ubuntu20/20230409.1
ENV UBUNTU_VERSION=${UBUNTU_VERSION} VIRTUAL_ENVIRONMENT_VERSION=${VIRTUAL_ENVIRONMENT_VERSION}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install base packages.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
sudo=1.8.* \
lsb-release=11.1.* \
software-properties-common=0.99.* \
gnupg-agent=2.2.* \
openssh-client=1:8.* \
make=4.*\
rsync \
wget \
jq=1.* \
amazon-ecr-credential-helper=0.3.* && \
apt-get -y clean && \
rm -rf /var/cache/apt /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Add sudo rule for runner user
RUN echo "runner ALL= EXEC: NOPASSWD:ALL" >> /etc/sudoers.d/runner
# Update git.
RUN add-apt-repository -y ppa:git-core/ppa && \
apt-get update && \
apt-get -y install --no-install-recommends git=1:2.40.* && \
apt-get -y clean && \
rm -rf /var/cache/apt /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install docker cli.
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg > /etc/apt/trusted.gpg.d/docker.asc && \
echo "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-get install -y --no-install-recommends docker-ce-cli=5:20.10.* && \
apt-get -y clean && \
rm -rf /var/cache/apt /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Copy scripts.
COPY scripts/ /usr/local/bin/
# Install additional distro packages and runner virtual envs
ARG VIRTUAL_ENV_PACKAGES=""
ARG VIRTUAL_ENV_INSTALLS="basic python aws azure-cli docker-compose nodejs"
RUN apt-get -y update && \
( [ -z "$VIRTUAL_ENV_PACKAGES" ] || apt-get -y --no-install-recommends install $VIRTUAL_ENV_PACKAGES ) && \
. /usr/local/bin/install-from-virtual-env-helpers && \
for package in ${VIRTUAL_ENV_INSTALLS}; do \
install-from-virtual-env $package; \
done && \
apt-get -y install --no-install-recommends gosu=1.* && \
apt-get -y clean && \
rm -rf /virtual-environments /var/cache/apt /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install runner and its dependencies.
RUN groupadd -g 121 runner && useradd -mr -d /home/runner -u 1001 -g 121 runner && \
install-runner
COPY entrypoint.sh /
WORKDIR /home/runner
USER runner
ENTRYPOINT ["/entrypoint.sh"]