Skip to content

Commit

Permalink
Fix aarch64 build. (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclay authored May 17, 2022
1 parent be8e463 commit f7fd1e2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
21 changes: 14 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,20 @@ RUN rm /etc/apt/apt.conf.d/docker-clean && \
ln -s python3 /usr/bin/python && \
locale-gen en_US.UTF-8

# Install pwsh, and other PS/.NET sanity test tools.
RUN apt-get update -y && \
curl --silent --location https://github.com/PowerShell/PowerShell/releases/download/v7.2.0/powershell_7.2.0-1.deb_amd64.deb -o /tmp/pwsh.deb && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends /tmp/pwsh.deb && \
rm /tmp/pwsh.deb && \
apt-get clean && \
# Install PowerShell using a binary archive.
# This allows pinning to a specific version, and also brings support for multiple architectures.
RUN arch="$(uname -i)" && \
arch=$(if [ "${arch}" = "x86_64" ]; then echo "x64"; \
elif [ "${arch}" = "aarch64" ]; then echo "arm64"; \
else echo "unknown arch: ${arch}" && exit 1; fi) && \
url="https://github.com/PowerShell/PowerShell/releases/download/v7.2.3/powershell-7.2.3-linux-${arch}.tar.gz" && \
echo "URL: ${url}" && \
curl -sL "${url}" > /tmp/powershell.tgz && \
mkdir -p /opt/microsoft/powershell/7 && \
tar zxf /tmp/powershell.tgz -C /opt/microsoft/powershell/7 && \
rm /tmp/powershell.tgz && \
chmod +x /opt/microsoft/powershell/7/pwsh && \
ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh && \
pwsh --version

ENV container=docker
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ stages:
displayName: Install containmint
- script: >
containmint build
--tag "quay.io/ansible/scratchpad:$(container_name)-$(arch)"
--arch "$(arch)"
--tag "quay.io/ansible/scratchpad:$(container_name)-$(System.JobName)"
--arch "$(System.JobName)"
$(push_or_no_login)
displayName: Build
env:
Expand Down

0 comments on commit f7fd1e2

Please sign in to comment.