From 9e792e0a7b629d043792f75950389e77e03b3b8e Mon Sep 17 00:00:00 2001 From: Thomas Van Laere Date: Thu, 10 Sep 2020 00:59:01 +0200 Subject: [PATCH] Add Dockerfile-alpine-3.10 --- docker/Dockerfile-alpine-3.10 | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docker/Dockerfile-alpine-3.10 diff --git a/docker/Dockerfile-alpine-3.10 b/docker/Dockerfile-alpine-3.10 new file mode 100644 index 000000000000..9eae55548942 --- /dev/null +++ b/docker/Dockerfile-alpine-3.10 @@ -0,0 +1,40 @@ +FROM mcr.microsoft.com/powershell:alpine-3.10 + +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 IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-alpine-3.10 + +ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-alpine-3.10" + +LABEL maintainer="Azure PowerShell Team " \ + 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" + +# install azure-powershell from PSGallery +RUN pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \ + pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Repository ${REPOSITORY} && \ + pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted + +# create AzureRmContextSettings.json before it was generated +COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS} + +CMD [ "pwsh" ]