forked from JetBrains/teamcity-docker-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (48 loc) · 2.35 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
# Default arguments
ARG dotnetLatestLinuxComponent='https://dotnetcli.blob.core.windows.net/dotnet/Sdk/5.0.100/dotnet-sdk-5.0.100-linux-x64.tar.gz'
ARG dotnetLibs='libc6 libgcc1 libgssapi-krb5-2 libicu60 libssl1.1 libstdc++6 zlib1g'
ARG dotnetLinuxComponent='https://dotnetcli.blob.core.windows.net/dotnet/Sdk/3.1.404/dotnet-sdk-3.1.404-linux-x64.tar.gz'
ARG gitLinuxComponentVersion='1:2.17.1-1ubuntu0.7'
ARG teamcityMinimalAgentImage='teamcity-minimal-agent:2020.2-linux-18.04'
# The list of required arguments
# ARG dotnetLinuxComponent
# ARG teamcityMinimalAgentImage
# ARG dotnetLibs
# ARG gitLinuxComponentVersion
FROM ${teamcityMinimalAgentImage}
USER root
ARG dotnetCoreLinuxComponentVersion
# Opt out of the telemetry feature
ENV DOTNET_CLI_TELEMETRY_OPTOUT=true \
# Disable first time experience
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true \
# Configure Kestrel web server to bind to port 80 when present
ASPNETCORE_URLS=http://+:80 \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Skip extraction of XML docs - generally not useful within an image/container - helps perfomance
NUGET_XMLDOC_MODE=skip \
GIT_SSH_VARIANT=ssh \
DOTNET_SDK_VERSION=${dotnetCoreLinuxComponentVersion}
ARG dotnetLatestLinuxComponent
ARG dotnetLinuxComponent
ARG dotnetLibs
ARG gitLinuxComponentVersion
RUN apt-get update && \
apt-get install -y git=${gitLinuxComponentVersion} mercurial apt-transport-https software-properties-common && \
# https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#dkl-di-0005
apt-get clean && rm -rf /var/lib/apt/lists/* && \
mkdir -p /usr/share/dotnet && \
apt-get install -y --no-install-recommends ${dotnetLibs} && \
# https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#dkl-di-0005
apt-get clean && rm -rf /var/lib/apt/lists/* && \
curl -SL ${dotnetLinuxComponent} --output dotnet.tar.gz && \
tar -zxf dotnet.tar.gz -C /usr/share/dotnet && \
rm dotnet.tar.gz && \
find /usr/share/dotnet -name "*.lzma" -type f -delete && \
ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# Trigger .NET CLI first run experience by running arbitrary cmd to populate local package cache
RUN dotnet help
USER buildagent