-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile.ubuntu
70 lines (51 loc) · 2.35 KB
/
Dockerfile.ubuntu
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
FROM ubuntu:22.04
ARG RUNNERREPO="https://github.com/actions/runner" RUNNERPATCH SDK ARCH BTOOLS
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq update -y && \
apt-get -qq -y install wget git sudo alien curl libicu70 sudo && \
apt autoclean
COPY build-files/convert-rpm.sh /tmp
RUN /tmp/convert-rpm.sh ${SDK}
RUN dpkg --install /tmp/*.deb && \
rm -rf /tmp/*.deb && \
echo "Using SDK - `dotnet --version`"
ADD ${RUNNERPATCH} /tmp/runner.patch
RUN cd /tmp && \
git clone -q ${RUNNERREPO} && \
cd runner && \
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) -b build && \
git apply /tmp/runner.patch
RUN if [ "${SDK}" -ne 6 ]; then \
cd /usr/lib64/dotnet/packs; \
ln -s Microsoft.AspNetCore.App.Ref Microsoft.AspNetCore.App.Runtime.linux-${ARCH}; \
ln -s Microsoft.AspNetCore.App.Ref Microsoft.AspNetCore.App.linux-${ARCH}; \
ln -s Microsoft.NETCore.App.Host.rhel.9-${ARCH} Microsoft.NETCore.App.Host.linux-${ARCH}; \
ln -s Microsoft.NETCore.App.Ref Microsoft.NETCore.App.Runtime.linux-${ARCH}; \
fi
RUN cd /tmp/runner/src && \
./dev.sh layout && \
./dev.sh package && \
./dev.sh test && \
rm -rf /root/.dotnet /root/.nuget
RUN useradd -c "Action Runner" -m ubuntu && \
usermod -L ubuntu && \
echo "ubuntu ALL=(ALL) NOPASSWD: ALL" >/etc/sudoers.d/ubuntu
RUN mkdir -p /opt/runner && \
tar -xf /tmp/runner/_package/*.tar.gz -C /opt/runner && \
chown -R ubuntu:ubuntu /opt/runner && \
su -c "/opt/runner/config.sh --version" ubuntu
RUN apt-get -qq -y install cmake make automake autoconf m4 gcc-12-base libtool
COPY --chmod=755 build-files/install-python.sh /tmp
COPY --chmod=755 build-files/install-ruby.sh /tmp
COPY --chmod=755 build-files/install-dotnet.sh /tmp
RUN if [ "${BTOOLS}" -eq 1 ]; then \
apt-get -qq -y install openjdk-11-jdk libssl-dev ruby perl; \
/tmp/install-python.sh; \
/tmp/install-ruby.sh; \
/tmp/install-dotnet.sh; \
chown -R ubuntu:ubuntu /opt/runner; \
fi
RUN rm -rf /tmp/runner /tmp/runner.patch /tmp/convert-rpm.sh /tmp/install-python.sh /tmp/install-ruby.sh /tmp/install-dotnet.sh
USER ubuntu
EXPOSE 443
CMD /bin/bash