Skip to content

Commit

Permalink
Add POWERSHELL_DISTRIBUTION_CHANNEL environment variable (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapatwardhan authored and TravisEz13 committed Aug 8, 2019
1 parent 954b662 commit 8da8107
Show file tree
Hide file tree
Showing 26 changed files with 160 additions and 23 deletions.
4 changes: 4 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ update_configs:
- package_manager: "docker"
directory: "/release/preview/windowsservercore/dependabot"
update_schedule: "daily"

- package_manager: "docker"
directory: "/release/preview/alpine38/dependabot"
update_schedule: "daily"
1 change: 1 addition & 0 deletions release/preview/alpine38/dependabot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM node:10.15.3-alpine
3 changes: 2 additions & 1 deletion release/preview/alpine38/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Alpine-3.8

# Install dotnet dependencies and ca-certificates
RUN apk add --no-cache \
Expand Down
7 changes: 4 additions & 3 deletions release/preview/alpine38/test-deps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ FROM node:10.15.3-alpine as node

FROM ${BaseImage}

ENV NODE_VERSION 10.15.3
ENV YARN_VERSION=1.13.0
ENV NVM_DIR="/root/.nvm"
ENV NODE_VERSION=10.15.3 \
YARN_VERSION=1.13.0 \
NVM_DIR="/root/.nvm" \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-3.8

# workaround for Alpine to run in Azure DevOps
ENV NODE_NO_WARNINGS=1
Expand Down
5 changes: 4 additions & 1 deletion release/preview/alpine39/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v
# Start a new stage so we lose all the tar.gz layers from the final image
FROM ${imageRepo}:${fromTag}

ARG fromTag=3.9

# Copy only the files we need from the previous stage
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]

Expand All @@ -42,7 +44,8 @@ ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Alpine-${fromTag}

# Install dotnet dependencies and ca-certificates
RUN apk add --no-cache \
Expand Down
9 changes: 6 additions & 3 deletions release/preview/alpine39/test-deps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ FROM node:10.15.3-alpine as node

FROM ${BaseImage}

ENV NODE_VERSION 10.15.3
ENV YARN_VERSION=1.13.0
ENV NVM_DIR="/root/.nvm"
ARG fromTag=3.9

ENV NODE_VERSION=10.15.3 \
YARN_VERSION=1.13.0 \
NVM_DIR="/root/.nvm" \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-${fromTag}

# workaround for Alpine to run in Azure DevOps
ENV NODE_NO_WARNINGS=1
Expand Down
6 changes: 5 additions & 1 deletion release/preview/centos7/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ ARG PACKAGE_VERSION=6.2.0_preview.2
ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.rhel.7.x86_64.rpm
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}

ARG fromTag=7
ARG imageRepo=centos

# Define ENVs for Localization/Globalization
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-CentOS-${fromTag}

# Install dependencies and clean up
RUN curl -sSL ${PS_PACKAGE_URL} -o /tmp/powershell.rpm \
Expand Down
2 changes: 2 additions & 0 deletions release/preview/centos7/test-deps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ RUN yum install -y \
openssl \
&& yum clean all

ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-CentOS-7

# Define args needed only for the labels
ARG VCS_REF="none"
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:centos-7
Expand Down
3 changes: 2 additions & 1 deletion release/preview/debian10/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Debian-10

# Install dependencies and clean up
RUN apt-get update \
Expand Down
2 changes: 2 additions & 0 deletions release/preview/debian10/test-deps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Debian-10

# Define args needed only for the labels
ARG VCS_REF="none"
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:debian-9
Expand Down
3 changes: 2 additions & 1 deletion release/preview/debian9/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Debian-9

# Install dependencies and clean up
RUN apt-get update \
Expand Down
2 changes: 2 additions & 0 deletions release/preview/debian9/test-deps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Debian-9

# Define args needed only for the labels
ARG VCS_REF="none"
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:debian-9
Expand Down
5 changes: 4 additions & 1 deletion release/preview/fedora/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ ARG PACKAGE_VERSION=6.2.0_preview.2
ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.rhel.7.x86_64.rpm
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}

ARG fromTag=28

# Define ENVs for Localization/Globalization
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Fedora-${fromTag}

# Install dependencies and clean up
RUN curl -sSL ${PS_PACKAGE_URL} -o /tmp/powershell.rpm \
Expand Down
4 changes: 4 additions & 0 deletions release/preview/fedora/test-deps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ARG BaseImage=mcr.microsoft.com/powershell:fedora-28

FROM ${BaseImage}

ARG fromTag=28

# Install dependencies and clean up
RUN dnf install -y \
sudo \
Expand All @@ -13,6 +15,8 @@ RUN dnf install -y \
procps-ng \
&& dnf clean all

ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Fedora-${fromTag}

# Define args needed only for the labels
ARG VCS_REF="none"
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:fedora-28
Expand Down
5 changes: 4 additions & 1 deletion release/preview/nanoserver/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ RUN Write-host "Verifying valid Version..."; `
# Install PowerShell into NanoServer
FROM ${NanoServerRepo}:${fromTag}

ARG fromTag=1709

ARG VCS_REF="none"
ARG PS_VERSION=6.1.0-rc.1
ARG IMAGE_NAME=mcr.microsoft.com/powershell
Expand All @@ -65,7 +67,8 @@ ENV ProgramFiles="C:\Program Files" `
LOCALAPPDATA="C:\Users\ContainerAdministrator\AppData\Local" `
PSModuleAnalysisCachePath="$LOCALAPPDATA\Microsoft\Windows\PowerShell\docker\ModuleAnalysisCache" `
# Persist %PSCORE% ENV variable for user convenience
PSCORE="$ProgramFiles\PowerShell\pwsh.exe"
PSCORE="$ProgramFiles\PowerShell\pwsh.exe" `
POWERSHELL_DISTRIBUTION_CHANNEL="PSDocker-NanoServer-${fromTag}"

COPY --from=installer-env ["\\PowerShell\\", "$ProgramFiles\\PowerShell"]

Expand Down
5 changes: 4 additions & 1 deletion release/preview/nanoserver1809/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ RUN Write-host "Verifying valid Version..."; `
# Install PowerShell into NanoServer
FROM ${NanoServerRepo}:${fromTag}

ARG fromTag=1709

ARG VCS_REF="none"
ARG PS_VERSION=6.2.0-rc.1
ARG IMAGE_NAME=mcr.microsoft.com/powershell
Expand Down Expand Up @@ -67,7 +69,8 @@ ENV ProgramFiles="C:\Program Files" `
# Persist %PSCORE% ENV variable for user convenience
PSCORE="$ProgramFiles\PowerShell\pwsh.exe" `
# Set the default windows path so we can use it
WindowsPATH="C:\Windows\system32;C:\Windows"
WindowsPATH="C:\Windows\system32;C:\Windows" `
POWERSHELL_DISTRIBUTION_CHANNEL="PSDocker-NanoServer-${fromTag}"

# Set the path
ENV PATH="$WindowsPATH;${ProgramFiles}\PowerShell;"
Expand Down
6 changes: 4 additions & 2 deletions release/preview/opensuse423/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v
# Start a new stage so we lose all the tar.gz layers from the final image
FROM ${imageRepo}:${fromTag}

ARG fromTag=42.3

# Copy only the files we need from the previous stage
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]

Expand All @@ -49,8 +51,8 @@ ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache

PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-OpenSUSE-${fromTag}

# Install dependencies
RUN zypper --non-interactive update --skip-interactive \
Expand Down
4 changes: 4 additions & 0 deletions release/preview/opensuse423/test-deps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ARG BaseImage=mcr.microsoft.com/powershell:opensuse-42.3

FROM ${BaseImage}

ARG fromTag=42.3

# Install dependencies and clean up
RUN zypper --non-interactive update --skip-interactive \
&& zypper --non-interactive install \
Expand All @@ -16,6 +18,8 @@ RUN zypper --non-interactive update --skip-interactive \
# remove package manager log file
&& rm -f /var/log/zypp/history /var/log/zypper.log

ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-OpenSUSE-${fromTag}

# Define args needed only for the labels
ARG VCS_REF="none"
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:centos7
Expand Down
3 changes: 2 additions & 1 deletion release/preview/ubuntu16.04/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Ubuntu-16.04

# Install dependencies and clean up
RUN apt-get update \
Expand Down
2 changes: 2 additions & 0 deletions release/preview/ubuntu16.04/test-deps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Ubuntu-16.04

# Define args needed only for the labels
ARG VCS_REF="none"
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:ubuntu-16.04
Expand Down
3 changes: 2 additions & 1 deletion release/preview/ubuntu18.04/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Ubuntu-18.04

# Install dependencies and clean up
RUN apt-get update \
Expand Down
2 changes: 2 additions & 0 deletions release/preview/ubuntu18.04/test-deps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Ubuntu-18.04

# Define args needed only for the labels
ARG VCS_REF="none"
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:ubuntu-18.04
Expand Down
3 changes: 2 additions & 1 deletion release/preview/windowsservercore/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ ENV ProgramFiles="C:\Program Files" `
LOCALAPPDATA="C:\Users\ContainerAdministrator\AppData\Local" `
PSModuleAnalysisCachePath="$LOCALAPPDATA\Microsoft\Windows\PowerShell\docker\ModuleAnalysisCache" `
# Persist %PSCORE% ENV variable for user convenience
PSCORE="$ProgramFiles\PowerShell\pwsh.exe"
PSCORE="$ProgramFiles\PowerShell\pwsh.exe" `
POWERSHELL_DISTRIBUTION_CHANNEL="PSDocker-WindowsServerCore-${fromTag}"

# Copy PowerShell Core from the installer container
COPY --from=installer-env ["\\PowerShell\\", "$ProgramFiles\\PowerShell\\latest"]
Expand Down

0 comments on commit 8da8107

Please sign in to comment.