Skip to content

Commit ce71fa2

Browse files
committed
update debian
1 parent b9f540d commit ce71fa2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

containers/debian/Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff 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
7880
RUN pwsh -Command Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted && \

0 commit comments

Comments
 (0)