Skip to content

Commit 00d8b77

Browse files
authored
Add support for Azurelinux3.0 (#829)
* initial commit for azurelinux 3.0 support * add docker images for azure linux 3.0 and azure linux 3.0 arm64 * fix shortDistroName for azurelinux3-arm64 * update PSVersion * use aarch rpm package and get latest dotnet version * add 7-4 images for azurelinux3 and azurelinux3-arm64 * 7-4 images should use stable package url
1 parent ed13cb9 commit 00d8b77

File tree

8 files changed

+450
-0
lines changed

8 files changed

+450
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
FROM --platform=linux/arm64 mcr.microsoft.com/azurelinux/base/core:3.0 AS setup-tdnf-repa
5+
6+
RUN --mount=type=cache,target=/var/cache/tdnf \
7+
tdnf install -y azurelinux-repos \
8+
&& tdnf makecache
9+
10+
# Download packages into a container so they don't take up space in the final stage
11+
FROM setup-tdnf-repa AS installer-env
12+
13+
# Define Args for the needed to add the package
14+
ARG PS_VERSION=7.4.5
15+
ARG PACKAGE_VERSION=7.4.5
16+
ARG PS_PACKAGE=powershell-${PACKAGE_VERSION}-1.cm.aarch64.rpm
17+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
18+
ARG PS_INSTALL_VERSION=7
19+
20+
# Download the Linux tar.gz and save it
21+
ADD ${PS_PACKAGE_URL} /tmp/powershell.rpm
22+
23+
# Don't use the cache mount since this image doesn't go into the final product and it causes issues with parralel operations with the next layer
24+
RUN tdnf install -y \
25+
wget \
26+
awk \
27+
tar \
28+
ca-certificates
29+
30+
RUN echo ${PS_PACKAGE_URL}
31+
32+
# Start a new stage so we lose all the package download layers from the final image
33+
FROM setup-tdnf-repa AS powershell
34+
35+
ARG PS_VERSION=7.4.5
36+
ARG PS_INSTALL_VERSION=7
37+
38+
# Define Args and Env needed to create links
39+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
40+
\
41+
# Define ENVs for Localization/Globalization
42+
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
43+
LC_ALL=en_US.UTF-8 \
44+
LANG=en_US.UTF-8 \
45+
# set a fixed location for the Module analysis cache
46+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
47+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-AzureLinux-3.0
48+
49+
RUN --mount=type=cache,target=/var/cache/tdnf \
50+
# install dependencies
51+
tdnf install -y \
52+
# required for localization
53+
icu \
54+
# required for help in PowerShell
55+
less \
56+
# required for SSH
57+
openssh-clients \
58+
dotnet-runtime-8.0 \
59+
ca-certificates
60+
61+
# Install dependencies and clean up
62+
RUN --mount=type=cache,target=/var/cache/tdnf \
63+
tdnf upgrade -y \
64+
# clean cached data
65+
&& tdnf clean all
66+
67+
RUN --mount=type=cache,target=/var/cache/tdnf,rw \
68+
--mount=from=installer-env,target=/mnt/rpm,source=/tmp \
69+
rpm -i --nodeps /mnt/rpm/powershell.rpm
70+
71+
# Create the pwsh symbolic link that points to powershell
72+
RUN if [ -f "/opt/microsoft/powershell/7/pwsh" ]; then ln -sf /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh; fi
73+
74+
# intialize powershell module cache
75+
# and disable telemetry for this ONE session
76+
RUN export POWERSHELL_TELEMETRY_OPTOUT=1 \
77+
&& pwsh \
78+
-NoLogo \
79+
-NoProfile \
80+
-Command " \
81+
\$ErrorActionPreference = 'Stop' ; \
82+
\$ProgressPreference = 'SilentlyContinue' ; \
83+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
84+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
85+
Start-Sleep -Seconds 6 ; \
86+
}"
87+
88+
# Use PowerShell as the default shell
89+
# Use array to avoid Docker prepending /bin/sh -c
90+
CMD [ "pwsh" ]
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-${PS_VERSION}-1.cm.aarch64.rpm",
5+
"osVersion": "Azure Linux 3.0 ARM 64v7",
6+
"SkipGssNtlmSspTests": true,
7+
"ShortDistroName": "azurelinux",
8+
"shortTags": [
9+
{"Tag": "3.0-arm64"}
10+
],
11+
"TestProperties": {
12+
"size": 404,
13+
"Arm32": true
14+
},
15+
"EndOfLife": "2025-12-14",
16+
"DistributionState": "Validated",
17+
"UseInCi": false,
18+
"Architecture": "arm64"
19+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS setup-tdnf-repa
5+
6+
# Use the cache mount since this image does go into the final product
7+
RUN --mount=type=cache,target=/var/cache/tdnf \
8+
tdnf install -y azurelinux-repos \
9+
&& tdnf makecache
10+
11+
# Download packages into a container so they don't take up space in the final stage
12+
FROM setup-tdnf-repa AS installer-env
13+
14+
# Define Args for the needed to add the package
15+
ARG PS_VERSION=7.4.5
16+
ARG PACKAGE_VERSION=7.4.5
17+
ARG PS_PACKAGE=powershell-${PACKAGE_VERSION}-1.cm.x86_64.rpm
18+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
19+
ARG PS_INSTALL_VERSION=7
20+
21+
# Download the Linux tar.gz and save it
22+
ADD ${PS_PACKAGE_URL} /tmp/powershell.rpm
23+
24+
# Don't use the cache mount since this image doesn't go into the final product and it causes issues with parralel operations with the next layer
25+
RUN tdnf install -y \
26+
wget \
27+
awk \
28+
tar \
29+
ca-certificates
30+
31+
RUN echo ${PS_PACKAGE_URL}
32+
33+
# Start a new stage so we lose all the package download layers from the final image
34+
FROM setup-tdnf-repa AS powershell
35+
36+
ARG PS_VERSION=7.4.0
37+
38+
# Define Args and Env needed to create links
39+
ARG PS_INSTALL_VERSION=7
40+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
41+
\
42+
# Define ENVs for Localization/Globalization
43+
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
44+
LC_ALL=en_US.UTF-8 \
45+
LANG=en_US.UTF-8 \
46+
# set a fixed location for the Module analysis cache
47+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
48+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-AzureLinux-3.0
49+
50+
RUN --mount=type=cache,target=/var/cache/tdnf \
51+
# install dependencies
52+
tdnf install -y \
53+
# required for localization
54+
icu \
55+
# required for help in PowerShell
56+
less \
57+
# required for SSH
58+
openssh-clients \
59+
dotnet-runtime-8.0 \
60+
ca-certificates
61+
62+
# Install dependencies and clean up
63+
RUN --mount=type=cache,target=/var/cache/tdnf \
64+
tdnf upgrade -y \
65+
# clean cached data
66+
&& tdnf clean all
67+
68+
RUN --mount=type=cache,target=/var/cache/tdnf,rw \
69+
--mount=from=installer-env,target=/mnt/rpm,source=/tmp \
70+
rpm -i --nodeps /mnt/rpm/powershell.rpm
71+
72+
# Create the pwsh symbolic link that points to powershell
73+
RUN if [ -f "/opt/microsoft/powershell/7/pwsh" ]; then ln -sf /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh; fi
74+
75+
# intialize powershell module cache
76+
# and disable telemetry for this ONE session
77+
RUN export POWERSHELL_TELEMETRY_OPTOUT=1 \
78+
&& pwsh \
79+
-NoLogo \
80+
-NoProfile \
81+
-Command " \
82+
\$ErrorActionPreference = 'Stop' ; \
83+
\$ProgressPreference = 'SilentlyContinue' ; \
84+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
85+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
86+
Start-Sleep -Seconds 6 ; \
87+
}"
88+
89+
# Use PowerShell as the default shell
90+
# Use array to avoid Docker prepending /bin/sh -c
91+
CMD [ "pwsh" ]

release/7-4/azurelinux3/meta.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"IsLinux" : true,
3+
"PackageFormat": "powershell${channelTag}-${PS_VERSION}-1.cm.x86_64.rpm",
4+
"SkipGssNtlmSspTests": true,
5+
"osVersion": "Azure Linux 3.0",
6+
"shortTags": [
7+
{"Tag": "3.0"}
8+
],
9+
"ShortDistroName": "azurelinux",
10+
"TestProperties": {
11+
"size": 335
12+
},
13+
"EndOfLife": "2025-10-14",
14+
"DistributionState": "Validated"
15+
}
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+
FROM --platform=linux/arm64 mcr.microsoft.com/azurelinux/base/core:3.0 AS setup-tdnf-repa
5+
6+
RUN --mount=type=cache,target=/var/cache/tdnf \
7+
tdnf install -y azurelinux-repos \
8+
&& tdnf makecache
9+
10+
# Download packages into a container so they don't take up space in the final stage
11+
FROM setup-tdnf-repa AS installer-env
12+
13+
# Define Args for the needed to add the package
14+
ARG PS_VERSION=7.5.0-preview.5
15+
ARG PACKAGE_VERSION=7.5.0_preview.5
16+
ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.cm.aarch64.rpm
17+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
18+
ARG PS_INSTALL_VERSION=7-preview
19+
20+
# Download the Linux tar.gz and save it
21+
ADD ${PS_PACKAGE_URL} /tmp/powershell.rpm
22+
23+
# Don't use the cache mount since this image doesn't go into the final product and it causes issues with parralel operations with the next layer
24+
RUN tdnf install -y \
25+
wget \
26+
awk \
27+
tar \
28+
ca-certificates
29+
30+
RUN --mount=type=cache,target=/var/cache/tdnf \
31+
--mount=type=cache,target=/installTmp \
32+
cd /installTmp \
33+
&& wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \
34+
&& chmod +x ./dotnet-install.sh \
35+
&& ./dotnet-install.sh -Channel 9.0 -Quality ga -Runtime dotnet -InstallDir /usr/share/dotnet
36+
37+
RUN echo ${PS_PACKAGE_URL}
38+
39+
# Start a new stage so we lose all the package download layers from the final image
40+
FROM setup-tdnf-repa AS powershell
41+
42+
ARG PS_VERSION=7.5.0-preview.5
43+
ARG PS_INSTALL_VERSION=7-preview
44+
45+
# Define Args and Env needed to create links
46+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
47+
\
48+
# Define ENVs for Localization/Globalization
49+
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
50+
LC_ALL=en_US.UTF-8 \
51+
LANG=en_US.UTF-8 \
52+
# set a fixed location for the Module analysis cache
53+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
54+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-arm64v7-AzureLinux-3
55+
56+
RUN --mount=type=cache,target=/var/cache/tdnf \
57+
# install dependencies
58+
tdnf install -y \
59+
# required for localization
60+
icu \
61+
# required for help in PowerShell
62+
less \
63+
# required for SSH
64+
openssh-clients \
65+
ca-certificates
66+
67+
# Install dependencies and clean up
68+
RUN --mount=type=cache,target=/var/cache/tdnf \
69+
tdnf upgrade -y \
70+
# clean cached data
71+
&& tdnf clean all
72+
73+
COPY --from=installer-env /usr/share/dotnet /usr/share/dotnet
74+
75+
RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
76+
77+
RUN --mount=type=cache,target=/var/cache/tdnf,rw \
78+
--mount=from=installer-env,target=/mnt/rpm,source=/tmp \
79+
rpm -i --nodeps /mnt/rpm/powershell.rpm
80+
81+
# Create the pwsh symbolic link that points to powershell
82+
RUN if [ -f "/opt/microsoft/powershell/7-preview/pwsh" ]; then ln -sf /opt/microsoft/powershell/7-preview/pwsh /usr/bin/pwsh; fi
83+
84+
# intialize powershell module cache
85+
# and disable telemetry for this ONE session
86+
RUN export POWERSHELL_TELEMETRY_OPTOUT=1 \
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" ]
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.cm.aarch64.rpm",
5+
"osVersion": "Azure Linux 3.0 ARM 64v7",
6+
"SkipGssNtlmSspTests": true,
7+
"ShortDistroName": "azurelinux",
8+
"shortTags": [
9+
{"Tag": "3.0-arm64"}
10+
],
11+
"TestProperties": {
12+
"size": 404,
13+
"Arm32": true
14+
},
15+
"EndOfLife": "2025-12-14",
16+
"DistributionState": "Validated",
17+
"UseInCi": false,
18+
"Architecture": "arm64"
19+
}

0 commit comments

Comments
 (0)