-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (49 loc) · 1.6 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
FROM ubuntu:22.04
SHELL ["/bin/bash", "-c"]
ARG RUNNER_VERSION
ENV RUNNER_VERSION="${RUNNER_VERSION:-2.319.1}"
ENV DEBIAN_FRONTEND=noninteractive
ENV HOME="/home/docker"
ENV RELEASE_URL="https://github.com/actions/runner/releases"
# Set top-level working directory
WORKDIR ${HOME}
# Update the base packages and add a non-sudo user
RUN apt-get update -y && \
apt-get upgrade -y && \
useradd -m docker
# Install the packages and dependencies
RUN apt-get install -y --no-install-recommends \
curl \
wget \
unzip \
vim \
git \
jq \
build-essential \
libssl-dev \
libffi-dev \
python3.10 \
python3.10-venv \
python3.10-dev \
python3-pip \
nodejs \
npm \
golang-go
# Create a symbolic link for python pointing to python3.10
RUN ln -s /usr/bin/python3.10 /usr/bin/python
# https://github.com/rust-lang/rustup/issues/297#issuecomment-444818896
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="${HOME}/.cargo/bin:${PATH}"
# Download and unzip the github actions runner
RUN mkdir actions-runner && cd actions-runner \
&& curl -O -L ${RELEASE_URL}/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
&& tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz
# Install additional dependencies
RUN chown -R docker ~docker && /home/docker/actions-runner/bin/installdependencies.sh
# Copy ALL scripts make them executable
COPY scripts/* .
RUN chmod +x *.sh
# Set the user to "docker" so all subsequent commands are run as the docker user
USER docker
# Set the entrypoint to the start.sh script
ENTRYPOINT ["./start.sh"]