Skip to content

Commit e00b38f

Browse files
authored
Add images for Debian12 (#755)
1 parent 44a656a commit e00b38f

File tree

10 files changed

+322
-2
lines changed

10 files changed

+322
-2
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# Docker image file that describes an Debian image with PowerShell installed from Microsoft APT Repo
5+
ARG hostRegistry=psdockercache.azurecr.io
6+
FROM ${hostRegistry}/debian:bookworm AS installer-env
7+
8+
# Define Args for the needed to add the package
9+
ARG PS_VERSION=7.3.1
10+
ARG PS_PACKAGE=powershell-preview_${PS_VERSION}-1.deb_amd64.deb
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+
# Define the folder we will be installing PowerShell to.
15+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/${PS_INSTALL_VERSION}
16+
17+
# Create the install folder.
18+
RUN mkdir -p ${PS_INSTALL_FOLDER}
19+
20+
RUN --mount=type=cache,target=/var/lib/apt \
21+
--mount=type=cache,target=/var/cache/apt \
22+
apt-get update \
23+
&& apt-get install --no-install-recommends -y \
24+
# curl is required to grab the Linux package
25+
curl \
26+
tar \
27+
# less is required for help in powershell
28+
less \
29+
# requied to setup the locale
30+
locales \
31+
# required for SSL
32+
ca-certificates \
33+
# Download the Linux package and save it
34+
&& echo ${PS_PACKAGE_URL} \
35+
&& curl -sSL ${PS_PACKAGE_URL} -o /tmp/powershell.deb
36+
37+
# Install the deb file in this image and make powershell available
38+
ARG hostRegistry=psdockercache.azurecr.io
39+
FROM ${hostRegistry}/debian:bookworm AS final-image
40+
41+
# # Define args needed to add the package
42+
ARG PS_VERSION=7.3.1
43+
ARG PS_PACKAGE=powershell-preview_${PS_VERSION}-1.deb_amd64.deb
44+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
45+
ARG PS_INSTALL_VERSION=7
46+
47+
# Define ENVs for Localization/Globalization
48+
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
49+
LC_ALL=en_US.UTF-8 \
50+
LANG=en_US.UTF-8 \
51+
PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
52+
# set a fixed location for the Module analysis cache
53+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
54+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Debian-12
55+
56+
# Install dependencies and clean up
57+
RUN --mount=from=installer-env,target=/mnt/pwsh,source=/tmp \
58+
--mount=type=cache,target=/var/lib/apt \
59+
--mount=type=cache,target=/var/cache/apt \
60+
apt-get update \
61+
&& apt-get install --no-install-recommends -y /mnt/pwsh/powershell.deb \
62+
&& apt-get install --no-install-recommends -y \
63+
# less is required for help in powershell
64+
less \
65+
# requied to setup the locale
66+
locales \
67+
# required for SSL
68+
ca-certificates \
69+
gss-ntlmssp \
70+
libicu72 \
71+
libssl3 \
72+
libc6 \
73+
libgcc-s1 \
74+
libgssapi-krb5-2 \
75+
liblttng-ust1 \
76+
libstdc++6 \
77+
zlib1g \
78+
# PowerShell remoting over SSH dependencies
79+
openssh-client \
80+
&& apt-get dist-upgrade -y \
81+
&& locale-gen $LANG && update-locale \
82+
&& export POWERSHELL_TELEMETRY_OPTOUT=1 \
83+
# Give all user execute permissions and remove write permissions for others
84+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
85+
# Create the pwsh symbolic link that points to powershell
86+
&& ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
87+
&& pwsh \
88+
-NoLogo \
89+
-NoProfile \
90+
-Command " \
91+
\$ErrorActionPreference = 'Stop' ; \
92+
\$ProgressPreference = 'SilentlyContinue' ; \
93+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
94+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
95+
Start-Sleep -Seconds 6 ; \
96+
}"
97+
98+
# Use PowerShell as the default shell
99+
# Use array to avoid Docker prepending /bin/sh -c
100+
CMD [ "pwsh" ]

release/7-3/debian12/meta.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion" : false,
4+
"PackageFormat": "powershell${channelTag}_${PS_VERSION}-1.deb_amd64.deb",
5+
"osVersion": "Debian 12",
6+
"SkipGssNtlmSspTests": false,
7+
"ShortDistroName": "debian",
8+
"shortTags": [
9+
{"Tag": "bookworm"},
10+
{"Tag": "12"}
11+
],
12+
"SubImage": "test-deps",
13+
"TestProperties": {
14+
"size": 490
15+
},
16+
"EndOfLife": "2025-12-25",
17+
"DistributionState": "Validating"
18+
}
19+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Docker image file that describes an Debian image with PowerShell and test dependencies
2+
ARG BaseImage=mcr.microsoft.com/powershell:preview-debian-12
3+
4+
FROM ${BaseImage}
5+
6+
# Install dependencies and clean up
7+
RUN --mount=type=cache,target=/var/lib/apt/lists \
8+
apt-get update \
9+
&& apt-get install --no-install-recommends -y \
10+
sudo \
11+
curl \
12+
wget \
13+
iputils-ping \
14+
iputils-tracepath \
15+
procps \
16+
git \
17+
unzip \
18+
&& apt-get clean
19+
20+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Debian-12
21+
22+
# Use PowerShell as the default shell
23+
# Use array to avoid Docker prepending /bin/sh -c
24+
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+
"osVersion": "Debian 12 (Testing)",
5+
"tagTemplates": [
6+
"debian-#shorttag#"
7+
],
8+
"SubRepository": "test-deps",
9+
"OptionalTests": [
10+
"test-deps",
11+
"test-deps-debian"
12+
],
13+
"TestProperties": {
14+
"size": 490
15+
}
16+
}

release/7-3/mariner2/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"ShortDistroName": "mariner",
1010
"SubImage": "test-deps",
1111
"TestProperties": {
12-
"size": 303
12+
"size": 332
1313
},
1414
"EndOfLife": "2022-10-14",
1515
"DistributionState": "Validated"
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# Docker image file that describes an Debian image with PowerShell installed from Microsoft APT Repo
5+
ARG hostRegistry=psdockercache.azurecr.io
6+
FROM ${hostRegistry}/debian:bookworm 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-preview_${PS_VERSION}-1.deb_amd64.deb
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+
# Define the folder we will be installing PowerShell to.
15+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/${PS_INSTALL_VERSION}
16+
17+
# Create the install folder.
18+
RUN mkdir -p ${PS_INSTALL_FOLDER}
19+
20+
RUN --mount=type=cache,target=/var/lib/apt \
21+
--mount=type=cache,target=/var/cache/apt \
22+
apt-get update \
23+
&& apt-get install --no-install-recommends -y \
24+
# curl is required to grab the Linux package
25+
curl \
26+
tar \
27+
# less is required for help in powershell
28+
less \
29+
# requied to setup the locale
30+
locales \
31+
# required for SSL
32+
ca-certificates \
33+
# Download the Linux package and save it
34+
&& echo ${PS_PACKAGE_URL} \
35+
&& curl -sSL ${PS_PACKAGE_URL} -o /tmp/powershell.deb
36+
37+
# Install the deb file in this image and make powershell available
38+
ARG hostRegistry=psdockercache.azurecr.io
39+
FROM ${hostRegistry}/debian:bookworm AS final-image
40+
41+
# # Define args needed to add the package
42+
ARG PS_VERSION=7.3.0-preview.8
43+
ARG PS_PACKAGE=powershell-preview_${PS_VERSION}-1.deb_amd64.deb
44+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
45+
ARG PS_INSTALL_VERSION=7-preview
46+
47+
# Define ENVs for Localization/Globalization
48+
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
49+
LC_ALL=en_US.UTF-8 \
50+
LANG=en_US.UTF-8 \
51+
PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
52+
# set a fixed location for the Module analysis cache
53+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
54+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Debian-12
55+
56+
# Install dependencies and clean up
57+
RUN --mount=from=installer-env,target=/mnt/pwsh,source=/tmp \
58+
--mount=type=cache,target=/var/lib/apt \
59+
--mount=type=cache,target=/var/cache/apt \
60+
apt-get update \
61+
&& apt-get install --no-install-recommends -y /mnt/pwsh/powershell.deb \
62+
&& apt-get install --no-install-recommends -y \
63+
# less is required for help in powershell
64+
less \
65+
# requied to setup the locale
66+
locales \
67+
# required for SSL
68+
ca-certificates \
69+
gss-ntlmssp \
70+
libicu72 \
71+
libssl3 \
72+
libc6 \
73+
libgcc-s1 \
74+
libgssapi-krb5-2 \
75+
liblttng-ust1 \
76+
libstdc++6 \
77+
zlib1g \
78+
# PowerShell remoting over SSH dependencies
79+
openssh-client \
80+
&& apt-get dist-upgrade -y \
81+
&& locale-gen $LANG && update-locale \
82+
&& export POWERSHELL_TELEMETRY_OPTOUT=1 \
83+
# Give all user execute permissions and remove write permissions for others
84+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
85+
# Create the pwsh symbolic link that points to powershell
86+
&& ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
87+
# Create the pwsh-preview symbolic link that points to powershell
88+
&& ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \
89+
&& pwsh \
90+
-NoLogo \
91+
-NoProfile \
92+
-Command " \
93+
\$ErrorActionPreference = 'Stop' ; \
94+
\$ProgressPreference = 'SilentlyContinue' ; \
95+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
96+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
97+
Start-Sleep -Seconds 6 ; \
98+
}"
99+
100+
# Use PowerShell as the default shell
101+
# Use array to avoid Docker prepending /bin/sh -c
102+
CMD [ "pwsh-preview" ]

release/7-4/debian12/meta.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion" : false,
4+
"PackageFormat": "powershell${channelTag}_${PS_VERSION}-1.deb_amd64.deb",
5+
"osVersion": "Debian 12",
6+
"SkipGssNtlmSspTests": false,
7+
"ShortDistroName": "debian",
8+
"shortTags": [
9+
{"Tag": "bookworm"},
10+
{"Tag": "12"}
11+
],
12+
"SubImage": "test-deps",
13+
"TestProperties": {
14+
"size": 490
15+
},
16+
"EndOfLife": "2025-12-25",
17+
"DistributionState": "Validating"
18+
}
19+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Docker image file that describes an Debian image with PowerShell and test dependencies
2+
ARG BaseImage=mcr.microsoft.com/powershell:preview-debian-12
3+
4+
FROM ${BaseImage}
5+
6+
# Install dependencies and clean up
7+
RUN --mount=type=cache,target=/var/lib/apt/lists \
8+
apt-get update \
9+
&& apt-get install --no-install-recommends -y \
10+
sudo \
11+
curl \
12+
wget \
13+
iputils-ping \
14+
iputils-tracepath \
15+
procps \
16+
git \
17+
unzip \
18+
&& apt-get clean
19+
20+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Debian-12
21+
22+
# Use PowerShell as the default shell
23+
# Use array to avoid Docker prepending /bin/sh -c
24+
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+
"osVersion": "Debian 12 (Testing)",
5+
"tagTemplates": [
6+
"debian-#shorttag#"
7+
],
8+
"SubRepository": "test-deps",
9+
"OptionalTests": [
10+
"test-deps",
11+
"test-deps-debian"
12+
],
13+
"TestProperties": {
14+
"size": 490
15+
}
16+
}

release/7-4/mariner2/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"ShortDistroName": "mariner",
1010
"SubImage": "test-deps",
1111
"TestProperties": {
12-
"size": 303
12+
"size": 335
1313
},
1414
"EndOfLife": "2022-10-14",
1515
"DistributionState": "Validated"

0 commit comments

Comments
 (0)