forked from myoung34/docker-github-actions-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dotnet
43 lines (38 loc) · 1.94 KB
/
Dockerfile.dotnet
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
# syntax=docker/dockerfile:1
ARG BASE_IMAGE="derskythe/runner-base-slim:latest"
FROM ${BASE_IMAGE} AS base
# hadolint ignore=DL3007
ARG GH_RUNNER_VERSION='2.320.0'
ARG RUNNER_DIR="/actions-runner"
ARG CACHE_HOSTED_TOOLS_DIRECTORY="${RUNNER_DIR}/hostedtoolcache"
ARG CHOWN_USER="runner"
ARG TARGETARCH
ARG DISTRO
ARG DISTRO_VERSION
ENV CACHE_HOSTED_TOOLS_DIRECTORY=${CACHE_HOSTED_TOOLS_DIRECTORY} \
RUNNER_DIR=${RUNNER_DIR} \
DOTNET_VERSION='8.0' \
PWSH_VERSION='7.4.6' \
NUGET_PACKAGES=${CACHE_HOSTED_TOOLS_DIRECTORY}/nuget-packages \
DOTNET_GENERATE_ASPNET_CERTIFICATE=false \
DOTNET_NOLOGO=true \
NUGET_XMLDOC_MODE=skip
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR ${RUNNER_DIR}
COPY --chmod=777 *.sh .
RUN unset ASPNETCORE_URLS \
&& mkdir -p ${NUGET_PACKAGES} /_work /usr/share/pwsh \
&& wget -qO- "https://dot.net/v1/dotnet-install.sh" | bash /dev/stdin --channel LTS --runtime aspnetcore --install-dir /usr/share/dotnet \
&& (echo "export DOTNET_ROOT=/usr/share/dotnet" >> /etc/profile ) \
&& (echo "export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/shared" >> /etc/profile ) \
&& (echo "export DOTNET_ROOT=/usr/share/dotnet" >> ~/.bashrc ) \
&& (echo "export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/shared" >> ~/.bashrc) \
&& TARGET_ARCH=$(echo ${TARGETARCH} | sed 's/amd/x/' ) \
&& wget -qO- "https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_VERSION}/powershell-${PWSH_VERSION}-linux-$TARGET_ARCH.tar.gz" | tar xz -C /usr/share/pwsh \
&& ln -s /usr/share/pwsh/pwsh /usr/bin/pwsh \
&& wget -qO- "https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSION}/actions-runner-linux-$TARGET_ARCH-${GH_RUNNER_VERSION}.tar.gz" | tar xz \
&& ./bin/installdependencies.sh \
&& rm -Rf install_actions.sh ./externals/node12_alpine ./externals/node12 /var/lib/apt/lists/* /tmp/*
ENTRYPOINT ["./entrypoint.sh"]
CMD ["./bin/Runner.Listener", "run", "--startuptype", "service"]
#