-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (43 loc) · 1.7 KB
/
Dockerfile
File metadata and controls
54 lines (43 loc) · 1.7 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
44
45
46
47
48
49
50
51
52
53
54
FROM ubuntu:22.04
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install required dependencies
RUN apt-get update && apt-get install -y \
curl \
tar \
git \
jq \
dos2unix \
libicu-dev \
libssl-dev \
ca-certificates \
sudo \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user to run the runner
RUN useradd -m -s /bin/bash runner && \
echo "runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Set up the runner directory
WORKDIR /home/runner/actions-runner
# Download and extract the runner package
RUN curl -o actions-runner-linux-x64-2.331.0.tar.gz -L \
https://github.com/actions/runner/releases/download/v2.331.0/actions-runner-linux-x64-2.331.0.tar.gz && \
echo "5fcc01bd546ba5c3f1291c2803658ebd3cedb3836489eda3be357d41bfcf28a7 actions-runner-linux-x64-2.331.0.tar.gz" | shasum -a 256 -c && \
tar xzf actions-runner-linux-x64-2.331.0.tar.gz && \
rm actions-runner-linux-x64-2.331.0.tar.gz
# Install runner dependencies
RUN ./bin/installdependencies.sh
# Change ownership to the runner user
RUN chown -R runner:runner /home/runner/actions-runner
# Copy the entrypoint script and fix Windows CRLF line endings
COPY entrypoint.sh /home/runner/entrypoint.sh
RUN dos2unix /home/runner/entrypoint.sh && \
chmod +x /home/runner/entrypoint.sh && \
chown runner:runner /home/runner/entrypoint.sh
USER runner
# Install AWS CLI v2
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip && \
sudo apt-get install -y unzip && \
unzip /tmp/awscliv2.zip -d /tmp && \
sudo /tmp/aws/install && \
rm -rf /tmp/awscliv2.zip /tmp/aws
ENTRYPOINT ["/home/runner/entrypoint.sh"]