Skip to content

Commit

Permalink
Fix nuget ecosystem arm build (#10693)
Browse files Browse the repository at this point in the history
* Support powershell installation on arm64 architectures

* Use /usr/local instead of /opt dir for powershell install
  • Loading branch information
andrcuns authored Oct 11, 2024
1 parent c1a96c4 commit e7f6031
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions nuget/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
FROM ghcr.io/dependabot/dependabot-updater-core

ARG TARGETARCH

USER root

ENV DEPENDABOT_NATIVE_HELPERS_PATH="/opt"

# install dependencies
RUN source /etc/os-release \
&& curl --location --output /tmp/packages-microsoft-prod.deb "https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb" \
&& dpkg -i /tmp/packages-microsoft-prod.deb \
&& rm /tmp/packages-microsoft-prod.deb
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
jq \
libicu-dev=70.1-2 \
powershell \
&& rm -rf /var/lib/apt/lists/*

ARG POWERSHELL_VERSION=7.4.5
RUN ARCH=$([ $TARGETARCH = "arm64" ] && echo "arm64" || echo "x64") \
&& POWERSHELL_VERSION_MAJOR=$(echo $POWERSHELL_VERSION | cut -d. -f1) \
&& INSTALL_PATH=/usr/local/microsoft/powershell/${POWERSHELL_VERSION_MAJOR} \
&& curl --location --output /tmp/powershell.tar.gz "https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-linux-${ARCH}.tar.gz" \
&& mkdir -p $INSTALL_PATH \
&& tar zxf /tmp/powershell.tar.gz -C $INSTALL_PATH \
&& chmod +x $INSTALL_PATH/pwsh \
&& ln -s $INSTALL_PATH/pwsh /usr/bin/pwsh \
&& rm /tmp/powershell.tar.gz \
&& pwsh --version

# Install .NET SDK
ARG DOTNET_LTS_SDK_VERSION=8.0.402
ARG DOTNET_STS_SDK_VERSION=9.0.100-rc.1.24452.12
Expand Down

0 comments on commit e7f6031

Please sign in to comment.