Skip to content

Commit

Permalink
[TW-89342] Update Linux Base Image: Ubuntu 20.04 -> 22.04 LTS (#170)
Browse files Browse the repository at this point in the history
* * Add configuration for Ubuntu 22.04.
* Re-generate Dockerfiles.

* Re-generate scripts.

* * Add configuration & generate dockerfiles for regular agents, sudo agents & servers.

* Update Git to 2.47.0

* Update Git LFS & .NET dependencies.

* Update target .NET libraries (dependencies)

* Update Git dependency to PPA2

* Fix the names of base images & links leading to an older version of the base image.

* [TW-89342] Upgrade docker version to latest in all images: 24.0.9 -> 27.3.1 (#173)

* * Add configuration for Ubuntu 22.04.
* Re-generate Dockerfiles.

* Re-generate scripts.

* * Add configuration & generate dockerfiles for regular agents, sudo agents & servers.

* Update Git to 2.47.0

* Update Git LFS & .NET dependencies.

* Update target .NET libraries (dependencies)

* Update Git dependency to PPA2

* Update Docker CE to 27.3.1

* Add uncommitted changes.
  • Loading branch information
AndreyKoltsov1997 authored Nov 11, 2024
1 parent 700280b commit c1abb33
Show file tree
Hide file tree
Showing 42 changed files with 1,053 additions and 93 deletions.
10 changes: 5 additions & 5 deletions configs/linux.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ dotnetLinuxComponentName=${dotnetComponentName} x86 Checksum (SHA512) ${dotnetLi

# https://packages.ubuntu.com/focal/git
# http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/focal/main/binary-amd64/
gitLinuxComponentVersion=1:2.47.0-0ppa2~ubuntu20.04.1
gitLinuxComponentVersion=1:2.47.0-0ppa2~ubuntu22.04.1
gitLinuxComponentName=Git v.2.47.0

# https://packages.ubuntu.com/focal/git-lfs
gitLFSLinuxComponentVersion=2.9.2-1
gitLFSLinuxComponentName=Git LFS v.2.9.2
gitLFSLinuxComponentVersion=3.0.2-1
gitLFSLinuxComponentName=Git LFS v.3.0.2-1

dockerLinuxComponentVersion=5:24.0.9-1~ubuntu
dockerLinuxComponentName=[Docker v.5:24.0.9](https://docs.docker.com/engine/release-notes/24.0)
dockerLinuxComponentVersion=5:27.3.1-1~ubuntu
dockerLinuxComponentName=[Docker v.27.3.1](https://docs.docker.com/engine/release-notes/27)

containerdIoLinuxComponentName=[Containerd.io v1.6.28-2](https://github.com/containerd/containerd/releases/tag/v1.6.28)
containerdIoLinuxComponentVersion=1.6.28-2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linuxVersion=
repo=https://hub.docker.com/r/jetbrains/
teamcityAgentImage=teamcity-agent:${versionTag}-linux
4 changes: 4 additions & 0 deletions configs/linux/Agent/Ubuntu/22.04/Ubuntu.Dockerfile.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
linuxVersion=
repo=https://hub.docker.com/r/jetbrains/
teamcityMinimalAgentImage=teamcity-minimal-agent:${versionTag}-linux
dotnetLibs=libc6 libgcc1 libgssapi-krb5-2 libicu70 libssl3 libstdc++6 zlib1g
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linuxVersion=-arm64
repo=https://hub.docker.com/r/jetbrains/
teamcityAgentImage=teamcity-agent:${versionTag}-linux${linuxVersion}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
linuxVersion=-arm64
repo=https://hub.docker.com/r/jetbrains/
teamcityMinimalAgentImage=teamcity-minimal-agent:${versionTag}-linux${linuxVersion}
dotnetLibs=libc6 libgcc1 libgssapi-krb5-2 libicu70 libssl3 libstdc++6 zlib1g
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
linuxVersion=
repo=https://hub.docker.com/r/jetbrains/
# https://hub.docker.com/_/ubuntu/
ubuntuImage=ubuntu:22.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
linuxVersion=-arm64
repo=
# https://hub.docker.com/_/ubuntu/
ubuntuImage=ubuntu:22.04
4 changes: 4 additions & 0 deletions configs/linux/Server/Ubuntu/22.04/Ubuntu.Dockerfile.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
linuxVersion=
repo=https://hub.docker.com/r/jetbrains/
# https://hub.docker.com/_/ubuntu/
ubuntuImage=ubuntu:22.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
linuxVersion=-arm64
repo=
# https://hub.docker.com/_/ubuntu/
ubuntuImage=ubuntu:22.04

2 changes: 1 addition & 1 deletion context/generated/linux/Agent/Ubuntu/18.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default arguments
ARG containerdIoLinuxComponentVersion='1.6.28-2'
ARG dockerLinuxComponentVersion='5:24.0.9-1~ubuntu'
ARG dockerLinuxComponentVersion='5:27.3.1-1~ubuntu'
ARG dotnetLibs='libc6 libgcc1 libgssapi-krb5-2 libicu60 libssl1.1 libstdc++6 zlib1g'
ARG dotnetLinuxComponent='https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.413/dotnet-sdk-6.0.413-linux-x64.tar.gz'
ARG dotnetLinuxComponentSHA512='ee0a77d54e6d4917be7310ff0abb3bad5525bfb4beb1db0c215e65f64eb46511f5f12d6c7ff465a1d4ab38577e6a1950fde479ee94839c50e627020328a702de'
Expand Down
6 changes: 3 additions & 3 deletions context/generated/linux/Agent/Ubuntu/20.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Default arguments
ARG containerdIoLinuxComponentVersion='1.6.28-2'
ARG dockerLinuxComponentVersion='5:24.0.9-1~ubuntu'
ARG dockerLinuxComponentVersion='5:27.3.1-1~ubuntu'
ARG dotnetLibs='libc6 libgcc1 libgssapi-krb5-2 libicu66 libssl1.1 libstdc++6 zlib1g'
ARG dotnetLinuxComponent='https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.413/dotnet-sdk-6.0.413-linux-x64.tar.gz'
ARG dotnetLinuxComponentSHA512='ee0a77d54e6d4917be7310ff0abb3bad5525bfb4beb1db0c215e65f64eb46511f5f12d6c7ff465a1d4ab38577e6a1950fde479ee94839c50e627020328a702de'
ARG gitLFSLinuxComponentVersion='2.9.2-1'
ARG gitLinuxComponentVersion='1:2.47.0-0ppa2~ubuntu20.04.1'
ARG gitLFSLinuxComponentVersion='3.0.2-1'
ARG gitLinuxComponentVersion='1:2.47.0-0ppa2~ubuntu22.04.1'
ARG p4Version='2022.2-2637361'
ARG repo='https://hub.docker.com/r/jetbrains/'
ARG teamcityMinimalAgentImage='teamcity-minimal-agent:EAP-linux'
Expand Down
21 changes: 21 additions & 0 deletions context/generated/linux/Agent/Ubuntu/22.04-sudo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Default arguments
ARG teamcityAgentImage='teamcity-agent:EAP-linux'

# The list of required arguments
# ARG teamcityAgentImage




FROM ${teamcityAgentImage}

USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends sudo && \
# https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#dkl-di-0005
apt-get clean && rm -rf /var/lib/apt/lists/* && \
echo 'buildagent ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
rm -rf /var/lib/apt/lists/*

USER buildagent
112 changes: 112 additions & 0 deletions context/generated/linux/Agent/Ubuntu/22.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Default arguments
ARG containerdIoLinuxComponentVersion='1.6.28-2'
ARG dockerLinuxComponentVersion='5:27.3.1-1~ubuntu'
ARG dotnetLibs='libc6 libgcc1 libgssapi-krb5-2 libicu70 libssl3 libstdc++6 zlib1g'
ARG dotnetLinuxComponent='https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.413/dotnet-sdk-6.0.413-linux-x64.tar.gz'
ARG dotnetLinuxComponentSHA512='ee0a77d54e6d4917be7310ff0abb3bad5525bfb4beb1db0c215e65f64eb46511f5f12d6c7ff465a1d4ab38577e6a1950fde479ee94839c50e627020328a702de'
ARG gitLFSLinuxComponentVersion='3.0.2-1'
ARG gitLinuxComponentVersion='1:2.47.0-0ppa2~ubuntu22.04.1'
ARG p4Version='2022.2-2637361'
ARG repo='https://hub.docker.com/r/jetbrains/'
ARG teamcityMinimalAgentImage='teamcity-minimal-agent:EAP-linux'

# The list of required arguments
# ARG dotnetLinuxComponent
# ARG dotnetLinuxComponentSHA512
# ARG teamcityMinimalAgentImage
# ARG dotnetLibs
# ARG gitLinuxComponentVersion
# ARG gitLFSLinuxComponentVersion
# ARG dockerLinuxComponentVersion






FROM ${teamcityMinimalAgentImage}

USER root

COPY run-docker.sh /services/run-docker.sh

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 dotnetLinuxComponent
ARG dotnetLinuxComponentSHA512
ARG dotnetLibs
ARG gitLinuxComponentVersion
ARG gitLFSLinuxComponentVersion
ARG dockerLinuxComponentVersion
ARG containerdIoLinuxComponentVersion
ARG p4Version

RUN apt-get update && \
apt-get install -y mercurial apt-transport-https software-properties-common && \
add-apt-repository ppa:git-core/ppa -y && \
apt-get install -y git=${gitLinuxComponentVersion} git-lfs=${gitLFSLinuxComponentVersion} && \
git lfs install --system && \
# https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#dkl-di-0005
apt-get clean && rm -rf /var/lib/apt/lists/* && \
# Perforce (p4 CLI)
apt-key adv --fetch-keys https://package.perforce.com/perforce.pubkey && \
(. /etc/os-release && \
echo "deb http://package.perforce.com/apt/$ID $VERSION_CODENAME release" > \
/etc/apt/sources.list.d/perforce.list ) && \
apt-get update && \
(. /etc/os-release && apt-get install -y helix-cli-base="${p4Version}~$VERSION_CODENAME" helix-cli="${p4Version}~$VERSION_CODENAME" ) && \
# https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#dkl-di-0005
apt-get clean && rm -rf /var/lib/apt/lists/* && \
# Docker & ContainerD
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
apt-cache policy docker-ce && \
apt-get update && \
# docker-ce, docker-ce-cli package name format: "25.0.5-1~ubuntu.20.04~focal"
apt-get install -y docker-ce=${dockerLinuxComponentVersion}.$(lsb_release -rs)~$(lsb_release -cs) \
docker-ce-cli=${dockerLinuxComponentVersion}.$(lsb_release -rs)~$(lsb_release -cs) \
containerd.io:amd64=${containerdIoLinuxComponentVersion} \
systemd && \
systemctl disable docker && \
sed -i -e 's/\r$//' /services/run-docker.sh && \
# 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/* && \
mkdir -p /usr/share/dotnet && \
# .NET 6.0
curl -SL ${dotnetLinuxComponent} --output /tmp/dotnet.tar.gz && \
echo "Downloaded .NET 6.0 (Linux AMD64) checksum: $(sha512sum tmp/dotnet.tar.gz)" && \
echo "${dotnetLinuxComponentSHA512} */tmp/dotnet.tar.gz" | sha512sum -c -; \
tar -zxf /tmp/dotnet.tar.gz -C /usr/share/dotnet && \
rm /tmp/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
dotnet help && \
dotnet --info && \
# Other
apt-get clean && rm -rf /var/lib/apt/lists/* && \
chown -R buildagent:buildagent /services && \
usermod -aG docker buildagent

# A better fix for TW-52939 Dockerfile build fails because of aufs
VOLUME /var/lib/docker

USER buildagent

2 changes: 1 addition & 1 deletion context/generated/linux/Agent/UbuntuARM/18.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default arguments
ARG containerdIoLinuxComponentVersion='1.6.28-2'
ARG dockerLinuxComponentVersion='5:24.0.9-1~ubuntu'
ARG dockerLinuxComponentVersion='5:27.3.1-1~ubuntu'
ARG dotnetLibs='libc6 libgcc1 libgssapi-krb5-2 libicu60 libssl1.1 libstdc++6 zlib1g'
ARG dotnetLinuxARM64Component='https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.413/dotnet-sdk-6.0.413-linux-arm64.tar.gz'
ARG dotnetLinuxARM64ComponentSHA512='7f05a9774d79e694da5a6115d9916abf87a65e40bd6bdaa5dca1f705795436bc8e764242f7045207386a86732ef5519f60bdb516a3860e4860bca7ee91a21759'
Expand Down
6 changes: 3 additions & 3 deletions context/generated/linux/Agent/UbuntuARM/20.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Default arguments
ARG containerdIoLinuxComponentVersion='1.6.28-2'
ARG dockerLinuxComponentVersion='5:24.0.9-1~ubuntu'
ARG dockerLinuxComponentVersion='5:27.3.1-1~ubuntu'
ARG dotnetLibs='libc6 libgcc1 libgssapi-krb5-2 libicu66 libssl1.1 libstdc++6 zlib1g'
ARG dotnetLinuxARM64Component='https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.413/dotnet-sdk-6.0.413-linux-arm64.tar.gz'
ARG dotnetLinuxARM64ComponentSHA512='7f05a9774d79e694da5a6115d9916abf87a65e40bd6bdaa5dca1f705795436bc8e764242f7045207386a86732ef5519f60bdb516a3860e4860bca7ee91a21759'
ARG gitLFSLinuxComponentVersion='2.9.2-1'
ARG gitLinuxComponentVersion='1:2.47.0-0ppa2~ubuntu20.04.1'
ARG gitLFSLinuxComponentVersion='3.0.2-1'
ARG gitLinuxComponentVersion='1:2.47.0-0ppa2~ubuntu22.04.1'
ARG repo='https://hub.docker.com/r/jetbrains/'
ARG teamcityMinimalAgentImage='teamcity-minimal-agent:EAP-linux-arm64'

Expand Down
22 changes: 22 additions & 0 deletions context/generated/linux/Agent/UbuntuARM/22.04-sudo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Default arguments
ARG teamcityAgentImage='teamcity-agent:EAP-linux-arm64'

# The list of required arguments
# ARG teamcityAgentImage





FROM ${teamcityAgentImage}

USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends sudo && \
# https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#dkl-di-0005
apt-get clean && rm -rf /var/lib/apt/lists/* && \
echo 'buildagent ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
rm -rf /var/lib/apt/lists/*

USER buildagent
101 changes: 101 additions & 0 deletions context/generated/linux/Agent/UbuntuARM/22.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Default arguments
ARG containerdIoLinuxComponentVersion='1.6.28-2'
ARG dockerLinuxComponentVersion='5:27.3.1-1~ubuntu'
ARG dotnetLibs='libc6 libgcc1 libgssapi-krb5-2 libicu70 libssl3 libstdc++6 zlib1g'
ARG dotnetLinuxARM64Component='https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.413/dotnet-sdk-6.0.413-linux-arm64.tar.gz'
ARG dotnetLinuxARM64ComponentSHA512='7f05a9774d79e694da5a6115d9916abf87a65e40bd6bdaa5dca1f705795436bc8e764242f7045207386a86732ef5519f60bdb516a3860e4860bca7ee91a21759'
ARG gitLFSLinuxComponentVersion='3.0.2-1'
ARG gitLinuxComponentVersion='1:2.47.0-0ppa2~ubuntu22.04.1'
ARG repo='https://hub.docker.com/r/jetbrains/'
ARG teamcityMinimalAgentImage='teamcity-minimal-agent:EAP-linux-arm64'

# The list of required arguments
# ARG dotnetLinuxARM64Component
# ARG dotnetLinuxARM64ComponentSHA512
# ARG teamcityMinimalAgentImage
# ARG dotnetLibs
# ARG gitLinuxComponentVersion
# ARG gitLFSLinuxComponentVersion
# ARG dockerLinuxComponentVersion






FROM ${teamcityMinimalAgentImage}

USER root

COPY run-docker.sh /services/run-docker.sh

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 dotnetLinuxARM64Component
ARG dotnetLinuxARM64ComponentSHA512
ARG dotnetLibs
ARG gitLinuxComponentVersion
ARG gitLFSLinuxComponentVersion
ARG dockerLinuxComponentVersion
ARG containerdIoLinuxComponentVersion

RUN apt-get update && \
apt-get install -y mercurial apt-transport-https software-properties-common && \
add-apt-repository ppa:git-core/ppa -y && \
apt-get install -y git=${gitLinuxComponentVersion} git-lfs=${gitLFSLinuxComponentVersion} && \
git lfs install --system && \
# https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#dkl-di-0005
apt-get clean && rm -rf /var/lib/apt/lists/* && \
# Docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
apt-cache policy docker-ce && \
apt-get update && \
# docker-ce, docker-ce-cli package name format: "26.0.0-1~ubuntu.20.04~focal"
apt-get install -y docker-ce=${dockerLinuxComponentVersion}.$(lsb_release -rs)~$(lsb_release -cs) \
docker-ce-cli=${dockerLinuxComponentVersion}.$(lsb_release -rs)~$(lsb_release -cs) \
containerd.io:arm64=${containerdIoLinuxComponentVersion} \
systemd && \
systemctl disable docker && \
sed -i -e 's/\r$//' /services/run-docker.sh && \
# .NET Libraries
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/* && \
mkdir -p /usr/share/dotnet && \
# .NET 6.0
curl -SL ${dotnetLinuxARM64Component} --output /tmp/dotnet.tar.gz && \
echo "Downloaded .NET 6.0 (Linux ARM64) checksum: $(sha512sum tmp/dotnet.tar.gz)" && \
echo "${dotnetLinuxARM64ComponentSHA512} */tmp/dotnet.tar.gz" | sha512sum -c -; \
tar -zxf /tmp/dotnet.tar.gz -C /usr/share/dotnet && \
rm /tmp/dotnet.tar.gz && \
find /usr/share/dotnet -name "*.lzma" -type f -delete && \
# Trigger .NET CLI first run experience by running arbitrary cmd to populate local package cache \
ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet && \
dotnet help && \
dotnet --info && \
# Other
apt-get clean && rm -rf /var/lib/apt/lists/* && \
chown -R buildagent:buildagent /services && \
usermod -aG docker buildagent

# A better fix for TW-52939 Dockerfile build fails because of aufs
VOLUME /var/lib/docker

USER buildagent

Loading

0 comments on commit c1abb33

Please sign in to comment.