Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ubuntu-based arm64 image #797

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions release/7-2/ubuntu20.04-arm64/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

FROM --platform=linux/arm64/v8 ubuntu:focal 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 --mount=type=cache,target=/var/lib/apt \
--mount=type=cache,target=/var/cache/apt \
apt-get update \
&& apt-get install --no-install-recommends ca-certificates wget --yes
RUN update-ca-certificates -f
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:focal 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-20.04
# Copy only the files we need from the previous stage
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
RUN --mount=type=cache,target=/var/lib/apt \
--mount=type=cache,target=/var/cache/apt \
apt-get update \
&& apt-get install --no-install-recommends ca-certificates libssl1.1 libicu66 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" ]
26 changes: 26 additions & 0 deletions release/7-2/ubuntu20.04-arm64/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"IsLinux" : true,
"UseLinuxVersion": false,
"PackageFormat": "powershell-${PS_VERSION}-linux-arm64.tar.gz",
"osVersion": "Ubuntu 20.04 ARM 64v8",
"SkipGssNtlmSspTests": true,
"ShortDistroName": "ubuntu",
"Base64EncodePackageUrl": true,
"UseAcr": false,
"tagTemplates": [
"#psversion#-ubuntu-#shorttag#-arm64",
"ubuntu-#shorttag#-arm64"
],
"shortTags": [
{"Tag": "focal"},
{"Tag": "20.04"}
],
"TestProperties": {
"size": 550,
"Arm64": true
},
"EndOfLife": "2023-04-02",
"DistributionState": "Validated",
"UseInCi": false,
"Architecture": "arm64"
}
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"
}
65 changes: 65 additions & 0 deletions release/7-3/ubuntu20.04-arm64/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

ARG hostRegistry=psdockercache.azurecr.io
FROM --platform=linux/arm64/v8 ${hostRegistry}/ubuntu:focal 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 --mount=type=cache,target=/var/lib/apt \
--mount=type=cache,target=/var/cache/apt \
apt-get update \
&& apt-get install --no-install-recommends ca-certificates wget --yes
RUN update-ca-certificates -f
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:focal 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-20.04
# Copy only the files we need from the previous stage
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
RUN --mount=type=cache,target=/var/lib/apt \
--mount=type=cache,target=/var/cache/apt \
apt-get update \
&& apt-get install --no-install-recommends ca-certificates libssl1.1 libicu66 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" ]
22 changes: 22 additions & 0 deletions release/7-3/ubuntu20.04-arm64/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"IsLinux" : true,
"UseLinuxVersion": false,
"PackageFormat": "powershell-${PS_VERSION}-linux-arm64.tar.gz",
"osVersion": "Ubuntu 20.04 ARM 64v8",
"SkipGssNtlmSspTests": true,
"ShortDistroName": "ubuntu",
"Base64EncodePackageUrl": true,
"UseAcr": false,
"shortTags": [
{"Tag": "focal-arm64"},
{"Tag": "20.04-arm64"}
],
"TestProperties": {
"size": 550,
"Arm64": true
},
"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"
}
Loading
Loading