Skip to content

Commit

Permalink
[TW] Reflect tools installed in images within documentation & add ann…
Browse files Browse the repository at this point in the history
…otation for auto-generation (#103)

* Update documentation for server, agenet and minimal agent, addressing the installed tools;
* Introduce '@AddToolToDoc' to simplify the addition of new tools into automation;
  • Loading branch information
AndreyKoltsov1997 authored Sep 7, 2023
1 parent 30c1b12 commit 906898a
Show file tree
Hide file tree
Showing 56 changed files with 438 additions and 102 deletions.
13 changes: 13 additions & 0 deletions configs/linux/Agent/Ubuntu/Ubuntu-sudo.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
## ${agentCommentHeader}
## This image allows to do *__sudo__* without a password for the *__buildagent__* user. ## To enable Docker, please add the following arguments: ```--privileged -e DOCKER_IN_DOCKER=start```.

# @AddToolToDoc [${jdkLinuxComponentName}](${jdkLinuxComponent})
# @AddToolToDoc [Python venv](https://docs.python.org/3/library/venv.html#module-venv)
# @AddToolToDoc ${gitLFSLinuxComponentName}
# @AddToolToDoc ${gitLinuxComponentName}
# @AddToolToDoc Mercurial
# @AddToolToDoc ${dockerLinuxComponentName}
# @AddToolToDoc [Docker Compose v.${dockerComposeLinuxComponentVersion}](https://github.com/docker/compose/releases/tag/${dockerComposeLinuxComponentVersion})
# @AddToolToDoc ${containerdIoLinuxComponentName}
# @AddToolToDoc [${dotnetLinuxComponentName_31}](${dotnetLinuxComponent_31})
# @AddToolToDoc [${dotnetLinuxComponentName}](${dotnetLinuxComponent})
# @AddToolToDoc [${dotnetLinuxComponentName_50}](${dotnetLinuxComponent_50})
# @AddToolToDoc ${p4Name}

# Based on ${teamcityAgentImage}
FROM ${teamcityAgentImage}

Expand Down
32 changes: 23 additions & 9 deletions configs/linux/Agent/Ubuntu/Ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@

## ${agentCommentHeader}

# @AddToolToDoc [${jdkLinuxComponentName}](${jdkLinuxComponent})
# @AddToolToDoc [Python venv](https://docs.python.org/3/library/venv.html#module-venv)

# @AddToolToDoc [${jdkLinuxComponentName}](${jdkLinuxComponent})
# @AddToolToDoc [Python venv](https://docs.python.org/3/library/venv.html#module-venv)
# @AddToolToDoc ${gitLFSLinuxComponentName}
# @AddToolToDoc ${gitLinuxComponentName}
# @AddToolToDoc Mercurial
# @AddToolToDoc ${dockerLinuxComponentName}
# @AddToolToDoc [Docker Compose v.${dockerComposeLinuxComponentVersion}](https://github.com/docker/compose/releases/tag/${dockerComposeLinuxComponentVersion})
# @AddToolToDoc ${containerdIoLinuxComponentName}
# @AddToolToDoc [${dotnetLinuxComponentName_31}](${dotnetLinuxComponent_31})
# @AddToolToDoc [${dotnetLinuxComponentName}](${dotnetLinuxComponent})
# @AddToolToDoc [${dotnetLinuxComponentName_50}](${dotnetLinuxComponent_50})
# @AddToolToDoc ${p4Name}


# Based on ${teamcityMinimalAgentImage}
FROM ${teamcityMinimalAgentImage}

Expand Down Expand Up @@ -61,16 +78,13 @@ ARG containerdIoLinuxComponentVersion
ARG p4Version

RUN apt-get update && \
# Install ${gitLinuxComponentName}
# Install ${gitLFSLinuxComponentName}
# Install Mercurial
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/* && \
# Install ${p4Name}
# 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" > \
Expand All @@ -79,7 +93,7 @@ RUN 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/* && \
# Install ${dockerLinuxComponentName}, ${containerdIoLinuxComponentName}
# 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 && \
Expand All @@ -90,26 +104,26 @@ RUN apt-get update && \
systemd && \
systemctl disable docker && \
sed -i -e 's/\r$//' /services/run-docker.sh && \
# Install [Docker Compose v.${dockerComposeLinuxComponentVersion}](https://github.com/docker/compose/releases/tag/${dockerComposeLinuxComponentVersion})
# Docker Compose
curl -SL "https://github.com/docker/compose/releases/download/${dockerComposeLinuxComponentVersion}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose && \
# 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 && \
# Install [${dotnetLinuxComponentName_31}](${dotnetLinuxComponent_31})
# .NET Framework 3.1
curl -SL ${dotnetLinuxComponent_31} --output /tmp/dotnet.tar.gz && \
echo "${dotnetLinuxComponentSHA512_31} */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 && \
# Install [${dotnetLinuxComponentName_50}](${dotnetLinuxComponent_50})
# .NET 5.0
curl -SL ${dotnetLinuxComponent_50} --output /tmp/dotnet.tar.gz && \
echo "${dotnetLinuxComponentSHA512_50} */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 && \
# Install [${dotnetLinuxComponentName}](${dotnetLinuxComponent})
# .NET 6.0
curl -SL ${dotnetLinuxComponent} --output /tmp/dotnet.tar.gz && \
echo "${dotnetLinuxComponentSHA512} */tmp/dotnet.tar.gz" | sha512sum -c -; \
tar -zxf /tmp/dotnet.tar.gz -C /usr/share/dotnet && \
Expand Down
13 changes: 13 additions & 0 deletions configs/linux/Agent/UbuntuARM/UbuntuARM-sudo.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
## ${agentCommentHeader}
## This image allows to do *__sudo__* without a password for the *__buildagent__* user. ## To enable Docker, please add the following arguments: ```--privileged -e DOCKER_IN_DOCKER=start```.

# @AddToolToDoc [${jdkLinuxARM64ComponentName}](${jdkLinuxARM64Component})
# @AddToolToDoc [Python venv](https://docs.python.org/3/library/venv.html#module-venv)
# @AddToolToDoc ${gitLinuxComponentName}
# @AddToolToDoc ${gitLFSLinuxComponentName}
# @AddToolToDoc Mercurial
# @AddToolToDoc ${dockerLinuxComponentName}
# @AddToolToDoc ${containerdIoLinuxComponentName}
# @AddToolToDoc [Docker Compose v.${dockerComposeLinuxComponentVersion}](https://github.com/docker/compose/releases/tag/${dockerComposeLinuxComponentVersion})
# @AddToolToDoc [${dotnetLinuxARM64ComponentName}](${dotnetLinuxARM64Component})
# @AddToolToDoc [${dotnetLinuxARM64ComponentName_31}](${dotnetLinuxARM64Component_31})
# @AddToolToDoc [${dotnetLinuxARM64ComponentName_50}](${dotnetLinuxARM64Component_50})


# Based on ${teamcityAgentImage}
FROM ${teamcityAgentImage}

Expand Down
29 changes: 20 additions & 9 deletions configs/linux/Agent/UbuntuARM/UbuntuARM.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@

## ${agentCommentHeader}

# @AddToolToDoc [${jdkLinuxARM64ComponentName}](${jdkLinuxARM64Component})
# @AddToolToDoc [Python venv](https://docs.python.org/3/library/venv.html#module-venv)

# @AddToolToDoc ${gitLinuxComponentName}
# @AddToolToDoc ${gitLFSLinuxComponentName}
# @AddToolToDoc Mercurial
# @AddToolToDoc ${dockerLinuxComponentName}
# @AddToolToDoc ${containerdIoLinuxComponentName}
# @AddToolToDoc [Docker Compose v.${dockerComposeLinuxComponentVersion}](https://github.com/docker/compose/releases/tag/${dockerComposeLinuxComponentVersion})
# @AddToolToDoc [${dotnetLinuxARM64ComponentName}](${dotnetLinuxARM64Component})
# @AddToolToDoc [${dotnetLinuxARM64ComponentName_31}](${dotnetLinuxARM64Component_31})
# @AddToolToDoc [${dotnetLinuxARM64ComponentName_50}](${dotnetLinuxARM64Component_50})


# Based on ${teamcityMinimalAgentImage}
FROM ${teamcityMinimalAgentImage}

Expand Down Expand Up @@ -60,16 +74,13 @@ ARG dockerLinuxComponentVersion
ARG containerdIoLinuxComponentVersion

RUN apt-get update && \
# Install ${gitLinuxComponentName}
# Install ${gitLFSLinuxComponentName}
# Install Mercurial
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/* && \
# Install ${dockerLinuxComponentName}, ${containerdIoLinuxComponentName}
# 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 && \
Expand All @@ -80,26 +91,26 @@ RUN apt-get update && \
systemd && \
systemctl disable docker && \
sed -i -e 's/\r$//' /services/run-docker.sh && \
# Install [Docker Compose v.${dockerComposeLinuxComponentVersion}](https://github.com/docker/compose/releases/tag/${dockerComposeLinuxComponentVersion})
# Docker-Compose
curl -SL "https://github.com/docker/compose/releases/download/${dockerComposeLinuxComponentVersion}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose && \
# Dotnet
# .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 && \
# Install [${dotnetLinuxARM64ComponentName_31}](${dotnetLinuxARM64Component_31})
# .NET Framework 3.1
curl -SL ${dotnetLinuxARM64Component_31} --output /tmp/dotnet.tar.gz && \
echo "${dotnetLinuxARM64ComponentSHA512_31} */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 && \
# Install [${dotnetLinuxARM64ComponentName_50}](${dotnetLinuxARM64Component_50})
# .NET 5.0
curl -SL ${dotnetLinuxARM64Component_50} --output /tmp/dotnet.tar.gz && \
echo "${dotnetLinuxARM64ComponentSHA512_50} */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 && \
# Install [${dotnetLinuxARM64ComponentName}](${dotnetLinuxARM64Component})
# .NET
curl -SL ${dotnetLinuxARM64Component} --output /tmp/dotnet.tar.gz && \
echo "${dotnetLinuxARM64ComponentSHA512} */tmp/dotnet.tar.gz" | sha512sum -c -; \
tar -zxf /tmp/dotnet.tar.gz -C /usr/share/dotnet && \
Expand Down
7 changes: 5 additions & 2 deletions configs/linux/MinimalAgent/Ubuntu/Ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@

## ${agentCommentHeader}

# @AddToolToDoc [${jdkLinuxComponentName}](${jdkLinuxComponent})
# @AddToolToDoc [Python venv](https://docs.python.org/3/library/venv.html#module-venv)

# Based on ${ubuntuImage} 0
FROM ${ubuntuImage}

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' DEBIAN_FRONTEND=noninteractive TZ="Europe/London"

RUN apt-get update && \
apt-get install -y --no-install-recommends curl ca-certificates fontconfig locales unzip && \
# Install [Python venv](https://docs.python.org/3/library/venv.html#module-venv)
# Python
apt-get install -y python3-venv && \
# https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#dkl-di-0005
apt-get clean && rm -rf /var/lib/apt/lists/* && \
Expand All @@ -29,7 +32,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/* && \
useradd -m buildagent

# Install [${jdkLinuxComponentName}](${jdkLinuxComponent})
# JDK
ARG jdkLinuxComponent
ARG jdkLinuxComponentMD5SUM

Expand Down
7 changes: 5 additions & 2 deletions configs/linux/MinimalAgent/UbuntuARM/UbuntuARM.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

## ${agentCommentHeader}

# @AddToolToDoc [${jdkLinuxARM64ComponentName}](${jdkLinuxARM64Component})
# @AddToolToDoc [Python venv](https://docs.python.org/3/library/venv.html#module-venv)

# Based on ${ubuntuImage} 0
FROM ${ubuntuImage}

Expand All @@ -21,15 +24,15 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' DEBIAN_FRONTEND=
RUN apt-get update && \
apt-get install -y --no-install-recommends curl ca-certificates fontconfig locales unzip && \
# https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#dkl-di-0005
# Install [Python venv](https://docs.python.org/3/library/venv.html#module-venv)
# Python
apt-get install -y python3-venv && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen en_US.UTF-8 && \
rm -rf /var/lib/apt/lists/* && \
useradd -m buildagent

# Install [${jdkLinuxARM64ComponentName}](${jdkLinuxARM64Component})
# JDK
ARG jdkLinuxARM64Component
ARG jdkLinuxARM64ComponentMD5SUM

Expand Down
13 changes: 8 additions & 5 deletions configs/linux/Server/Ubuntu/Ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

## ${serverCommentHeader}

# @AddToolToDoc [${jdkServerLinuxComponentName}](${jdkServerLinuxComponent})
# @AddToolToDoc ${gitLinuxComponentName}
# @AddToolToDoc ${gitLFSLinuxComponentName}
# @AddToolToDoc ${p4Name}

# Based on ${ubuntuImage} 0
FROM ${ubuntuImage}

Expand All @@ -29,8 +34,6 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# JDK preparation start

# Install [${jdkServerLinuxComponentName}](${jdkServerLinuxComponent})
ARG jdkServerLinuxComponent
ARG jdkServerLinuxComponentMD5SUM

Expand Down Expand Up @@ -61,13 +64,13 @@ ENV TEAMCITY_DATA_PATH=/data/teamcity_server/datadir \

EXPOSE 8111

# Install ${gitLinuxComponentName}
# Git
ARG gitLinuxComponentVersion

# Install ${gitLFSLinuxComponentName}
# Git LFS
ARG gitLFSLinuxComponentVersion

# Install ${p4Name}
# Perforce
ARG p4Version

RUN apt-get update && \
Expand Down
10 changes: 6 additions & 4 deletions configs/linux/Server/UbuntuARM/UbuntuARM.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

## ${serverCommentHeader}

# @AddToolToDoc [${jdkServerLinuxARM64ComponentName}](${jdkServerLinuxARM64Component})
# @AddToolToDoc ${gitLinuxComponentName}
# @AddToolToDoc ${gitLFSLinuxComponentName}

# Based on ${ubuntuImage} 0
FROM ${ubuntuImage}

Expand All @@ -29,8 +33,6 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# JDK preparation start

# Install [${jdkServerLinuxARM64ComponentName}](${jdkServerLinuxARM64Component})
ARG jdkServerLinuxARM64Component
ARG jdkServerLinuxARM64ComponentMD5SUM

Expand Down Expand Up @@ -61,10 +63,10 @@ ENV TEAMCITY_DATA_PATH=/data/teamcity_server/datadir \

EXPOSE 8111

# Install ${gitLinuxComponentName}
# Git
ARG gitLinuxComponentVersion

# Install ${gitLFSLinuxComponentName}
# Git LFS
ARG gitLFSLinuxComponentVersion

RUN apt-get update && \
Expand Down
7 changes: 5 additions & 2 deletions configs/windows/Agent/nanoserver/NanoServer1803.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@

## ${agentCommentHeader}

# @AddToolToDoc [${dotnetWindowsComponentName}](${dotnetWindowsComponent})
# @AddToolToDoc ${powerShellComponentName}

# Based on ${powershellImage} 3
# Install ${powerShellComponentName}
# PowerShell
FROM ${powershellImage} AS dotnet

SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ARG dotnetWindowsComponent

# Install [${dotnetWindowsComponentName}](${dotnetWindowsComponent})
# .NET
RUN Invoke-WebRequest -OutFile dotnet.zip $Env:dotnetWindowsComponent; \
Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\dotnet; \
Remove-Item -Force dotnet.zip; \
Expand Down
13 changes: 9 additions & 4 deletions configs/windows/Agent/nanoserver/NanoServer1809.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

## ${agentCommentHeader}

# @AddToolToDoc [${jdkWindowsComponentName}](${jdkWindowsComponent})
# @AddToolToDoc ${powerShellComponentName}
# @AddToolToDoc [${gitWindowsComponentName}](${gitWindowsComponent})
# @AddToolToDoc [${dotnetWindowsComponentName}](${dotnetWindowsComponent})

# Based on ${powershellImage} 3
FROM ${powershellImage} AS dotnet

Expand All @@ -34,7 +39,7 @@ ENV ProgramFiles="C:\Program Files" \
# Persist %PSCORE% ENV variable for user convenience
PSCORE="$ProgramFiles\PowerShell\pwsh.exe"

# Install ${powerShellComponentName}
# PowerShell
COPY --from=dotnet ["C:/Program Files/PowerShell", "C:/Program Files/PowerShell"]

# In order to set system PATH, ContainerAdministrator must be used
Expand All @@ -53,11 +58,11 @@ RUN pwsh -NoLogo -NoProfile -Command " \
Start-Sleep -Seconds 6 ; \
}"

# Install [${jdkWindowsComponentName}](${jdkWindowsComponent})
# JDK
COPY --from=tools ["C:/Program Files/Java/OpenJDK", "C:/Program Files/Java/OpenJDK"]
# Install [${gitWindowsComponentName}](${gitWindowsComponent})
# Git
COPY --from=tools ["C:/Program Files/Git", "C:/Program Files/Git"]
# Install [${dotnetWindowsComponentName}](${dotnetWindowsComponent})
# .NET
COPY --from=tools ["C:/Program Files/dotnet", "C:/Program Files/dotnet"]
COPY --from=tools /BuildAgent /BuildAgent

Expand Down
Loading

0 comments on commit 906898a

Please sign in to comment.