Skip to content

Commit 9e3b260

Browse files
authored
update docker file (Azure#26153)
1 parent 8cc130d commit 9e3b260

9 files changed

+31
-57
lines changed

docker/Dockerfile-alpine-3.17

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM mcr.microsoft.com/powershell:alpine-3.17
2+
RUN apk update && apk upgrade --no-cache
23

34
ARG REPOSITORY=PSGallery
45
ARG MODULE=Az
@@ -36,7 +37,9 @@ RUN if [ "${LATEST}" = True ] ; then \
3637
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
3738
mkdir latest && \
3839
tar -zxvf ./latest.tar.gz -C ./latest && \
39-
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers;\
40+
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
41+
rm -fr latest &&\
42+
rm -f latest.tar.gz ;\
4043
else \
4144
# install old azure-powershell from PSGallery
4245
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \

docker/Dockerfile-debian-11

-50
This file was deleted.

docker/Dockerfile-debian-12

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM mcr.microsoft.com/powershell:debian-12
2+
RUN apt-get update && apt-get upgrade -y && apt-get clean && rm -rf /var/lib/apt/lists/*
23

34
ARG REPOSITORY=PSGallery
45
ARG MODULE=Az
@@ -36,7 +37,9 @@ RUN if [ "${LATEST}" = True ] ; then \
3637
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
3738
mkdir latest && \
3839
tar -zxvf ./latest.tar.gz -C ./latest && \
39-
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
40+
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
41+
rm -fr latest &&\
42+
rm -f latest.tar.gz ;\
4043
else \
4144
# install old azure-powershell from PSGallery
4245
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \

docker/Dockerfile-mariner-2

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM mcr.microsoft.com/powershell:mariner-2.0
2+
RUN tdnf update -y && tdnf upgrade -y && tdnf clean all
23

34
ARG REPOSITORY=PSGallery
45
ARG MODULE=Az
@@ -38,7 +39,9 @@ RUN if [ "${LATEST}" = True ] ; then \
3839
tdnf install -y tar gzip && \
3940
tdnf clean all && \
4041
tar -zxvf ./latest.tar.gz -C ./latest && \
41-
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
42+
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
43+
rm -fr latest &&\
44+
rm -f latest.tar.gz ;\
4245
else \
4346
# install old azure-powershell from PSGallery
4447
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \

docker/Dockerfile-mariner-2-arm64

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM mcr.microsoft.com/powershell:mariner-2.0-arm64
2+
RUN tdnf update -y && tdnf upgrade -y && tdnf clean all
23

34
ARG REPOSITORY=PSGallery
45
ARG MODULE=Az
@@ -38,7 +39,9 @@ RUN if [ "${LATEST}" = True ] ; then \
3839
tdnf install -y tar gzip && \
3940
tdnf clean all && \
4041
tar -zxvf ./latest.tar.gz -C ./latest && \
41-
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
42+
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
43+
rm -fr latest &&\
44+
rm -f latest.tar.gz ;\
4245
else \
4346
# install old azure-powershell from PSGallery
4447
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \

docker/Dockerfile-ubi-8

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM mcr.microsoft.com/powershell:ubi-8
2+
RUN yum update -y && yum clean all
23

34
ARG REPOSITORY=PSGallery
45
ARG MODULE=Az
@@ -36,7 +37,9 @@ RUN if [ "${LATEST}" = True ] ; then \
3637
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
3738
mkdir latest && \
3839
tar -zxvf ./latest.tar.gz -C ./latest && \
39-
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
40+
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
41+
rm -fr latest &&\
42+
rm -f latest.tar.gz ;\
4043
else \
4144
# install old azure-powershell from PSGallery
4245
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \

docker/Dockerfile-ubi-9

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM mcr.microsoft.com/powershell:ubi-9
2+
RUN dnf update -y && dnf clean all
23

34
ARG REPOSITORY=PSGallery
45
ARG MODULE=Az
@@ -36,7 +37,9 @@ RUN if [ "${LATEST}" = True ] ; then \
3637
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
3738
mkdir latest && \
3839
tar -zxvf ./latest.tar.gz -C ./latest && \
39-
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
40+
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
41+
rm -fr latest &&\
42+
rm -f latest.tar.gz ;\
4043
else \
4144
# install old azure-powershell from PSGallery
4245
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \

docker/Dockerfile-ubuntu-20.04

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM mcr.microsoft.com/powershell:ubuntu-20.04
2+
RUN apt-get update && apt-get upgrade -y && apt-get clean && rm -rf /var/lib/apt/lists/*
23

34
ARG REPOSITORY=PSGallery
45
ARG MODULE=Az
@@ -36,7 +37,9 @@ RUN if [ "${LATEST}" = True ] ; then \
3637
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
3738
mkdir latest && \
3839
tar -zxvf ./latest.tar.gz -C ./latest && \
39-
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
40+
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
41+
rm -fr latest &&\
42+
rm -f latest.tar.gz ;\
4043
else \
4144
# install old azure-powershell from PSGallery
4245
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \

docker/Dockerfile-ubuntu-22.04

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM mcr.microsoft.com/powershell:ubuntu-22.04
2+
RUN apt-get update && apt-get upgrade -y && apt-get clean && rm -rf /var/lib/apt/lists/*
23

34
ARG REPOSITORY=PSGallery
45
ARG MODULE=Az
@@ -37,6 +38,8 @@ RUN if [ "${LATEST}" = True ] ; then \
3738
mkdir latest && \
3839
tar -zxvf ./latest.tar.gz -C ./latest && \
3940
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers;\
41+
rm -fr latest &&\
42+
rm -f latest.tar.gz ;\
4043
else \
4144
# install old azure-powershell from PSGallery
4245
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \

0 commit comments

Comments
 (0)