Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Apr 4, 2023
2 parents baffdba + bc1d3f0 commit 4db51a6
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 137 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ helm upgrade --install agent clemlesne-azure-pipelines-agent/azure-pipelines-age

- [Azure Pipelines agent](https://github.com/microsoft/azure-pipelines-agent) (see env var `AGENT_VERSION` on the container images) + [requirements](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops#linux)
- [ASP.NET Core](https://github.com/dotnet/aspnetcore) runtime (required by the Azure Pipelines agent)
- [Azure CLI](https://github.com/Azure/azure-cli) (required by the Azure Pipelines agent) + requirements ([Python 3.8](https://www.python.org/downloads/release/python-380), [Python 3.9](https://www.python.org/downloads/release/python-390), [Python 3.10](https://www.python.org/downloads/release/python-3100), depending of the system, plus C/Rust build tools for libs non pre-built on the platforms)
- "tar, unzip, gzip, zip, zsh, zstd" (for developer ease-of-life)
- [Azure CLI](https://github.com/Azure/azure-cli) (required by the Azure Pipelines agent)
- "gzip, make, tar, unzip, wget, zip, zsh, zstd" (for developer ease-of-life)

### Helm values

Expand Down
69 changes: 35 additions & 34 deletions src/docker/Dockerfile-bullseye
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,51 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -q
RUN apt-get upgrade -y -q --no-install-recommends

# Install:
# - Azure Pipelines agent system requirements
# - Azure CLI system requirements (Python 3.9, plus C/Rust build tools for libs non pre-built on this platform)
# - "tar, unzip, gzip, zip, zsh, zstd" for developer ease-of-life
RUN apt-get install -y -q --no-install-recommends \
build-essential \
ca-certificates \
cargo \
curl \
git \
gzip \
iputils-ping \
jq \
libffi-dev \
libssl-dev \
lsb-release \
pkg-config \
python3-dev=3.9.* \
python3-pip \
python3=3.9.* \
software-properties-common \
tar \
unzip \
zip \
zsh \
zstd

# Install Azure CLI
RUN python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir setuptools wheel \
&& python3 -m pip install --no-cache-dir azure-cli \
# - "gzip, make, tar, unzip, wget, zip, zsh, zstd" for developer ease-of-life
RUN apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
curl \
git \
git-lfs \
gnupg \
gzip \
iputils-ping \
jq \
make \
tar \
unzip \
wget \
zip \
zsh \
zstd \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists

# Install Azure CLI, then verify installation
RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg \
&& mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ \
&& echo "deb [arch=$(dpkg --print-architecture)] https://packages.microsoft.com/repos/azure-cli/ $(. /etc/os-release; echo $VERSION_CODENAME) main" > /etc/apt/sources.list.d/azure-cli.list \
&& apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
azure-cli \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists \
&& az --version

WORKDIR /azp

COPY init.sh .
# Install Azure Pipelines Agent sources, then verify installation
ARG AGENT_VERSION
ENV AGENT_VERSION ${AGENT_VERSION}
COPY init.sh .
RUN chmod +x init.sh \
&& ./init.sh $AGENT_VERSION
&& ./init.sh $AGENT_VERSION \
&& AGENT_ALLOW_RUNASROOT="1" ./run-docker.sh --version

# Install Azure Pipelines Agent startup script
COPY start.sh .
RUN chmod +x start.sh

Expand Down
69 changes: 35 additions & 34 deletions src/docker/Dockerfile-focal
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,51 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:6.0-focal

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -q
RUN apt-get upgrade -y -q --no-install-recommends

# Install:
# - Azure Pipelines agent system requirements
# - Azure CLI system requirements (Python 3.8, plus C/Rust build tools for libs non pre-built on this platform)
# - "tar, unzip, gzip, zip, zsh, zstd" for developer ease-of-life
RUN apt-get install -y -q --no-install-recommends \
build-essential \
ca-certificates \
cargo \
curl \
git \
gzip \
iputils-ping \
jq \
libffi-dev \
libssl-dev \
lsb-release \
pkg-config \
python3-dev=3.8.* \
python3-pip \
python3=3.8.* \
software-properties-common \
tar \
unzip \
zip \
zsh \
zstd

# Install Azure CLI
RUN python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir setuptools wheel \
&& python3 -m pip install --no-cache-dir azure-cli \
# - "gzip, make, tar, unzip, wget, zip, zsh, zstd" for developer ease-of-life
RUN apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
curl \
git \
git-lfs \
gnupg \
gzip \
iputils-ping \
jq \
make \
tar \
unzip \
wget \
zip \
zsh \
zstd \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists

# Install Azure CLI, then verify installation
RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg \
&& mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ \
&& echo "deb [arch=$(dpkg --print-architecture)] https://packages.microsoft.com/repos/azure-cli/ $(. /etc/os-release; echo $VERSION_CODENAME) main" > /etc/apt/sources.list.d/azure-cli.list \
&& apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
azure-cli \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists \
&& az --version

WORKDIR /azp

COPY init.sh .
# Install Azure Pipelines Agent sources, then verify installation
ARG AGENT_VERSION
ENV AGENT_VERSION ${AGENT_VERSION}
COPY init.sh .
RUN chmod +x init.sh \
&& ./init.sh $AGENT_VERSION
&& ./init.sh $AGENT_VERSION \
&& AGENT_ALLOW_RUNASROOT="1" ./run-docker.sh --version

# Install Azure Pipelines Agent startup script
COPY start.sh .
RUN chmod +x start.sh

Expand Down
69 changes: 35 additions & 34 deletions src/docker/Dockerfile-jammy
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,51 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:6.0-jammy

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -q
RUN apt-get upgrade -y -q --no-install-recommends

# Install:
# - Azure Pipelines agent system requirements
# - Azure CLI system requirements (Python 3.10, plus C/Rust build tools for libs non pre-built on this platform)
# - "tar, unzip, gzip, zip, zsh, zstd" for developer ease-of-life
RUN apt-get install -y -q --no-install-recommends \
build-essential \
ca-certificates \
cargo \
curl \
git \
gzip \
iputils-ping \
jq \
libffi-dev \
libssl-dev \
lsb-release \
pkg-config \
python3-dev=3.10.* \
python3-pip \
python3=3.10.* \
software-properties-common \
tar \
unzip \
zip \
zsh \
zstd

# Install Azure CLI
RUN python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir setuptools wheel \
&& python3 -m pip install --no-cache-dir azure-cli \
# - "gzip, make, tar, unzip, wget, zip, zsh, zstd" for developer ease-of-life
RUN apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
curl \
git \
git-lfs \
gnupg \
gzip \
iputils-ping \
jq \
make \
tar \
unzip \
wget \
zip \
zsh \
zstd \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists

# Install Azure CLI, then verify installation
RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg \
&& mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ \
&& echo "deb [arch=$(dpkg --print-architecture)] https://packages.microsoft.com/repos/azure-cli/ $(. /etc/os-release; echo $VERSION_CODENAME) main" > /etc/apt/sources.list.d/azure-cli.list \
&& apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
azure-cli \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists \
&& az --version

WORKDIR /azp

COPY init.sh .
# Install Azure Pipelines Agent sources, then verify installation
ARG AGENT_VERSION
ENV AGENT_VERSION ${AGENT_VERSION}
COPY init.sh .
RUN chmod +x init.sh \
&& ./init.sh $AGENT_VERSION
&& ./init.sh $AGENT_VERSION \
&& AGENT_ALLOW_RUNASROOT="1" ./run-docker.sh --version

# Install Azure Pipelines Agent startup script
COPY start.sh .
RUN chmod +x start.sh

Expand Down
64 changes: 33 additions & 31 deletions src/docker/Dockerfile-ubi8
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
# Fetch the vendor with the builder platform to avoid QEMU issues
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/ubi-minimal:8.7

RUN microdnf upgrade -y --setopt=install_weak_deps=0

# Install:
# - Azure Pipelines agent system requirements
# - Azure CLI system requirements (Python 3.9, plus C/Rust build tools for libs non pre-built on this platform)
# - ASP.NET Core runtime
# - "tar, unzip, gzip, zip, zsh, zstd" for developer ease-of-life
RUN microdnf install -y --nodocs --setopt=install_weak_deps=0 \
aspnetcore-runtime-6.0 \
ca-certificates \
cargo \
curl \
gcc \
gcc-c++ \
gzip \
hostname \
iputils \
make \
openssl-devel \
pkg-config \
python39 \
python39-devel \
python39-pip \
tar \
unzip \
zip \
zsh \
zstd
# - "gzip, make, tar, unzip, wget, zip, zsh, zstd" for developer ease-of-life
RUN microdnf install -y --refresh --nodocs --setopt=install_weak_deps=0 \
aspnetcore-runtime-6.0 \
ca-certificates \
curl \
git-core \
git-lfs \
gnupg \
gzip \
hostname \
iputils \
jq \
make \
tar \
unzip \
wget \
zip \
zsh \
zstd \
&& microdnf clean all \
&& rm -rf /var/cache/yum

# Install Azure CLI
RUN python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir setuptools wheel \
&& python3 -m pip install --no-cache-dir azure-cli \
# Install Azure CLI with RPM, then verify installation
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
&& curl -sL https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/azure-cli.repo \
&& microdnf install -y --refresh --nodocs --setopt=install_weak_deps=0 \
azure-cli \
&& microdnf clean all \
&& rm -rf /var/cache/yum \
&& az --version

WORKDIR /azp

COPY init.sh .
# Install Azure Pipelines Agent sources, then verify installation
ARG AGENT_VERSION
ENV AGENT_VERSION ${AGENT_VERSION}
COPY init.sh .
RUN chmod +x init.sh \
&& ./init.sh $AGENT_VERSION
&& ./init.sh $AGENT_VERSION \
&& AGENT_ALLOW_RUNASROOT="1" ./run-docker.sh --version

# Install Azure Pipelines Agent startup script
COPY start.sh .
RUN chmod +x start.sh

Expand Down
2 changes: 2 additions & 0 deletions src/docker/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ AGENT_PACKAGE_URL="https://vstsagentpackage.azureedge.net/agent/$AGENT_VERSION/p
curl -LsS $AGENT_PACKAGE_URL | tar -xz &
wait $!

chmod +x ./run-docker.sh ./config.sh

echo "Agent v$AGENT_VERSION for $AGENT_ARCH installed"
2 changes: 0 additions & 2 deletions src/docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ if ! grep -q "template" <<<"$AZP_AGENT_NAME"; then
trap 'cleanup; exit 143' TERM
fi

chmod +x ./run-docker.sh

# To be aware of TERM and INT signals call run.sh
# Running it with the --once flag at the end will shut down the agent after the build is executed
./run-docker.sh "$@" --once &
Expand Down

0 comments on commit 4db51a6

Please sign in to comment.