Skip to content

Commit cfe33e8

Browse files
anamnaviharryzcy
authored andcommitted
Add distribution images for powershell 7-6 release folder (#842)
1 parent 04da5be commit cfe33e8

File tree

49 files changed

+2037
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2037
-1
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# Docker image file that describes an Alpine image with PowerShell installed from .tar.gz file(s)
5+
ARG hostRegistry=psdockercache.azurecr.io
6+
FROM ${hostRegistry}/alpine:3.17 AS installer-env
7+
8+
# Define Args for the needed to add the package
9+
ARG PS_VERSION=7.3.0-preview.8
10+
ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-musl-x64.tar.gz
11+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
12+
ARG PS_INSTALL_VERSION=7-preview
13+
14+
# Download the Linux tar.gz and save it
15+
ADD ${PS_PACKAGE_URL} /tmp/linux.tar.gz
16+
17+
# define the folder we will be installing PowerShell to
18+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION
19+
20+
# Create the install folder
21+
RUN mkdir -p ${PS_INSTALL_FOLDER}
22+
23+
# Unzip the Linux tar.gz
24+
RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v
25+
26+
# Start a new stage so we lose all the tar.gz layers from the final image
27+
ARG hostRegistry=psdockercache.azurecr.io
28+
FROM ${hostRegistry}/alpine:3.17
29+
30+
# Copy only the files we need from the previous stage
31+
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
32+
33+
# Define Args and Env needed to create links
34+
ARG PS_INSTALL_VERSION=7-preview
35+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
36+
\
37+
# Define ENVs for Localization/Globalization
38+
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
39+
LC_ALL=en_US.UTF-8 \
40+
LANG=en_US.UTF-8 \
41+
# set a fixed location for the Module analysis cache
42+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
43+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Alpine-3.17
44+
45+
# Install dotnet dependencies and ca-certificates
46+
RUN apk add --no-cache \
47+
ca-certificates \
48+
less \
49+
\
50+
# PSReadline/console dependencies
51+
ncurses-terminfo-base \
52+
\
53+
# .NET Core dependencies
54+
krb5-libs \
55+
libgcc \
56+
libintl \
57+
libssl1.1 \
58+
libstdc++ \
59+
tzdata \
60+
userspace-rcu \
61+
zlib \
62+
icu-libs \
63+
&& apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \
64+
lttng-ust \
65+
\
66+
# PowerShell remoting over SSH dependencies
67+
openssh-client \
68+
\
69+
&& apk update \
70+
&& apk upgrade \
71+
# Create the pwsh symbolic link that points to powershell
72+
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
73+
\
74+
# Create the pwsh-preview symbolic link that points to powershell
75+
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \
76+
# Give all user execute permissions and remove write permissions for others
77+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
78+
# intialize powershell module cache
79+
# and disable telemetry
80+
&& export POWERSHELL_TELEMETRY_OPTOUT=1 \
81+
&& pwsh \
82+
-NoLogo \
83+
-NoProfile \
84+
-Command " \
85+
\$ErrorActionPreference = 'Stop' ; \
86+
\$ProgressPreference = 'SilentlyContinue' ; \
87+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
88+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
89+
Start-Sleep -Seconds 6 ; \
90+
}"
91+
92+
CMD [ "pwsh" ]

release/7-6/alpine317/meta.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"PackageFormat": "powershell-${PS_VERSION}-linux-musl-x64.tar.gz",
5+
"osVersion": "Alpine 3.17",
6+
"shortDistroName": "alpine",
7+
"shortTags": [
8+
{"Tag": "3.17"}
9+
],
10+
"SkipGssNtlmSspTests": true,
11+
"SubImage": "test-deps",
12+
"TestProperties": {
13+
"size": 252
14+
},
15+
"EndOfLife": "2023-11-01",
16+
"DistributionState": "Validating",
17+
"manifestLists": [
18+
"${channelTagPrefix}alpine"
19+
],
20+
"UseInCi": false
21+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Docker image file that describes an Alpine image with PowerShell and test dependencies
2+
3+
ARG BaseImage=mcr.microsoft.com/powershell:alpine-3.17
4+
5+
FROM ${BaseImage}
6+
7+
ENV NODE_VERSION=14.17.6 \
8+
YARN_VERSION=1.22.5 \
9+
NVM_DIR="/root/.nvm" \
10+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-3.17
11+
12+
# workaround for Alpine to run in Azure DevOps
13+
ENV NODE_NO_WARNINGS=1
14+
15+
RUN apk add --no-cache --virtual .pipeline-deps readline linux-pam \
16+
&& apk add --no-cache \
17+
bash \
18+
sudo \
19+
shadow \
20+
openssl \
21+
curl \
22+
git \
23+
unzip \
24+
musl \
25+
musl-locales \
26+
nodejs \
27+
&& apk update \
28+
&& apk upgrade \
29+
&& apk del .pipeline-deps \
30+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
31+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg
32+
33+
LABEL com.azure.dev.pipelines.agent.handler.node.path="/usr/local/bin/node"
34+
35+
# Use PowerShell as the default shell
36+
# Use array to avoid Docker prepending /bin/sh -c
37+
CMD [ "pwsh" ]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"SkipGssNtlmSspTests": true,
5+
"osVersion": "Alpine 3.17",
6+
"tagTemplates": [
7+
"alpine-#shorttag#"
8+
],
9+
"OptionalTests": [
10+
"test-deps",
11+
"test-deps-musl"
12+
],
13+
"TestProperties": {
14+
"size": 335
15+
}
16+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# Docker image file that describes an Alpine image with PowerShell installed from .tar.gz file(s)
5+
ARG hostRegistry=psdockercache.azurecr.io
6+
FROM ${hostRegistry}/alpine:3.20 AS installer-env
7+
8+
# Define Args for the needed to add the package
9+
ARG PS_VERSION=7.5.0-preview.5
10+
ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-musl-x64.tar.gz
11+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
12+
ARG PS_INSTALL_VERSION=7-preview
13+
14+
# Download the Linux tar.gz and save it
15+
ADD ${PS_PACKAGE_URL} /tmp/linux.tar.gz
16+
17+
# define the folder we will be installing PowerShell to
18+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION
19+
20+
# Create the install folder
21+
RUN mkdir -p ${PS_INSTALL_FOLDER}
22+
23+
# Unzip the Linux tar.gz
24+
RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v
25+
26+
# Start a new stage so we lose all the tar.gz layers from the final image
27+
ARG hostRegistry=psdockercache.azurecr.io
28+
FROM ${hostRegistry}/alpine:3.20
29+
30+
# Copy only the files we need from the previous stage
31+
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
32+
33+
# Define Args and Env needed to create links
34+
ARG PS_INSTALL_VERSION=7-preview
35+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
36+
\
37+
# Define ENVs for Localization/Globalization
38+
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
39+
LC_ALL=en_US.UTF-8 \
40+
LANG=en_US.UTF-8 \
41+
# set a fixed location for the Module analysis cache
42+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
43+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Alpine-3.20
44+
45+
# Install dotnet dependencies and ca-certificates
46+
RUN apk add --no-cache \
47+
ca-certificates \
48+
less \
49+
\
50+
# PSReadline/console dependencies
51+
ncurses-terminfo-base \
52+
\
53+
# .NET Core dependencies
54+
krb5-libs \
55+
libgcc \
56+
libintl \
57+
libssl3 \
58+
libstdc++ \
59+
tzdata \
60+
userspace-rcu \
61+
zlib \
62+
icu-libs \
63+
&& apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \
64+
lttng-ust \
65+
\
66+
# PowerShell remoting over SSH dependencies
67+
openssh-client \
68+
\
69+
&& apk update \
70+
&& apk upgrade \
71+
# Create the pwsh symbolic link that points to powershell
72+
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
73+
\
74+
# Create the pwsh-preview symbolic link that points to powershell
75+
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \
76+
# Give all user execute permissions and remove write permissions for others
77+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
78+
# intialize powershell module cache
79+
# and disable telemetry
80+
&& export POWERSHELL_TELEMETRY_OPTOUT=1 \
81+
&& pwsh \
82+
-NoLogo \
83+
-NoProfile \
84+
-Command " \
85+
\$ErrorActionPreference = 'Stop' ; \
86+
\$ProgressPreference = 'SilentlyContinue' ; \
87+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
88+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
89+
Start-Sleep -Seconds 6 ; \
90+
}"
91+
92+
CMD [ "pwsh" ]

release/7-6/alpine320/meta.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"PackageFormat": "powershell-${PS_VERSION}-linux-musl-x64.tar.gz",
5+
"osVersion": "Alpine 3.20",
6+
"shortDistroName": "alpine",
7+
"shortTags": [
8+
{"Tag": "3.20"}
9+
],
10+
"SkipGssNtlmSspTests": true,
11+
"SubImage": "test-deps",
12+
"TestProperties": {
13+
"size": 252
14+
},
15+
"EndOfLife": "2025-11-01",
16+
"DistributionState": "Validating",
17+
"manifestLists": [
18+
"${channelTagPrefix}alpine"
19+
],
20+
"UseInCi": false
21+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Docker image file that describes an Alpine image with PowerShell and test dependencies
2+
3+
ARG BaseImage=mcr.microsoft.com/powershell:alpine-3.20
4+
5+
FROM ${BaseImage}
6+
7+
ENV NODE_VERSION=14.17.6 \
8+
YARN_VERSION=1.22.5 \
9+
NVM_DIR="/root/.nvm" \
10+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-3.20
11+
12+
# workaround for Alpine to run in Azure DevOps
13+
ENV NODE_NO_WARNINGS=1
14+
15+
RUN apk add --no-cache --virtual .pipeline-deps readline linux-pam \
16+
&& apk add --no-cache \
17+
bash \
18+
sudo \
19+
shadow \
20+
openssl \
21+
curl \
22+
git \
23+
unzip \
24+
musl \
25+
musl-locales \
26+
nodejs \
27+
&& apk update \
28+
&& apk upgrade \
29+
&& apk del .pipeline-deps \
30+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
31+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg
32+
33+
LABEL com.azure.dev.pipelines.agent.handler.node.path="/usr/local/bin/node"
34+
35+
# Use PowerShell as the default shell
36+
# Use array to avoid Docker prepending /bin/sh -c
37+
CMD [ "pwsh" ]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"IsLinux": true,
3+
"UseLinuxVersion": false,
4+
"SkipGssNtlmSspTests": true,
5+
"osVersion": "Alpine 3.20",
6+
"tagTemplates": [
7+
"alpine-#shorttag#"
8+
],
9+
"OptionalTests": [
10+
"test-deps",
11+
"test-deps-musl"
12+
],
13+
"TestProperties": {
14+
"size": 335
15+
}
16+
}

0 commit comments

Comments
 (0)