Skip to content

Commit 8da8107

Browse files
adityapatwardhanTravisEz13
authored andcommitted
Add POWERSHELL_DISTRIBUTION_CHANNEL environment variable (#256)
1 parent 954b662 commit 8da8107

File tree

26 files changed

+160
-23
lines changed

26 files changed

+160
-23
lines changed

.dependabot/config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ update_configs:
3434
- package_manager: "docker"
3535
directory: "/release/preview/windowsservercore/dependabot"
3636
update_schedule: "daily"
37+
38+
- package_manager: "docker"
39+
directory: "/release/preview/alpine38/dependabot"
40+
update_schedule: "daily"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM node:10.15.3-alpine

release/preview/alpine38/docker/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
4242
LC_ALL=en_US.UTF-8 \
4343
LANG=en_US.UTF-8 \
4444
# set a fixed location for the Module analysis cache
45-
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
45+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
46+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Alpine-3.8
4647

4748
# Install dotnet dependencies and ca-certificates
4849
RUN apk add --no-cache \

release/preview/alpine38/test-deps/docker/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ FROM node:10.15.3-alpine as node
88

99
FROM ${BaseImage}
1010

11-
ENV NODE_VERSION 10.15.3
12-
ENV YARN_VERSION=1.13.0
13-
ENV NVM_DIR="/root/.nvm"
11+
ENV NODE_VERSION=10.15.3 \
12+
YARN_VERSION=1.13.0 \
13+
NVM_DIR="/root/.nvm" \
14+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-3.8
1415

1516
# workaround for Alpine to run in Azure DevOps
1617
ENV NODE_NO_WARNINGS=1

release/preview/alpine39/docker/Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v
3030
# Start a new stage so we lose all the tar.gz layers from the final image
3131
FROM ${imageRepo}:${fromTag}
3232

33+
ARG fromTag=3.9
34+
3335
# Copy only the files we need from the previous stage
3436
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
3537

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

4750
# Install dotnet dependencies and ca-certificates
4851
RUN apk add --no-cache \

release/preview/alpine39/test-deps/docker/Dockerfile

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ FROM node:10.15.3-alpine as node
88

99
FROM ${BaseImage}
1010

11-
ENV NODE_VERSION 10.15.3
12-
ENV YARN_VERSION=1.13.0
13-
ENV NVM_DIR="/root/.nvm"
11+
ARG fromTag=3.9
12+
13+
ENV NODE_VERSION=10.15.3 \
14+
YARN_VERSION=1.13.0 \
15+
NVM_DIR="/root/.nvm" \
16+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-${fromTag}
1417

1518
# workaround for Alpine to run in Azure DevOps
1619
ENV NODE_NO_WARNINGS=1

release/preview/centos7/docker/Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ ARG PACKAGE_VERSION=6.2.0_preview.2
99
ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.rhel.7.x86_64.rpm
1010
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
1111

12+
ARG fromTag=7
13+
ARG imageRepo=centos
14+
1215
# Define ENVs for Localization/Globalization
1316
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
1417
LC_ALL=en_US.UTF-8 \
1518
LANG=en_US.UTF-8 \
1619
# set a fixed location for the Module analysis cache
17-
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
20+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
21+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-CentOS-${fromTag}
1822

1923
# Install dependencies and clean up
2024
RUN curl -sSL ${PS_PACKAGE_URL} -o /tmp/powershell.rpm \

release/preview/centos7/test-deps/docker/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ RUN yum install -y \
1010
openssl \
1111
&& yum clean all
1212

13+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-CentOS-7
14+
1315
# Define args needed only for the labels
1416
ARG VCS_REF="none"
1517
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:centos-7

release/preview/debian10/docker/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
4040
LC_ALL=en_US.UTF-8 \
4141
LANG=en_US.UTF-8 \
4242
# set a fixed location for the Module analysis cache
43-
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
43+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
44+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Debian-10
4445

4546
# Install dependencies and clean up
4647
RUN apt-get update \

release/preview/debian10/test-deps/docker/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ RUN apt-get update \
1515
&& apt-get clean \
1616
&& rm -rf /var/lib/apt/lists/*
1717

18+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Debian-10
19+
1820
# Define args needed only for the labels
1921
ARG VCS_REF="none"
2022
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:debian-9

release/preview/debian9/docker/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
1717
LC_ALL=en_US.UTF-8 \
1818
LANG=en_US.UTF-8 \
1919
# set a fixed location for the Module analysis cache
20-
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
20+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
21+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Debian-9
2122

2223
# Install dependencies and clean up
2324
RUN apt-get update \

release/preview/debian9/test-deps/docker/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ RUN apt-get update \
1515
&& apt-get clean \
1616
&& rm -rf /var/lib/apt/lists/*
1717

18+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Debian-9
19+
1820
# Define args needed only for the labels
1921
ARG VCS_REF="none"
2022
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:debian-9

release/preview/fedora/docker/Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ ARG PACKAGE_VERSION=6.2.0_preview.2
99
ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.rhel.7.x86_64.rpm
1010
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
1111

12+
ARG fromTag=28
13+
1214
# Define ENVs for Localization/Globalization
1315
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
1416
LC_ALL=en_US.UTF-8 \
1517
LANG=en_US.UTF-8 \
1618
# set a fixed location for the Module analysis cache
17-
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
19+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
20+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Fedora-${fromTag}
1821

1922
# Install dependencies and clean up
2023
RUN curl -sSL ${PS_PACKAGE_URL} -o /tmp/powershell.rpm \

release/preview/fedora/test-deps/docker/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ ARG BaseImage=mcr.microsoft.com/powershell:fedora-28
33

44
FROM ${BaseImage}
55

6+
ARG fromTag=28
7+
68
# Install dependencies and clean up
79
RUN dnf install -y \
810
sudo \
@@ -13,6 +15,8 @@ RUN dnf install -y \
1315
procps-ng \
1416
&& dnf clean all
1517

18+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Fedora-${fromTag}
19+
1620
# Define args needed only for the labels
1721
ARG VCS_REF="none"
1822
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:fedora-28

release/preview/nanoserver/docker/Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ RUN Write-host "Verifying valid Version..."; `
3939
# Install PowerShell into NanoServer
4040
FROM ${NanoServerRepo}:${fromTag}
4141

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

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

release/preview/nanoserver1809/docker/Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ RUN Write-host "Verifying valid Version..."; `
3939
# Install PowerShell into NanoServer
4040
FROM ${NanoServerRepo}:${fromTag}
4141

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

7275
# Set the path
7376
ENV PATH="$WindowsPATH;${ProgramFiles}\PowerShell;"

release/preview/opensuse423/docker/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v
3737
# Start a new stage so we lose all the tar.gz layers from the final image
3838
FROM ${imageRepo}:${fromTag}
3939

40+
ARG fromTag=42.3
41+
4042
# Copy only the files we need from the previous stage
4143
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
4244

@@ -49,8 +51,8 @@ ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
4951
LC_ALL=en_US.UTF-8 \
5052
LANG=en_US.UTF-8 \
5153
# set a fixed location for the Module analysis cache
52-
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
53-
54+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
55+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-OpenSUSE-${fromTag}
5456

5557
# Install dependencies
5658
RUN zypper --non-interactive update --skip-interactive \

release/preview/opensuse423/test-deps/docker/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ ARG BaseImage=mcr.microsoft.com/powershell:opensuse-42.3
33

44
FROM ${BaseImage}
55

6+
ARG fromTag=42.3
7+
68
# Install dependencies and clean up
79
RUN zypper --non-interactive update --skip-interactive \
810
&& zypper --non-interactive install \
@@ -16,6 +18,8 @@ RUN zypper --non-interactive update --skip-interactive \
1618
# remove package manager log file
1719
&& rm -f /var/log/zypp/history /var/log/zypper.log
1820

21+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-OpenSUSE-${fromTag}
22+
1923
# Define args needed only for the labels
2024
ARG VCS_REF="none"
2125
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:centos7

release/preview/ubuntu16.04/docker/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
1717
LC_ALL=en_US.UTF-8 \
1818
LANG=en_US.UTF-8 \
1919
# set a fixed location for the Module analysis cache
20-
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
20+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
21+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Ubuntu-16.04
2122

2223
# Install dependencies and clean up
2324
RUN apt-get update \

release/preview/ubuntu16.04/test-deps/docker/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ RUN apt-get update \
1414
&& apt-get clean \
1515
&& rm -rf /var/lib/apt/lists/*
1616

17+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Ubuntu-16.04
18+
1719
# Define args needed only for the labels
1820
ARG VCS_REF="none"
1921
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:ubuntu-16.04

release/preview/ubuntu18.04/docker/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
1717
LC_ALL=en_US.UTF-8 \
1818
LANG=en_US.UTF-8 \
1919
# set a fixed location for the Module analysis cache
20-
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache
20+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
21+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Ubuntu-18.04
2122

2223
# Install dependencies and clean up
2324
RUN apt-get update \

release/preview/ubuntu18.04/test-deps/docker/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ RUN apt-get update \
1414
&& apt-get clean \
1515
&& rm -rf /var/lib/apt/lists/*
1616

17+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Ubuntu-18.04
18+
1719
# Define args needed only for the labels
1820
ARG VCS_REF="none"
1921
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:ubuntu-18.04

release/preview/windowsservercore/docker/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ ENV ProgramFiles="C:\Program Files" `
3939
LOCALAPPDATA="C:\Users\ContainerAdministrator\AppData\Local" `
4040
PSModuleAnalysisCachePath="$LOCALAPPDATA\Microsoft\Windows\PowerShell\docker\ModuleAnalysisCache" `
4141
# Persist %PSCORE% ENV variable for user convenience
42-
PSCORE="$ProgramFiles\PowerShell\pwsh.exe"
42+
PSCORE="$ProgramFiles\PowerShell\pwsh.exe" `
43+
POWERSHELL_DISTRIBUTION_CHANNEL="PSDocker-WindowsServerCore-${fromTag}"
4344

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

0 commit comments

Comments
 (0)