Skip to content

Commit

Permalink
Add arm64 images for ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
harryzcy committed Oct 16, 2024
1 parent c656f11 commit c941f18
Show file tree
Hide file tree
Showing 8 changed files with 361 additions and 0 deletions.
70 changes: 70 additions & 0 deletions release/7-2/ubuntu22.04-arm64/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

FROM --platform=linux/arm64/v8 ubuntu:jammy AS installer-env

ARG PS_VERSION=7.2.18
ENV PS_PACKAGE=powershell-${PS_VERSION}-linux-arm64.tar.gz
ENV PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
ARG PS_INSTALL_VERSION=7

# define the folder we will be installing PowerShell to
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION

# Create the install folder
RUN mkdir -p ${PS_INSTALL_FOLDER}

ARG PS_PACKAGE_URL_BASE64

RUN apt-get update \
&& apt-get install --no-install-recommends ca-certificates wget --yes

RUN echo 'in task' \
&& if [ -n "${PS_PACKAGE_URL_BASE64}" ]; then \
echo 'using base64' \
&& export url=$(echo "${PS_PACKAGE_URL_BASE64}" | base64 --decode -);\
else \
echo 'using unencoded' \
&& export url="${PS_PACKAGE_URL}"; \
fi \
&& echo "url: $url" \
&& wget -O /tmp/powershell.tar.gz "$url" \
&& echo 'task done'

RUN ls -l /tmp/powershell.tar.gz

# Unzip the Linux tar.gz
RUN tar zxf /tmp/powershell.tar.gz -C ${PS_INSTALL_FOLDER}

FROM --platform=linux/arm64/v8 ubuntu:jammy AS final-image

# Define Args and Env needed to create links
ARG PS_INSTALL_VERSION=7
ARG PS_VERSION=7.2.18

ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
\
# Define ENVs for Localization/Globalization
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 \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-arm64v8-Ubuntu-22.04

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


RUN \
apt-get update \
&& apt-get install --no-install-recommends ca-certificates libunwind8 libssl3 libicu70 less --yes

# Give all user execute permissions and remove write permissions for others
RUN chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
# Create the pwsh symbolic link that points to powershell
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh

# Use PowerShell as the default shell
# Use array to avoid Docker prepending /bin/sh -c
CMD [ "pwsh" ]
29 changes: 29 additions & 0 deletions release/7-2/ubuntu22.04-arm64/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"IsLinux" : true,
"UseLinuxVersion": false,
"PackageFormat": "powershell-${PS_VERSION}-linux-arm64.tar.gz",
"osVersion": "Ubuntu 22.04 ARM 64v8",
"SkipGssNtlmSspTests": true,
"ShortDistroName": "ubuntu",
"Base64EncodePackageUrl": true,
"UseAcr": false,
"tagTemplates": [
"#psversion#-ubuntu-#shorttag#-arm64",
"ubuntu-#shorttag#-arm64"
],
"shortTags": [
{"Tag": "jammy"},
{"Tag": "22.04"}
],
"TestProperties": {
"size": 550,
"Arm64": true
},
"manifestLists": [
"${channelTag}"
],
"EndOfLife": "2023-04-02",
"DistributionState": "Validated",
"UseInCi": false,
"Architecture": "arm64"
}
63 changes: 63 additions & 0 deletions release/7-3/ubuntu22.04-arm64/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.


ARG hostRegistry=psdockercache.azurecr.io
FROM --platform=linux/arm64/v8 ${hostRegistry}/ubuntu:jammy AS installer-env

ARG PS_VERSION=7.3.11
ENV PS_PACKAGE=powershell-${PS_VERSION}-linux-arm64.tar.gz
ENV PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
ARG PS_INSTALL_VERSION=7-preview

# define the folder we will be installing PowerShell to
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION
# Create the install folder
RUN mkdir -p ${PS_INSTALL_FOLDER}
ARG PS_PACKAGE_URL_BASE64
RUN apt-get update \
&& apt-get install --no-install-recommends ca-certificates wget --yes
RUN echo 'in task' \
&& if [ -n "${PS_PACKAGE_URL_BASE64}" ]; then \
echo 'using base64' \
&& export url=$(echo "${PS_PACKAGE_URL_BASE64}" | base64 --decode -);\
else \
echo 'using unencoded' \
&& export url="${PS_PACKAGE_URL}"; \
fi \
&& echo "url: $url" \
&& wget -O /tmp/powershell.tar.gz "$url" \
&& echo 'task done'
RUN ls -l /tmp/powershell.tar.gz
# Unzip the Linux tar.gz
RUN tar zxf /tmp/powershell.tar.gz -C ${PS_INSTALL_FOLDER}

ARG hostRegistry=psdockercache.azurecr.io
FROM --platform=linux/arm64/v8 ${hostRegistry}/ubuntu:jammy AS final-image

# Define Args and Env needed to create links
ARG PS_INSTALL_VERSION=7-preview
ARG PS_VERSION=7.3.11
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
\
# Define ENVs for Localization/Globalization
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 \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-arm64v8-Ubuntu-22.04
# Copy only the files we need from the previous stage
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
RUN \
apt-get update \
&& apt-get install --no-install-recommends ca-certificates libssl3 libicu70 less --yes
# Give all user execute permissions and remove write permissions for others
RUN chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
# Create the pwsh symbolic link that points to powershell
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
# Create the pwsh-preview symbolic link that points to powershell
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview
# Use PowerShell as the default shell
# Use array to avoid Docker prepending /bin/sh -c
CMD [ "pwsh" ]
25 changes: 25 additions & 0 deletions release/7-3/ubuntu22.04-arm64/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"IsLinux" : true,
"UseLinuxVersion": false,
"PackageFormat": "powershell-${PS_VERSION}-linux-arm64.tar.gz",
"osVersion": "Ubuntu 22.04 ARM 64v8",
"SkipGssNtlmSspTests": true,
"ShortDistroName": "ubuntu",
"Base64EncodePackageUrl": true,
"UseAcr": false,
"shortTags": [
{"Tag": "jammy-arm64"},
{"Tag": "22.04-arm64"}
],
"TestProperties": {
"size": 550,
"Arm64": true
},
"manifestLists": [
"${channelTag}"
],
"EndOfLife": "2023-04-02",
"DistributionState": "Validated",
"UseInCi": false,
"Architecture": "arm64"
}
62 changes: 62 additions & 0 deletions release/7-4/ubuntu22.04-arm64/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

ARG hostRegistry=psdockercache.azurecr.io
FROM --platform=linux/arm64/v8 ${hostRegistry}/ubuntu:jammy AS installer-env

ARG PS_VERSION=7.4.1
ENV PS_PACKAGE=powershell-${PS_VERSION}-linux-arm64.tar.gz
ENV PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
ARG PS_INSTALL_VERSION=7-preview

# define the folder we will be installing PowerShell to
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION
# Create the install folder
RUN mkdir -p ${PS_INSTALL_FOLDER}
ARG PS_PACKAGE_URL_BASE64
RUN apt-get update \
&& apt-get install --no-install-recommends ca-certificates wget --yes
RUN echo 'in task' \
&& if [ -n "${PS_PACKAGE_URL_BASE64}" ]; then \
echo 'using base64' \
&& export url=$(echo "${PS_PACKAGE_URL_BASE64}" | base64 --decode -);\
else \
echo 'using unencoded' \
&& export url="${PS_PACKAGE_URL}"; \
fi \
&& echo "url: $url" \
&& wget -O /tmp/powershell.tar.gz "$url" \
&& echo 'task done'
RUN ls -l /tmp/powershell.tar.gz
# Unzip the Linux tar.gz
RUN tar zxf /tmp/powershell.tar.gz -C ${PS_INSTALL_FOLDER}

ARG hostRegistry=psdockercache.azurecr.io
FROM --platform=linux/arm64/v8 ${hostRegistry}/ubuntu:jammy AS final-image

# Define Args and Env needed to create links
ARG PS_INSTALL_VERSION=7-preview
ARG PS_VERSION=7.4.1
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
\
# Define ENVs for Localization/Globalization
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 \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-arm64v8-Ubuntu-22.04
# Copy only the files we need from the previous stage
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
RUN \
apt-get update \
&& apt-get install --no-install-recommends ca-certificates libssl3 libicu70 less --yes
# Give all user execute permissions and remove write permissions for others
RUN chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
# Create the pwsh symbolic link that points to powershell
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
# Create the pwsh-preview symbolic link that points to powershell
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview
# Use PowerShell as the default shell
# Use array to avoid Docker prepending /bin/sh -c
CMD [ "pwsh" ]
25 changes: 25 additions & 0 deletions release/7-4/ubuntu22.04-arm64/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"IsLinux" : true,
"UseLinuxVersion": false,
"PackageFormat": "powershell-${PS_VERSION}-linux-arm64.tar.gz",
"osVersion": "Ubuntu 22.04 ARM 64v8",
"SkipGssNtlmSspTests": true,
"ShortDistroName": "ubuntu",
"Base64EncodePackageUrl": true,
"UseAcr": false,
"shortTags": [
{"Tag": "jammy-arm64"},
{"Tag": "22.04-arm64"}
],
"TestProperties": {
"size": 550,
"Arm64": true
},
"manifestLists": [
"${channelTag}"
],
"EndOfLife": "2023-04-02",
"DistributionState": "Validated",
"UseInCi": false,
"Architecture": "arm64"
}
62 changes: 62 additions & 0 deletions release/7-5/ubuntu22.04-arm64/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

ARG hostRegistry=psdockercache.azurecr.io
FROM --platform=linux/arm64/v8 ${hostRegistry}/ubuntu:jammy AS installer-env

ARG PS_VERSION=7.4.1
ENV PS_PACKAGE=powershell-${PS_VERSION}-linux-arm64.tar.gz
ENV PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
ARG PS_INSTALL_VERSION=7-preview

# define the folder we will be installing PowerShell to
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION
# Create the install folder
RUN mkdir -p ${PS_INSTALL_FOLDER}
ARG PS_PACKAGE_URL_BASE64
RUN apt-get update \
&& apt-get install --no-install-recommends ca-certificates wget --yes
RUN echo 'in task' \
&& if [ -n "${PS_PACKAGE_URL_BASE64}" ]; then \
echo 'using base64' \
&& export url=$(echo "${PS_PACKAGE_URL_BASE64}" | base64 --decode -);\
else \
echo 'using unencoded' \
&& export url="${PS_PACKAGE_URL}"; \
fi \
&& echo "url: $url" \
&& wget -O /tmp/powershell.tar.gz "$url" \
&& echo 'task done'
RUN ls -l /tmp/powershell.tar.gz
# Unzip the Linux tar.gz
RUN tar zxf /tmp/powershell.tar.gz -C ${PS_INSTALL_FOLDER}

ARG hostRegistry=psdockercache.azurecr.io
FROM --platform=linux/arm64/v8 ${hostRegistry}/ubuntu:jammy AS final-image

# Define Args and Env needed to create links
ARG PS_INSTALL_VERSION=7-preview
ARG PS_VERSION=7.4.1
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
\
# Define ENVs for Localization/Globalization
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 \
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-arm64v8-Ubuntu-22.04
# Copy only the files we need from the previous stage
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
RUN \
apt-get update \
&& apt-get install --no-install-recommends ca-certificates libssl3 libicu70 less --yes
# Give all user execute permissions and remove write permissions for others
RUN chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
# Create the pwsh symbolic link that points to powershell
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
# Create the pwsh-preview symbolic link that points to powershell
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview
# Use PowerShell as the default shell
# Use array to avoid Docker prepending /bin/sh -c
CMD [ "pwsh" ]
25 changes: 25 additions & 0 deletions release/7-5/ubuntu22.04-arm64/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"IsLinux" : true,
"UseLinuxVersion": false,
"PackageFormat": "powershell-${PS_VERSION}-linux-arm64.tar.gz",
"osVersion": "Ubuntu 22.04 ARM 64v8",
"SkipGssNtlmSspTests": true,
"ShortDistroName": "ubuntu",
"Base64EncodePackageUrl": true,
"UseAcr": false,
"shortTags": [
{"Tag": "jammy-arm64"},
{"Tag": "22.04-arm64"}
],
"TestProperties": {
"size": 550,
"Arm64": true
},
"manifestLists": [
"${channelTag}"
],
"EndOfLife": "2023-04-02",
"DistributionState": "Validated",
"UseInCi": false,
"Architecture": "arm64"
}

0 comments on commit c941f18

Please sign in to comment.