Skip to content

Commit

Permalink
update docker file (Azure#26153)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickcandy authored Sep 23, 2024
1 parent 8cc130d commit 9e3b260
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 57 deletions.
5 changes: 4 additions & 1 deletion docker/Dockerfile-alpine-3.17
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/powershell:alpine-3.17
RUN apk update && apk upgrade --no-cache

ARG REPOSITORY=PSGallery
ARG MODULE=Az
Expand Down Expand Up @@ -36,7 +37,9 @@ RUN if [ "${LATEST}" = True ] ; then \
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
mkdir latest && \
tar -zxvf ./latest.tar.gz -C ./latest && \
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers;\
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
rm -fr latest &&\
rm -f latest.tar.gz ;\
else \
# install old azure-powershell from PSGallery
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \
Expand Down
50 changes: 0 additions & 50 deletions docker/Dockerfile-debian-11

This file was deleted.

5 changes: 4 additions & 1 deletion docker/Dockerfile-debian-12
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/powershell:debian-12
RUN apt-get update && apt-get upgrade -y && apt-get clean && rm -rf /var/lib/apt/lists/*

ARG REPOSITORY=PSGallery
ARG MODULE=Az
Expand Down Expand Up @@ -36,7 +37,9 @@ RUN if [ "${LATEST}" = True ] ; then \
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
mkdir latest && \
tar -zxvf ./latest.tar.gz -C ./latest && \
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
rm -fr latest &&\
rm -f latest.tar.gz ;\
else \
# install old azure-powershell from PSGallery
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \
Expand Down
5 changes: 4 additions & 1 deletion docker/Dockerfile-mariner-2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/powershell:mariner-2.0
RUN tdnf update -y && tdnf upgrade -y && tdnf clean all

ARG REPOSITORY=PSGallery
ARG MODULE=Az
Expand Down Expand Up @@ -38,7 +39,9 @@ RUN if [ "${LATEST}" = True ] ; then \
tdnf install -y tar gzip && \
tdnf clean all && \
tar -zxvf ./latest.tar.gz -C ./latest && \
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
rm -fr latest &&\
rm -f latest.tar.gz ;\
else \
# install old azure-powershell from PSGallery
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \
Expand Down
5 changes: 4 additions & 1 deletion docker/Dockerfile-mariner-2-arm64
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/powershell:mariner-2.0-arm64
RUN tdnf update -y && tdnf upgrade -y && tdnf clean all

ARG REPOSITORY=PSGallery
ARG MODULE=Az
Expand Down Expand Up @@ -38,7 +39,9 @@ RUN if [ "${LATEST}" = True ] ; then \
tdnf install -y tar gzip && \
tdnf clean all && \
tar -zxvf ./latest.tar.gz -C ./latest && \
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
rm -fr latest &&\
rm -f latest.tar.gz ;\
else \
# install old azure-powershell from PSGallery
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \
Expand Down
5 changes: 4 additions & 1 deletion docker/Dockerfile-ubi-8
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/powershell:ubi-8
RUN yum update -y && yum clean all

ARG REPOSITORY=PSGallery
ARG MODULE=Az
Expand Down Expand Up @@ -36,7 +37,9 @@ RUN if [ "${LATEST}" = True ] ; then \
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
mkdir latest && \
tar -zxvf ./latest.tar.gz -C ./latest && \
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
rm -fr latest &&\
rm -f latest.tar.gz ;\
else \
# install old azure-powershell from PSGallery
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \
Expand Down
5 changes: 4 additions & 1 deletion docker/Dockerfile-ubi-9
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/powershell:ubi-9
RUN dnf update -y && dnf clean all

ARG REPOSITORY=PSGallery
ARG MODULE=Az
Expand Down Expand Up @@ -36,7 +37,9 @@ RUN if [ "${LATEST}" = True ] ; then \
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
mkdir latest && \
tar -zxvf ./latest.tar.gz -C ./latest && \
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
rm -fr latest &&\
rm -f latest.tar.gz ;\
else \
# install old azure-powershell from PSGallery
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \
Expand Down
5 changes: 4 additions & 1 deletion docker/Dockerfile-ubuntu-20.04
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/powershell:ubuntu-20.04
RUN apt-get update && apt-get upgrade -y && apt-get clean && rm -rf /var/lib/apt/lists/*

ARG REPOSITORY=PSGallery
ARG MODULE=Az
Expand Down Expand Up @@ -36,7 +37,9 @@ RUN if [ "${LATEST}" = True ] ; then \
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
mkdir latest && \
tar -zxvf ./latest.tar.gz -C ./latest && \
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers ;\
pwsh -Command ./latest/InstallModule.ps1 -Scope AllUsers &&\
rm -fr latest &&\
rm -f latest.tar.gz ;\
else \
# install old azure-powershell from PSGallery
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile-ubuntu-22.04
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/powershell:ubuntu-22.04
RUN apt-get update && apt-get upgrade -y && apt-get clean && rm -rf /var/lib/apt/lists/*

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

0 comments on commit 9e3b260

Please sign in to comment.