forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revise smoke test and change Docker files (Azure#18263)
* upgrade get-azlocation cmd(upgrade subcriptionclient version, add extend location peremeter, and expose more info * update test for azlocation * add changlog * revise changlog.md:delete new title * revise changlog.md * add dockerfiles for debian10,debian11,mairin1,ubuntu2204 * revise docker file name * change parameter to singular noun * revise session record json file * revise docker file * revise docker file * revise session record json file * revise session record json file * revise session record json file * revise session record json file * revise session record json file * revise session record json file * revise session record json file * add parameter(failOnStandardError: true) for smoketest * add parameter(failOnStandardError: true) for smoketest * change testcase in smoke test.getazadgroup -> get-azaduser * change testcase in smoke test.getazadgroup -> get-azaduser * change testcase in smoke test.getazadgroup -> get-azaduser * change docker file
- Loading branch information
Showing
11 changed files
with
239 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ ARG AZURE=/root/.Azure | |
ARG VCS_REF="none" | ||
ARG BUILD_DATE= | ||
ARG VERSION= | ||
ARG LATEST= | ||
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-alpine-3.13 | ||
|
||
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-alpine-3.13" | ||
|
@@ -29,10 +30,18 @@ LABEL maintainer="Azure PowerShell Team <[email protected]>" \ | |
org.label-schema.docker.cmd.test="currently not available" \ | ||
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help" | ||
|
||
# install azure-powershell from PSGallery | ||
RUN pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted | ||
RUN if [ "${LATEST}" = True ] ; then \ | ||
# install latest azure-powershell from BLOB | ||
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 ;\ | ||
else \ | ||
# install old azure-powershell from PSGallery | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted ;\ | ||
fi | ||
|
||
# create AzureRmContextSettings.json before it was generated | ||
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ ARG AZURE=/root/.Azure | |
ARG VCS_REF="none" | ||
ARG BUILD_DATE= | ||
ARG VERSION= | ||
ARG LATEST= | ||
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-alpine-3.14 | ||
|
||
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-alpine-3.14" | ||
|
@@ -29,10 +30,18 @@ LABEL maintainer="Azure PowerShell Team <[email protected]>" \ | |
org.label-schema.docker.cmd.test="currently not available" \ | ||
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help" | ||
|
||
# install azure-powershell from PSGallery | ||
RUN pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted | ||
RUN if [ "${LATEST}" = True ] ; then \ | ||
# install latest azure-powershell from BLOB | ||
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 ;\ | ||
else \ | ||
# install old azure-powershell from PSGallery | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted ;\ | ||
fi | ||
|
||
# create AzureRmContextSettings.json before it was generated | ||
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ ARG AZURE=/root/.Azure | |
ARG VCS_REF="none" | ||
ARG BUILD_DATE= | ||
ARG VERSION= | ||
ARG LATEST= | ||
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-centos-7 | ||
|
||
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-centos-7" | ||
|
@@ -29,11 +30,18 @@ LABEL maintainer="Azure PowerShell Team <[email protected]>" \ | |
org.label-schema.docker.cmd.test="currently not available" \ | ||
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help" | ||
|
||
# install azure-powershell from PSGallery | ||
RUN pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted | ||
|
||
RUN if [ "${LATEST}" = True ] ; then \ | ||
# install latest azure-powershell from BLOB | ||
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 ;\ | ||
else \ | ||
# install old azure-powershell from PSGallery | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted ;\ | ||
fi | ||
# create AzureRmContextSettings.json before it was generated | ||
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM mcr.microsoft.com/powershell:debian-9 | ||
FROM mcr.microsoft.com/powershell:debian-10 | ||
|
||
ARG REPOSITORY=PSGallery | ||
ARG MODULE=Az | ||
|
@@ -8,9 +8,10 @@ ARG AZURE=/root/.Azure | |
ARG VCS_REF="none" | ||
ARG BUILD_DATE= | ||
ARG VERSION= | ||
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-debian-9 | ||
ARG LATEST= | ||
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-debian-10 | ||
|
||
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-debian-9" | ||
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-debian-10" | ||
|
||
LABEL maintainer="Azure PowerShell Team <[email protected]>" \ | ||
readme.md="http://aka.ms/azpsdockerreadme" \ | ||
|
@@ -29,10 +30,18 @@ LABEL maintainer="Azure PowerShell Team <[email protected]>" \ | |
org.label-schema.docker.cmd.test="currently not available" \ | ||
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help" | ||
|
||
# install azure-powershell from PSGallery | ||
RUN pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted | ||
RUN if [ "${LATEST}" = True ] ; then \ | ||
# install latest azure-powershell from BLOB | ||
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 ;\ | ||
else \ | ||
# install old azure-powershell from PSGallery | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted ;\ | ||
fi | ||
|
||
# create AzureRmContextSettings.json before it was generated | ||
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM mcr.microsoft.com/powershell:debian-11 | ||
|
||
ARG REPOSITORY=PSGallery | ||
ARG MODULE=Az | ||
ARG CONFIG=config | ||
ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json | ||
ARG AZURE=/root/.Azure | ||
ARG VCS_REF="none" | ||
ARG BUILD_DATE= | ||
ARG VERSION= | ||
ARG LATEST= | ||
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-debian-11 | ||
|
||
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-debian-11" | ||
|
||
LABEL maintainer="Azure PowerShell Team <[email protected]>" \ | ||
readme.md="http://aka.ms/azpsdockerreadme" \ | ||
description="This Dockerfile will install the latest release of Azure PowerShell." \ | ||
org.label-schema.build-date=${BUILD_DATE} \ | ||
org.label-schema.usage="http://aka.ms/azpsdocker" \ | ||
org.label-schema.url="http://aka.ms/azpsdockerreadme" \ | ||
org.label-schema.vcs-url="https://github.com/Azure/azure-powershell" \ | ||
org.label-schema.name="azure powershell" \ | ||
org.label-schema.vendor="Azure PowerShell" \ | ||
org.label-schema.version=${VERSION} \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.vcs-ref=${VCS_REF} \ | ||
org.label-schema.docker.cmd="docker run --rm ${IMAGE_NAME} pwsh -c '\$PSVERSIONTABLE'" \ | ||
org.label-schema.docker.cmd.devel="docker run -it --rm -e 'DebugPreference=Continue' ${IMAGE_NAME} pwsh" \ | ||
org.label-schema.docker.cmd.test="currently not available" \ | ||
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help" | ||
|
||
RUN if [ "${LATEST}" = True ] ; then \ | ||
# install latest azure-powershell from BLOB | ||
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 ;\ | ||
else \ | ||
# install old azure-powershell from PSGallery | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted ;\ | ||
fi | ||
|
||
# create AzureRmContextSettings.json before it was generated | ||
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS} | ||
|
||
CMD [ "pwsh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM mcr.microsoft.com/powershell:preview-mariner-1.0 | ||
|
||
ARG REPOSITORY=PSGallery | ||
ARG MODULE=Az | ||
ARG CONFIG=config | ||
ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json | ||
ARG AZURE=/root/.Azure | ||
ARG VCS_REF="none" | ||
ARG BUILD_DATE= | ||
ARG VERSION= | ||
ARG LATEST= | ||
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-mariner-1.0 | ||
|
||
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-mariner-1.0" | ||
|
||
LABEL maintainer="Azure PowerShell Team <[email protected]>" \ | ||
readme.md="http://aka.ms/azpsdockerreadme" \ | ||
description="This Dockerfile will install the latest release of Azure PowerShell." \ | ||
org.label-schema.build-date=${BUILD_DATE} \ | ||
org.label-schema.usage="http://aka.ms/azpsdocker" \ | ||
org.label-schema.url="http://aka.ms/azpsdockerreadme" \ | ||
org.label-schema.vcs-url="https://github.com/Azure/azure-powershell" \ | ||
org.label-schema.name="azure powershell" \ | ||
org.label-schema.vendor="Azure PowerShell" \ | ||
org.label-schema.version=${VERSION} \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.vcs-ref=${VCS_REF} \ | ||
org.label-schema.docker.cmd="docker run --rm ${IMAGE_NAME} pwsh -c '\$PSVERSIONTABLE'" \ | ||
org.label-schema.docker.cmd.devel="docker run -it --rm -e 'DebugPreference=Continue' ${IMAGE_NAME} pwsh" \ | ||
org.label-schema.docker.cmd.test="currently not available" \ | ||
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help" | ||
|
||
RUN if [ "${LATEST}" = True ] ; then \ | ||
# install latest azure-powershell from BLOB | ||
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 ;\ | ||
else \ | ||
# install old azure-powershell from PSGallery | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted ;\ | ||
fi | ||
|
||
# create AzureRmContextSettings.json before it was generated | ||
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS} | ||
|
||
CMD [ "pwsh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ ARG AZURE=/root/.Azure | |
ARG VCS_REF="none" | ||
ARG BUILD_DATE= | ||
ARG VERSION= | ||
ARG LATEST= | ||
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-ubuntu-18.04 | ||
|
||
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-ubuntu-18.04" | ||
|
@@ -28,11 +29,19 @@ LABEL maintainer="Azure PowerShell Team <[email protected]>" \ | |
org.label-schema.docker.cmd.devel="docker run -it --rm -e 'DebugPreference=Continue' ${IMAGE_NAME} pwsh" \ | ||
org.label-schema.docker.cmd.test="currently not available" \ | ||
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help" | ||
|
||
# install azure-powershell from PSGallery | ||
RUN pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted | ||
|
||
RUN if [ "${LATEST}" = True ] ; then \ | ||
# install latest azure-powershell from BLOB | ||
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 ;\ | ||
else \ | ||
# install old azure-powershell from PSGallery | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted ;\ | ||
fi | ||
|
||
# create AzureRmContextSettings.json before it was generated | ||
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ ARG AZURE=/root/.Azure | |
ARG VCS_REF="none" | ||
ARG BUILD_DATE= | ||
ARG VERSION= | ||
ARG LATEST= | ||
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-ubuntu-20.04 | ||
|
||
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-ubuntu-20.04" | ||
|
@@ -29,10 +30,18 @@ LABEL maintainer="Azure PowerShell Team <[email protected]>" \ | |
org.label-schema.docker.cmd.test="currently not available" \ | ||
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help" | ||
|
||
# install azure-powershell from PSGallery | ||
RUN pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted | ||
RUN if [ "${LATEST}" = True ] ; then \ | ||
# install latest azure-powershell from BLOB | ||
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 ;\ | ||
else \ | ||
# install old azure-powershell from PSGallery | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted ;\ | ||
fi | ||
|
||
# create AzureRmContextSettings.json before it was generated | ||
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
FROM mcr.microsoft.com/powershell:ubuntu-22.04 | ||
|
||
ARG REPOSITORY=PSGallery | ||
ARG MODULE=Az | ||
ARG CONFIG=config | ||
ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json | ||
ARG AZURE=/root/.Azure | ||
ARG VCS_REF="none" | ||
ARG BUILD_DATE= | ||
ARG VERSION= | ||
ARG LATEST= | ||
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-ubuntu-22.04 | ||
|
||
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-ubuntu-22.04" | ||
|
||
LABEL maintainer="Azure PowerShell Team <[email protected]>" \ | ||
readme.md="http://aka.ms/azpsdockerreadme" \ | ||
description="This Dockerfile will install the latest release of Azure PowerShell." \ | ||
org.label-schema.build-date=${BUILD_DATE} \ | ||
org.label-schema.usage="http://aka.ms/azpsdocker" \ | ||
org.label-schema.url="http://aka.ms/azpsdockerreadme" \ | ||
org.label-schema.vcs-url="https://github.com/Azure/azure-powershell" \ | ||
org.label-schema.name="azure powershell" \ | ||
org.label-schema.vendor="Azure PowerShell" \ | ||
org.label-schema.version=${VERSION} \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.vcs-ref=${VCS_REF} \ | ||
org.label-schema.docker.cmd="docker run --rm ${IMAGE_NAME} pwsh -c '\$PSVERSIONTABLE'" \ | ||
org.label-schema.docker.cmd.devel="docker run -it --rm -e 'DebugPreference=Continue' ${IMAGE_NAME} pwsh" \ | ||
org.label-schema.docker.cmd.test="currently not available" \ | ||
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help" | ||
|
||
RUN if [ "${LATEST}" = True ] ; then \ | ||
# install latest azure-powershell from BLOB | ||
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 ;\ | ||
else \ | ||
# install old azure-powershell from PSGallery | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ | ||
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \ | ||
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted ;\ | ||
fi | ||
|
||
|
||
# create AzureRmContextSettings.json before it was generated | ||
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS} | ||
|
||
CMD [ "pwsh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters