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 a1b6153 + ab87337 commit 72c147d
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
CONTAINER_NAME: ${{ github.repository }}
CONTAINER_REGISTRY: ghcr.io
POWERSHELL_VERSION: 7.2.10
YQ_VERSION: 4.33.2

jobs:
build-helm:
Expand Down Expand Up @@ -182,6 +183,7 @@ jobs:
build-args: |
"AGENT_VERSION=${{ env.AGENT_VERSION }}"
"POWERSHELL_VERSION=${{ env.POWERSHELL_VERSION }}"
"YQ_VERSION=${{ env.YQ_VERSION }}"
cache-from: type=gha
cache-to: type=gha,mode=max
context: src/docker
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ helm upgrade --install agent clemlesne-azure-pipelines-agent/azure-pipelines-age
- [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)
- [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)
- [gzip](https://www.gnu.org/software/gzip), [make](https://www.gnu.org/software/make), [tar](https://www.gnu.org/software/tar), [unzip](https://infozip.sourceforge.net/UnZip.html), [wget](https://www.gnu.org/software/wget), [yq](https://github.com/mikefarah/yq), [zip](https://infozip.sourceforge.net/Zip.html), [zstd](https://github.com/facebook/zstd) (for developer ease-of-life)

### Helm values

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

# Install:
# - Azure Pipelines agent system requirements
# - "zsh", for inter-operability
# - "gzip, make, tar, unzip, wget, zip, zstd" for developer ease-of-life
# - zsh, for inter-operability
# - gzip, make, tar, unzip, wget, yq, zip, zstd for developer ease-of-life
RUN apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
Expand All @@ -33,8 +33,8 @@ RUN chmod +x arch.sh \
&& ./arch.sh

# Install Azure CLI, then verify installation
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 \
RUN curl -LsSf https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg \
&& echo "deb [arch=$(./arch.sh)] 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 \
Expand All @@ -46,7 +46,7 @@ RUN curl -LsS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor
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 \
&& curl -LsSf https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-linux-$(./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
Expand All @@ -56,11 +56,18 @@ ARG AGENT_VERSION
ENV AGENT_VERSION ${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} \
&& curl -LsSf https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/pipelines-agent-linux-$(./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

# Install YQ, then verify installation
ARG YQ_VERSION
ENV YQ_VERSION ${YQ_VERSION}
RUN curl -LsSf https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_$(ARCH_AMD64=amd64 ./arch.sh) -o /usr/bin/yq \
&& chmod +x /usr/bin/yq \
&& yq --version

# Cleanup helper script
RUN rm arch.sh

Expand Down
19 changes: 13 additions & 6 deletions src/docker/Dockerfile-focal
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ENV DEBIAN_FRONTEND=noninteractive

# Install:
# - Azure Pipelines agent system requirements
# - "zsh", for inter-operability
# - "gzip, make, tar, unzip, wget, zip, zstd" for developer ease-of-life
# - zsh, for inter-operability
# - gzip, make, tar, unzip, wget, yq, zip, zstd for developer ease-of-life
RUN apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
Expand All @@ -33,8 +33,8 @@ RUN chmod +x arch.sh \
&& ./arch.sh

# Install Azure CLI, then verify installation
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 \
RUN curl -LsSf https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg \
&& echo "deb [arch=$(./arch.sh)] 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 \
Expand All @@ -46,7 +46,7 @@ RUN curl -LsS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor
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 \
&& curl -LsSf https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-linux-$(./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
Expand All @@ -56,11 +56,18 @@ ARG AGENT_VERSION
ENV AGENT_VERSION ${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} \
&& curl -LsSf https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/pipelines-agent-linux-$(./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

# Install YQ, then verify installation
ARG YQ_VERSION
ENV YQ_VERSION ${YQ_VERSION}
RUN curl -LsSf https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_$(ARCH_AMD64=amd64 ./arch.sh) -o /usr/bin/yq \
&& chmod +x /usr/bin/yq \
&& yq --version

# Cleanup helper script
RUN rm arch.sh

Expand Down
19 changes: 13 additions & 6 deletions src/docker/Dockerfile-jammy
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ENV DEBIAN_FRONTEND=noninteractive

# Install:
# - Azure Pipelines agent system requirements
# - "zsh", for inter-operability
# - "gzip, make, tar, unzip, wget, zip, zstd" for developer ease-of-life
# - zsh, for inter-operability
# - gzip, make, tar, unzip, wget, yq, zip, zstd for developer ease-of-life
RUN apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
Expand All @@ -33,8 +33,8 @@ RUN chmod +x arch.sh \
&& ./arch.sh

# Install Azure CLI, then verify installation
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 \
RUN curl -LsSf https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg \
&& echo "deb [arch=$(./arch.sh)] 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 \
Expand All @@ -46,7 +46,7 @@ RUN curl -LsS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor
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 \
&& curl -LsSf https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-linux-$(./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
Expand All @@ -56,11 +56,18 @@ ARG AGENT_VERSION
ENV AGENT_VERSION ${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} \
&& curl -LsSf https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/pipelines-agent-linux-$(./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

# Install YQ, then verify installation
ARG YQ_VERSION
ENV YQ_VERSION ${YQ_VERSION}
RUN curl -LsSf https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_$(ARCH_AMD64=amd64 ./arch.sh) -o /usr/bin/yq \
&& chmod +x /usr/bin/yq \
&& yq --version

# Cleanup helper script
RUN rm arch.sh

Expand Down
27 changes: 17 additions & 10 deletions src/docker/Dockerfile-ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/ubi-minimal:8.7
# Install:
# - Azure Pipelines agent system requirements
# - ASP.NET Core runtime
# - "zsh", for inter-operability
# - "gzip, make, tar, unzip, wget, zip, zstd" for developer ease-of-life
# - zsh, for inter-operability
# - gzip, make, tar, unzip, wget, yq, 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 @@ -27,25 +27,25 @@ 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 -LsS https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/azure-cli.repo \
&& curl -LsSf 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

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

# 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 \
&& curl -LsSf https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-linux-$(./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
Expand All @@ -55,11 +55,18 @@ ARG AGENT_VERSION
ENV AGENT_VERSION ${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} \
&& curl -LsSf https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/pipelines-agent-linux-$(./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

# Install YQ, then verify installation
ARG YQ_VERSION
ENV YQ_VERSION ${YQ_VERSION}
RUN curl -LsSf https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_$(ARCH_AMD64=amd64 ./arch.sh) -o /usr/bin/yq \
&& chmod +x /usr/bin/yq \
&& yq --version

# Cleanup helper script
RUN rm arch.sh

Expand Down
14 changes: 9 additions & 5 deletions src/docker/arch.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
#!/bin/bash
set -e

ARCH_AMD64="${ARCH_AMD64:-x64}"
ARCH_ARM32="${ARCH_ARM32:-arm}"
ARCH_ARM64="${ARCH_ARM64:-arm64}"

SYS_ARCH="$(arch)"

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

Expand Down

0 comments on commit 72c147d

Please sign in to comment.