-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (35 loc) · 1.13 KB
/
Dockerfile
File metadata and controls
43 lines (35 loc) · 1.13 KB
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
FROM amazonlinux:2023
# Install dependencies
RUN dnf update -y && \
dnf install -y --allowerasing \
curl \
tar \
gzip \
libicu \
openssl \
git \
jq \
which \
findutils \
shadow-utils \
sudo \
&& dnf clean all
# Create a non-root user for the runner
RUN useradd -m -s /bin/bash runner && \
echo "runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Set up runner directory
WORKDIR /home/runner/actions-runner
# Download and extract the latest runner (ARM64)
ARG RUNNER_VERSION=2.329.0
RUN curl -o actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz -L \
https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz && \
tar xzf actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz && \
rm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz
# Change ownership to runner user
RUN chown -R runner:runner /home/runner
# Switch to runner user
USER runner
# Copy entrypoint script
COPY --chown=runner:runner entrypoint.sh /home/runner/entrypoint.sh
RUN chmod +x /home/runner/entrypoint.sh
ENTRYPOINT ["/home/runner/entrypoint.sh"]