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 5, 2023
2 parents 4db51a6 + 0e34a89 commit a1b6153
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 64 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:
AGENT_VERSION: 3.218.0
CONTAINER_NAME: ${{ github.repository }}
CONTAINER_REGISTRY: ghcr.io
POWERSHELL_VERSION: 7.2.10

jobs:
build-helm:
Expand Down Expand Up @@ -180,6 +181,7 @@ jobs:
with:
build-args: |
"AGENT_VERSION=${{ env.AGENT_VERSION }}"
"POWERSHELL_VERSION=${{ env.POWERSHELL_VERSION }}"
cache-from: type=gha
cache-to: type=gha,mode=max
context: src/docker
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,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)
- "gzip, make, tar, unzip, wget, zip, zsh, zstd" (for developer ease-of-life)
- [Powershell](https://github.com/PowerShell/PowerShell), [bash](https://www.gnu.org/software/bash) and [zsh](https://www.zsh.org) (for inter-operability)
- "gzip, make, tar, unzip, wget, zip, zstd" (for developer ease-of-life)

### Helm values

Expand Down
36 changes: 28 additions & 8 deletions src/docker/Dockerfile-bullseye
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ENV DEBIAN_FRONTEND=noninteractive

# Install:
# - Azure Pipelines agent system requirements
# - "gzip, make, tar, unzip, wget, zip, zsh, zstd" for developer ease-of-life
# - "zsh", for inter-operability
# - "gzip, make, tar, unzip, wget, zip, zstd" for developer ease-of-life
RUN apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
Expand All @@ -26,27 +27,46 @@ RUN apt-get update -q \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists

# Copy helper script, then verify installation
COPY arch.sh .
RUN chmod +x arch.sh \
&& ./arch.sh

# 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 \
RUN curl -LsS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg \
&& 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
# Install Powershell, then verify installation
ARG POWERSHELL_VERSION
ENV POWERSHELL_VERSION ${POWERSHELL_VERSION}
RUN mkdir -p /opt/microsoft/powershell \
&& curl -LsS https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-$(./arch.sh).tar.gz | tar -xz -C /opt/microsoft/powershell \
&& chmod +x /opt/microsoft/powershell/pwsh \
&& ln -s /opt/microsoft/powershell/pwsh /usr/bin/pwsh \
&& pwsh -Version

# 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 \
ENV AGENT_HOME /azp
RUN mkdir -p ${AGENT_HOME} \
&& curl -LsS https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/pipelines-agent-$(./arch.sh)-${AGENT_VERSION}.tar.gz | tar -xz -C ${AGENT_HOME} \
&& cd $AGENT_HOME \
&& chmod +x ./run-docker.sh ./config.sh \
&& AGENT_ALLOW_RUNASROOT="1" ./run-docker.sh --version

# Cleanup helper script
RUN rm arch.sh

# Set agent home as working directory
WORKDIR ${AGENT_HOME}

# Install Azure Pipelines Agent startup script
COPY start.sh .
RUN chmod +x start.sh
Expand Down
36 changes: 28 additions & 8 deletions src/docker/Dockerfile-focal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ENV DEBIAN_FRONTEND=noninteractive

# Install:
# - Azure Pipelines agent system requirements
# - "gzip, make, tar, unzip, wget, zip, zsh, zstd" for developer ease-of-life
# - "zsh", for inter-operability
# - "gzip, make, tar, unzip, wget, zip, zstd" for developer ease-of-life
RUN apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
Expand All @@ -26,27 +27,46 @@ RUN apt-get update -q \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists

# Copy helper script, then verify installation
COPY arch.sh .
RUN chmod +x arch.sh \
&& ./arch.sh

# 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 \
RUN curl -LsS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg \
&& 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
# Install Powershell, then verify installation
ARG POWERSHELL_VERSION
ENV POWERSHELL_VERSION ${POWERSHELL_VERSION}
RUN mkdir -p /opt/microsoft/powershell \
&& curl -LsS https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-$(./arch.sh).tar.gz | tar -xz -C /opt/microsoft/powershell \
&& chmod +x /opt/microsoft/powershell/pwsh \
&& ln -s /opt/microsoft/powershell/pwsh /usr/bin/pwsh \
&& pwsh -Version

# 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 \
ENV AGENT_HOME /azp
RUN mkdir -p ${AGENT_HOME} \
&& curl -LsS https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/pipelines-agent-$(./arch.sh)-${AGENT_VERSION}.tar.gz | tar -xz -C ${AGENT_HOME} \
&& cd $AGENT_HOME \
&& chmod +x ./run-docker.sh ./config.sh \
&& AGENT_ALLOW_RUNASROOT="1" ./run-docker.sh --version

# Cleanup helper script
RUN rm arch.sh

# Set agent home as working directory
WORKDIR ${AGENT_HOME}

# Install Azure Pipelines Agent startup script
COPY start.sh .
RUN chmod +x start.sh
Expand Down
36 changes: 28 additions & 8 deletions src/docker/Dockerfile-jammy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ENV DEBIAN_FRONTEND=noninteractive

# Install:
# - Azure Pipelines agent system requirements
# - "gzip, make, tar, unzip, wget, zip, zsh, zstd" for developer ease-of-life
# - "zsh", for inter-operability
# - "gzip, make, tar, unzip, wget, zip, zstd" for developer ease-of-life
RUN apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
Expand All @@ -26,27 +27,46 @@ RUN apt-get update -q \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists

# Copy helper script, then verify installation
COPY arch.sh .
RUN chmod +x arch.sh \
&& ./arch.sh

# 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 \
RUN curl -LsS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg \
&& 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
# Install Powershell, then verify installation
ARG POWERSHELL_VERSION
ENV POWERSHELL_VERSION ${POWERSHELL_VERSION}
RUN mkdir -p /opt/microsoft/powershell \
&& curl -LsS https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-$(./arch.sh).tar.gz | tar -xz -C /opt/microsoft/powershell \
&& chmod +x /opt/microsoft/powershell/pwsh \
&& ln -s /opt/microsoft/powershell/pwsh /usr/bin/pwsh \
&& pwsh -Version

# 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 \
ENV AGENT_HOME /azp
RUN mkdir -p ${AGENT_HOME} \
&& curl -LsS https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/pipelines-agent-$(./arch.sh)-${AGENT_VERSION}.tar.gz | tar -xz -C ${AGENT_HOME} \
&& cd $AGENT_HOME \
&& chmod +x ./run-docker.sh ./config.sh \
&& AGENT_ALLOW_RUNASROOT="1" ./run-docker.sh --version

# Cleanup helper script
RUN rm arch.sh

# Set agent home as working directory
WORKDIR ${AGENT_HOME}

# Install Azure Pipelines Agent startup script
COPY start.sh .
RUN chmod +x start.sh
Expand Down
33 changes: 27 additions & 6 deletions src/docker/Dockerfile-ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/ubi-minimal:8.7
# Install:
# - Azure Pipelines agent system requirements
# - ASP.NET Core runtime
# - "gzip, make, tar, unzip, wget, zip, zsh, zstd" for developer ease-of-life
# - "zsh", for inter-operability
# - "gzip, make, tar, unzip, wget, zip, zstd" for developer ease-of-life
RUN microdnf install -y --refresh --nodocs --setopt=install_weak_deps=0 \
aspnetcore-runtime-6.0 \
ca-certificates \
Expand All @@ -26,25 +27,45 @@ RUN microdnf install -y --refresh --nodocs --setopt=install_weak_deps=0 \
&& microdnf clean all \
&& rm -rf /var/cache/yum

# Copy helper script, then verify installation
COPY arch.sh .
RUN chmod +x arch.sh \
&& ./arch.sh

# 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 \
&& curl -LsS 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
# Install Powershell, then verify installation
ARG POWERSHELL_VERSION
ENV POWERSHELL_VERSION ${POWERSHELL_VERSION}
RUN mkdir -p /opt/microsoft/powershell \
&& curl -LsS https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-$(./arch.sh).tar.gz | tar -xz -C /opt/microsoft/powershell \
&& chmod +x /opt/microsoft/powershell/pwsh \
&& ln -s /opt/microsoft/powershell/pwsh /usr/bin/pwsh \
&& pwsh -Version

# 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 \
ENV AGENT_HOME /azp
RUN mkdir -p ${AGENT_HOME} \
&& curl -LsS https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/pipelines-agent-$(./arch.sh)-${AGENT_VERSION}.tar.gz | tar -xz -C ${AGENT_HOME} \
&& cd $AGENT_HOME \
&& chmod +x ./run-docker.sh ./config.sh \
&& AGENT_ALLOW_RUNASROOT="1" ./run-docker.sh --version

# Cleanup helper script
RUN rm arch.sh

# Set agent home as working directory
WORKDIR ${AGENT_HOME}

# Install Azure Pipelines Agent startup script
COPY start.sh .
RUN chmod +x start.sh
Expand Down
17 changes: 17 additions & 0 deletions src/docker/arch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -e

SYS_ARCH="$(arch)"

if [[ $SYS_ARCH == x86_64 ]]; then
SYS_ARCH="linux-x64"
elif [[ $SYS_ARCH == arm* ]]; then
SYS_ARCH="linux-arm"
elif [[ $SYS_ARCH == aarch64 ]]; then
SYS_ARCH="linux-arm64"
else
echo 1>&2 "Unsupported architecture"
exit 1
fi

echo $SYS_ARCH
33 changes: 0 additions & 33 deletions src/docker/init.sh

This file was deleted.

0 comments on commit a1b6153

Please sign in to comment.