File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -67,12 +67,14 @@ RUN useradd -ms /bin/bash ${NORMAL_USER} && \
6767 sudo dpkg -i cosign_${LATEST_VERSION}_amd64.deb
6868
6969# Install PowerShell
70- RUN curl -sSLO https://packages.microsoft.com/config/debian/$(grep -oP '(?<=^DISTRIB_RELEASE=).+' /etc/lsb-release | tr -d '"' )/packages-microsoft-prod.deb && \
71- dpkg -i packages-microsoft-prod.deb && \
72- rm -f packages-microsoft-prod.deb && \
73- apt-get update && \
74- apt-get install -y powershell && \
75- ln -s /usr/bin/pwsh /usr/bin/powershell
70+ ARG DEBIAN_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -d= -f2 | tr -d '"' )
71+ RUN curl -sSL "https://packages.microsoft.com/config/debian/${DEBIAN_VERSION}/packages-microsoft-prod.deb" \
72+ -o packages-microsoft-prod.deb \
73+ && dpkg -i packages-microsoft-prod.deb \
74+ && rm packages-microsoft-prod.deb \
75+ && apt-get update \
76+ && apt-get install -y powershell \
77+ && ln -sf /usr/bin/pwsh /usr/bin/powershell
7678
7779# Install Azure Modules for Powershell - This can take a while, so setting as final step to shorten potential rebuilds
7880RUN pwsh -Command Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted && \
You can’t perform that action at this time.
0 commit comments