From d9c906e3a6df4f1af397705cd9a361b9e8d9a4c2 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 16 Nov 2023 09:50:41 -0800 Subject: [PATCH 1/3] Create 7.5 channel for previews --- release/7-5/alpine316/docker/Dockerfile | 92 ++++++++++++++++ release/7-5/alpine316/meta.json | 18 ++++ .../7-5/alpine316/test-deps/docker/Dockerfile | 35 ++++++ release/7-5/alpine316/test-deps/meta.json | 16 +++ release/7-5/alpine317/docker/Dockerfile | 92 ++++++++++++++++ release/7-5/alpine317/meta.json | 21 ++++ .../7-5/alpine317/test-deps/docker/Dockerfile | 37 +++++++ release/7-5/alpine317/test-deps/meta.json | 16 +++ release/7-5/debian11/docker/Dockerfile | 96 +++++++++++++++++ release/7-5/debian11/meta.json | 19 ++++ .../7-5/debian11/test-deps/docker/Dockerfile | 24 +++++ release/7-5/debian11/test-deps/meta.json | 16 +++ release/7-5/debian12/docker/Dockerfile | 102 ++++++++++++++++++ release/7-5/debian12/meta.json | 19 ++++ .../7-5/debian12/test-deps/docker/Dockerfile | 24 +++++ release/7-5/debian12/test-deps/meta.json | 16 +++ release/7-5/mariner2-arm64/docker/Dockerfile | 74 +++++++++++++ release/7-5/mariner2-arm64/meta.json | 21 ++++ release/7-5/mariner2/docker/Dockerfile | 101 +++++++++++++++++ release/7-5/mariner2/meta.json | 16 +++ .../7-5/mariner2/test-deps/docker/Dockerfile | 35 ++++++ release/7-5/mariner2/test-deps/meta.json | 17 +++ release/7-5/ubi8/docker/Dockerfile | 59 ++++++++++ release/7-5/ubi8/meta.json | 17 +++ release/7-5/ubi8/test-deps/docker/Dockerfile | 23 ++++ release/7-5/ubi8/test-deps/meta.json | 20 ++++ release/7-5/ubi9/docker/Dockerfile | 62 +++++++++++ release/7-5/ubi9/meta.json | 21 ++++ release/7-5/ubi9/test-deps/docker/Dockerfile | 23 ++++ release/7-5/ubi9/test-deps/meta.json | 20 ++++ .../7-5/ubuntu20.04-arm32v7/docker/Dockerfile | 65 +++++++++++ release/7-5/ubuntu20.04-arm32v7/meta.json | 22 ++++ release/7-5/ubuntu20.04/docker/Dockerfile | 97 +++++++++++++++++ release/7-5/ubuntu20.04/meta.json | 19 ++++ .../ubuntu20.04/test-deps/docker/Dockerfile | 23 ++++ release/7-5/ubuntu20.04/test-deps/meta.json | 16 +++ .../7-5/ubuntu22.04-arm32v7/docker/Dockerfile | 62 +++++++++++ release/7-5/ubuntu22.04-arm32v7/meta.json | 25 +++++ release/7-5/ubuntu22.04/docker/Dockerfile | 95 ++++++++++++++++ release/7-5/ubuntu22.04/meta.json | 21 ++++ .../ubuntu22.04/test-deps/docker/Dockerfile | 23 ++++ release/7-5/ubuntu22.04/test-deps/meta.json | 16 +++ .../7-5/windowsserver2022/docker/Dockerfile | 72 +++++++++++++ release/7-5/windowsserver2022/meta.json | 21 ++++ .../windowsservercore2022/docker/Dockerfile | 72 +++++++++++++ release/7-5/windowsservercore2022/meta.json | 21 ++++ tools/buildHelper/channels.json | 2 +- 47 files changed, 1823 insertions(+), 1 deletion(-) create mode 100644 release/7-5/alpine316/docker/Dockerfile create mode 100644 release/7-5/alpine316/meta.json create mode 100644 release/7-5/alpine316/test-deps/docker/Dockerfile create mode 100644 release/7-5/alpine316/test-deps/meta.json create mode 100644 release/7-5/alpine317/docker/Dockerfile create mode 100644 release/7-5/alpine317/meta.json create mode 100644 release/7-5/alpine317/test-deps/docker/Dockerfile create mode 100644 release/7-5/alpine317/test-deps/meta.json create mode 100644 release/7-5/debian11/docker/Dockerfile create mode 100644 release/7-5/debian11/meta.json create mode 100644 release/7-5/debian11/test-deps/docker/Dockerfile create mode 100644 release/7-5/debian11/test-deps/meta.json create mode 100644 release/7-5/debian12/docker/Dockerfile create mode 100644 release/7-5/debian12/meta.json create mode 100644 release/7-5/debian12/test-deps/docker/Dockerfile create mode 100644 release/7-5/debian12/test-deps/meta.json create mode 100644 release/7-5/mariner2-arm64/docker/Dockerfile create mode 100644 release/7-5/mariner2-arm64/meta.json create mode 100644 release/7-5/mariner2/docker/Dockerfile create mode 100644 release/7-5/mariner2/meta.json create mode 100644 release/7-5/mariner2/test-deps/docker/Dockerfile create mode 100644 release/7-5/mariner2/test-deps/meta.json create mode 100644 release/7-5/ubi8/docker/Dockerfile create mode 100644 release/7-5/ubi8/meta.json create mode 100644 release/7-5/ubi8/test-deps/docker/Dockerfile create mode 100644 release/7-5/ubi8/test-deps/meta.json create mode 100644 release/7-5/ubi9/docker/Dockerfile create mode 100644 release/7-5/ubi9/meta.json create mode 100644 release/7-5/ubi9/test-deps/docker/Dockerfile create mode 100644 release/7-5/ubi9/test-deps/meta.json create mode 100644 release/7-5/ubuntu20.04-arm32v7/docker/Dockerfile create mode 100644 release/7-5/ubuntu20.04-arm32v7/meta.json create mode 100644 release/7-5/ubuntu20.04/docker/Dockerfile create mode 100644 release/7-5/ubuntu20.04/meta.json create mode 100644 release/7-5/ubuntu20.04/test-deps/docker/Dockerfile create mode 100644 release/7-5/ubuntu20.04/test-deps/meta.json create mode 100644 release/7-5/ubuntu22.04-arm32v7/docker/Dockerfile create mode 100644 release/7-5/ubuntu22.04-arm32v7/meta.json create mode 100644 release/7-5/ubuntu22.04/docker/Dockerfile create mode 100644 release/7-5/ubuntu22.04/meta.json create mode 100644 release/7-5/ubuntu22.04/test-deps/docker/Dockerfile create mode 100644 release/7-5/ubuntu22.04/test-deps/meta.json create mode 100644 release/7-5/windowsserver2022/docker/Dockerfile create mode 100644 release/7-5/windowsserver2022/meta.json create mode 100644 release/7-5/windowsservercore2022/docker/Dockerfile create mode 100644 release/7-5/windowsservercore2022/meta.json diff --git a/release/7-5/alpine316/docker/Dockerfile b/release/7-5/alpine316/docker/Dockerfile new file mode 100644 index 000000000..cfac28f6c --- /dev/null +++ b/release/7-5/alpine316/docker/Dockerfile @@ -0,0 +1,92 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Docker image file that describes an Alpine image with PowerShell installed from .tar.gz file(s) +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/alpine:3.16 AS installer-env + +# Define Args for the needed to add the package +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-musl-x64.tar.gz +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} +ARG PS_INSTALL_VERSION=7-preview + +# Download the Linux tar.gz and save it +ADD ${PS_PACKAGE_URL} /tmp/linux.tar.gz + +# 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} + +# Unzip the Linux tar.gz +RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v + +# Start a new stage so we lose all the tar.gz layers from the final image +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/alpine:3.16 + +# Copy only the files we need from the previous stage +COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"] + +# Define Args and Env needed to create links +ARG PS_INSTALL_VERSION=7-preview +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-Alpine-3.16 + +# Install dotnet dependencies and ca-certificates +RUN apk add --no-cache \ + ca-certificates \ + less \ + \ + # PSReadline/console dependencies + ncurses-terminfo-base \ + \ + # .NET Core dependencies + krb5-libs \ + libgcc \ + libintl \ + libssl1.1 \ + libstdc++ \ + tzdata \ + userspace-rcu \ + zlib \ + icu-libs \ + && apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \ + lttng-ust \ + \ + # PowerShell remoting over SSH dependencies + openssh-client \ + \ + && apk update \ + && apk upgrade \ + # 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 \ + # Give all user execute permissions and remove write permissions for others + && chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \ + # intialize powershell module cache + # and disable telemetry + && export POWERSHELL_TELEMETRY_OPTOUT=1 \ + && pwsh \ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" + +CMD [ "pwsh" ] diff --git a/release/7-5/alpine316/meta.json b/release/7-5/alpine316/meta.json new file mode 100644 index 000000000..8216faee0 --- /dev/null +++ b/release/7-5/alpine316/meta.json @@ -0,0 +1,18 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "PackageFormat": "powershell-${PS_VERSION}-linux-musl-x64.tar.gz", + "osVersion": "Alpine 3.16", + "shortDistroName": "alpine", + "shortTags": [ + {"Tag": "3.16"} + ], + "SkipGssNtlmSspTests": true, + "SubImage": "test-deps", + "TestProperties": { + "size": 252 + }, + "EndOfLife": "2023-11-01", + "DistributionState": "Validating", + "UseInCi": false +} diff --git a/release/7-5/alpine316/test-deps/docker/Dockerfile b/release/7-5/alpine316/test-deps/docker/Dockerfile new file mode 100644 index 000000000..c7585fba2 --- /dev/null +++ b/release/7-5/alpine316/test-deps/docker/Dockerfile @@ -0,0 +1,35 @@ +# Docker image file that describes an Alpine image with PowerShell and test dependencies + +ARG BaseImage=mcr.microsoft.com/powershell:alpine-3.16 + +FROM ${BaseImage} + +ENV NODE_VERSION=14.17.6 \ + YARN_VERSION=1.22.5 \ + NVM_DIR="/root/.nvm" \ + POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-3.16 + +# workaround for Alpine to run in Azure DevOps +ENV NODE_NO_WARNINGS=1 + +RUN apk add --no-cache --virtual .pipeline-deps readline linux-pam \ + && apk add --no-cache \ + bash \ + sudo \ + shadow \ + openssl \ + curl \ + git \ + unzip \ + nodejs \ + && apk update \ + && apk upgrade \ + && apk del .pipeline-deps \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg + +LABEL com.azure.dev.pipelines.agent.handler.node.path="/usr/local/bin/node" + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/alpine316/test-deps/meta.json b/release/7-5/alpine316/test-deps/meta.json new file mode 100644 index 000000000..a8daf5955 --- /dev/null +++ b/release/7-5/alpine316/test-deps/meta.json @@ -0,0 +1,16 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "SkipGssNtlmSspTests": true, + "osVersion": "Alpine 3.16", + "tagTemplates": [ + "alpine-#shorttag#" + ], + "OptionalTests": [ + "test-deps", + "test-deps-musl" + ], + "TestProperties": { + "size": 335 + } +} diff --git a/release/7-5/alpine317/docker/Dockerfile b/release/7-5/alpine317/docker/Dockerfile new file mode 100644 index 000000000..c6c3f950f --- /dev/null +++ b/release/7-5/alpine317/docker/Dockerfile @@ -0,0 +1,92 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Docker image file that describes an Alpine image with PowerShell installed from .tar.gz file(s) +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/alpine:3.17 AS installer-env + +# Define Args for the needed to add the package +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-musl-x64.tar.gz +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} +ARG PS_INSTALL_VERSION=7-preview + +# Download the Linux tar.gz and save it +ADD ${PS_PACKAGE_URL} /tmp/linux.tar.gz + +# 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} + +# Unzip the Linux tar.gz +RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v + +# Start a new stage so we lose all the tar.gz layers from the final image +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/alpine:3.17 + +# Copy only the files we need from the previous stage +COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"] + +# Define Args and Env needed to create links +ARG PS_INSTALL_VERSION=7-preview +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-Alpine-3.17 + +# Install dotnet dependencies and ca-certificates +RUN apk add --no-cache \ + ca-certificates \ + less \ + \ + # PSReadline/console dependencies + ncurses-terminfo-base \ + \ + # .NET Core dependencies + krb5-libs \ + libgcc \ + libintl \ + libssl1.1 \ + libstdc++ \ + tzdata \ + userspace-rcu \ + zlib \ + icu-libs \ + && apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \ + lttng-ust \ + \ + # PowerShell remoting over SSH dependencies + openssh-client \ + \ + && apk update \ + && apk upgrade \ + # 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 \ + # Give all user execute permissions and remove write permissions for others + && chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \ + # intialize powershell module cache + # and disable telemetry + && export POWERSHELL_TELEMETRY_OPTOUT=1 \ + && pwsh \ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" + +CMD [ "pwsh" ] diff --git a/release/7-5/alpine317/meta.json b/release/7-5/alpine317/meta.json new file mode 100644 index 000000000..dd83a9823 --- /dev/null +++ b/release/7-5/alpine317/meta.json @@ -0,0 +1,21 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "PackageFormat": "powershell-${PS_VERSION}-linux-musl-x64.tar.gz", + "osVersion": "Alpine 3.17", + "shortDistroName": "alpine", + "shortTags": [ + {"Tag": "3.17"} + ], + "SkipGssNtlmSspTests": true, + "SubImage": "test-deps", + "TestProperties": { + "size": 252 + }, + "EndOfLife": "2023-11-01", + "DistributionState": "Validating", + "manifestLists": [ + "${channelTagPrefix}alpine" + ], + "UseInCi": false +} diff --git a/release/7-5/alpine317/test-deps/docker/Dockerfile b/release/7-5/alpine317/test-deps/docker/Dockerfile new file mode 100644 index 000000000..f8d5d8113 --- /dev/null +++ b/release/7-5/alpine317/test-deps/docker/Dockerfile @@ -0,0 +1,37 @@ +# Docker image file that describes an Alpine image with PowerShell and test dependencies + +ARG BaseImage=mcr.microsoft.com/powershell:alpine-3.17 + +FROM ${BaseImage} + +ENV NODE_VERSION=14.17.6 \ + YARN_VERSION=1.22.5 \ + NVM_DIR="/root/.nvm" \ + POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-3.17 + +# workaround for Alpine to run in Azure DevOps +ENV NODE_NO_WARNINGS=1 + +RUN apk add --no-cache --virtual .pipeline-deps readline linux-pam \ + && apk add --no-cache \ + bash \ + sudo \ + shadow \ + openssl \ + curl \ + git \ + unzip \ + musl \ + musl-locales \ + nodejs \ + && apk update \ + && apk upgrade \ + && apk del .pipeline-deps \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg + +LABEL com.azure.dev.pipelines.agent.handler.node.path="/usr/local/bin/node" + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/alpine317/test-deps/meta.json b/release/7-5/alpine317/test-deps/meta.json new file mode 100644 index 000000000..f5a9899ab --- /dev/null +++ b/release/7-5/alpine317/test-deps/meta.json @@ -0,0 +1,16 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "SkipGssNtlmSspTests": true, + "osVersion": "Alpine 3.17", + "tagTemplates": [ + "alpine-#shorttag#" + ], + "OptionalTests": [ + "test-deps", + "test-deps-musl" + ], + "TestProperties": { + "size": 335 + } +} diff --git a/release/7-5/debian11/docker/Dockerfile b/release/7-5/debian11/docker/Dockerfile new file mode 100644 index 000000000..2abfd69a0 --- /dev/null +++ b/release/7-5/debian11/docker/Dockerfile @@ -0,0 +1,96 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Docker image file that describes an Debian image with PowerShell installed from Microsoft APT Repo + +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/debian:bullseye-slim AS installer-env + +# Define Args for the needed to add the package +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-x64.tar.gz +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} +ARG PS_INSTALL_VERSION=7-preview + +# Download the Linux tar.gz and save it +ADD ${PS_PACKAGE_URL} /tmp/linux.tar.gz + +# 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} + +# Unzip the Linux tar.gz +RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} + +# Start a new stage so we lose all the tar.gz layers from the final image +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/debian:bullseye-slim + +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_INSTALL_VERSION=7-preview + +# Copy only the files we need from the previous stage +COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"] + +# Define Args and Env needed to create links +ARG PS_INSTALL_VERSION=7-preview +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-Debian-11 + +# Install dependencies and clean up +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + # less is required for help in powershell + less \ + # requied to setup the locale + locales \ + # required for SSL + ca-certificates \ + gss-ntlmssp \ + libicu67 \ + libssl1.1 \ + libc6 \ + libgcc1 \ + libgssapi-krb5-2 \ + libstdc++6 \ + zlib1g \ + # PowerShell remoting over SSH dependencies + openssh-client \ + && apt-get dist-upgrade -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + # enable en_US.UTF-8 locale + && sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen \ + # generate locale + && locale-gen && update-locale + + # 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 \ + # intialize powershell module cache + # and disable telemetry + && export POWERSHELL_TELEMETRY_OPTOUT=1 \ + && pwsh \ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/debian11/meta.json b/release/7-5/debian11/meta.json new file mode 100644 index 000000000..004ca8c80 --- /dev/null +++ b/release/7-5/debian11/meta.json @@ -0,0 +1,19 @@ +{ + "IsLinux" : true, + "UseLinuxVersion" : false, + "PackageFormat": "powershell-${PS_VERSION}-linux-x64.tar.gz", + "osVersion": "Debian 11", + "SkipGssNtlmSspTests": false, + "ShortDistroName": "debian", + "shortTags": [ + {"Tag": "bullseye-slim"}, + {"Tag": "11"} + ], + "SubImage": "test-deps", + "TestProperties": { + "size": 340 + }, + "EndOfLife": "2023-12-15", + "DistributionState": "Validated" +} + diff --git a/release/7-5/debian11/test-deps/docker/Dockerfile b/release/7-5/debian11/test-deps/docker/Dockerfile new file mode 100644 index 000000000..a87eee790 --- /dev/null +++ b/release/7-5/debian11/test-deps/docker/Dockerfile @@ -0,0 +1,24 @@ +# Docker image file that describes an Debian image with PowerShell and test dependencies +ARG BaseImage=mcr.microsoft.com/powershell:preview-debian-11 + +FROM ${BaseImage} + +# Install dependencies and clean up +RUN --mount=type=cache,target=/var/lib/apt/lists \ + apt-get update \ + && apt-get install --no-install-recommends -y \ + sudo \ + curl \ + wget \ + iputils-ping \ + iputils-tracepath \ + procps \ + git \ + unzip \ + && apt-get clean + +ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Debian-11 + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/debian11/test-deps/meta.json b/release/7-5/debian11/test-deps/meta.json new file mode 100644 index 000000000..a9999ce7b --- /dev/null +++ b/release/7-5/debian11/test-deps/meta.json @@ -0,0 +1,16 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "osVersion": "Debian 11 (Testing)", + "tagTemplates": [ + "debian-#shorttag#" + ], + "SubRepository": "test-deps", + "OptionalTests": [ + "test-deps", + "test-deps-debian" + ], + "TestProperties": { + "size": 402 + } +} diff --git a/release/7-5/debian12/docker/Dockerfile b/release/7-5/debian12/docker/Dockerfile new file mode 100644 index 000000000..301af5d98 --- /dev/null +++ b/release/7-5/debian12/docker/Dockerfile @@ -0,0 +1,102 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Docker image file that describes an Debian image with PowerShell installed from Microsoft APT Repo +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/debian:bookworm AS installer-env + +# Define Args for the needed to add the package +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_PACKAGE=powershell-preview_${PS_VERSION}-1.deb_amd64.deb +ARG 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} + +RUN --mount=type=cache,target=/var/lib/apt \ + --mount=type=cache,target=/var/cache/apt \ + apt-get update \ + && apt-get install --no-install-recommends -y \ + # curl is required to grab the Linux package + curl \ + tar \ + # less is required for help in powershell + less \ + # requied to setup the locale + locales \ + # required for SSL + ca-certificates \ + # Download the Linux package and save it + && echo ${PS_PACKAGE_URL} \ + && curl -sSL ${PS_PACKAGE_URL} -o /tmp/powershell.deb + +# Install the deb file in this image and make powershell available +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/debian:bookworm AS final-image + +# # Define args needed to add the package +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_PACKAGE=powershell-preview_${PS_VERSION}-1.deb_amd64.deb +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} +ARG PS_INSTALL_VERSION=7-preview + +# Define ENVs for Localization/Globalization +ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \ + # set a fixed location for the Module analysis cache + PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \ + POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Debian-12 + +# Install dependencies and clean up +RUN --mount=from=installer-env,target=/mnt/pwsh,source=/tmp \ + --mount=type=cache,target=/var/lib/apt \ + --mount=type=cache,target=/var/cache/apt \ + apt-get update \ + && apt-get install --no-install-recommends -y /mnt/pwsh/powershell.deb \ + && apt-get install --no-install-recommends -y \ + # less is required for help in powershell + less \ + # requied to setup the locale + locales \ + # required for SSL + ca-certificates \ + gss-ntlmssp \ + libicu72 \ + libssl3 \ + libc6 \ + libgcc-s1 \ + libgssapi-krb5-2 \ + liblttng-ust1 \ + libstdc++6 \ + zlib1g \ + # PowerShell remoting over SSH dependencies + openssh-client \ + && apt-get dist-upgrade -y \ + && locale-gen $LANG && update-locale \ + && export POWERSHELL_TELEMETRY_OPTOUT=1 \ + # Give all user execute permissions and remove write permissions for others + && chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \ + # Create the pwsh symbolic link that points to powershell + && ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \ + # Create the pwsh-preview symbolic link that points to powershell + && ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \ + && pwsh \ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh-preview" ] diff --git a/release/7-5/debian12/meta.json b/release/7-5/debian12/meta.json new file mode 100644 index 000000000..b04681aa7 --- /dev/null +++ b/release/7-5/debian12/meta.json @@ -0,0 +1,19 @@ +{ + "IsLinux" : true, + "UseLinuxVersion" : false, + "PackageFormat": "powershell${channelTag}_${PS_VERSION}-1.deb_amd64.deb", + "osVersion": "Debian 12", + "SkipGssNtlmSspTests": false, + "ShortDistroName": "debian", + "shortTags": [ + {"Tag": "bookworm"}, + {"Tag": "12"} + ], + "SubImage": "test-deps", + "TestProperties": { + "size": 490 + }, + "EndOfLife": "2025-12-25", + "DistributionState": "Validating" +} + diff --git a/release/7-5/debian12/test-deps/docker/Dockerfile b/release/7-5/debian12/test-deps/docker/Dockerfile new file mode 100644 index 000000000..497c7ecae --- /dev/null +++ b/release/7-5/debian12/test-deps/docker/Dockerfile @@ -0,0 +1,24 @@ +# Docker image file that describes an Debian image with PowerShell and test dependencies +ARG BaseImage=mcr.microsoft.com/powershell:preview-debian-12 + +FROM ${BaseImage} + +# Install dependencies and clean up +RUN --mount=type=cache,target=/var/lib/apt/lists \ + apt-get update \ + && apt-get install --no-install-recommends -y \ + sudo \ + curl \ + wget \ + iputils-ping \ + iputils-tracepath \ + procps \ + git \ + unzip \ + && apt-get clean + +ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Debian-12 + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/debian12/test-deps/meta.json b/release/7-5/debian12/test-deps/meta.json new file mode 100644 index 000000000..c1f64c631 --- /dev/null +++ b/release/7-5/debian12/test-deps/meta.json @@ -0,0 +1,16 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "osVersion": "Debian 12 (Testing)", + "tagTemplates": [ + "debian-#shorttag#" + ], + "SubRepository": "test-deps", + "OptionalTests": [ + "test-deps", + "test-deps-debian" + ], + "TestProperties": { + "size": 490 + } +} diff --git a/release/7-5/mariner2-arm64/docker/Dockerfile b/release/7-5/mariner2-arm64/docker/Dockerfile new file mode 100644 index 000000000..de5c18ddc --- /dev/null +++ b/release/7-5/mariner2-arm64/docker/Dockerfile @@ -0,0 +1,74 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +FROM mcr.microsoft.com/cbl-mariner/base/core:2.0.20221222-arm64 AS installer-env + +# Define Args for the needed to add the package +ARG PS_VERSION=7.4.0-preview.1 +ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-arm64.tar.gz +ARG 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/cache/tdnf \ + tdnf update -y \ + && tdnf install -y ca-certificates wget tar + +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 powershell.tar.gz +RUN tar zxf /tmp/powershell.tar.gz -C ${PS_INSTALL_FOLDER} + +FROM mcr.microsoft.com/cbl-mariner/base/core:2.0.20221222-arm64 AS final-image + +# Define Args and Env needed to create links +ARG PS_INSTALL_VERSION=7-preview +ARG PS_VERSION=7.4.0-preview.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-arm64v7-Mariner-2 + +# 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/cache/tdnf,rw \ + tdnf update -y \ + && tdnf install -y icu less openssh-clients ca-certificates dotnet-runtime-7.0 \ + && tdnf upgrade -y \ + && tdnf clean all + + # 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 \ + && 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" ] diff --git a/release/7-5/mariner2-arm64/meta.json b/release/7-5/mariner2-arm64/meta.json new file mode 100644 index 000000000..c586b4a90 --- /dev/null +++ b/release/7-5/mariner2-arm64/meta.json @@ -0,0 +1,21 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "PackageFormat": "powershell-${PS_VERSION}-linux-arm64.tar.gz", + "osVersion": "Mariner 2.0 ARM 64v7", + "SkipGssNtlmSspTests": true, + "ShortDistroName": "mariner", + "Base64EncodePackageUrl": true, + "UseAcr": false, + "shortTags": [ + {"Tag": "2.0-arm64"} + ], + "TestProperties": { + "size": 404, + "Arm32": true + }, + "EndOfLife": "2023-12-14", + "DistributionState": "Validating", + "UseInCi": false, + "Architecture": "arm64" +} diff --git a/release/7-5/mariner2/docker/Dockerfile b/release/7-5/mariner2/docker/Dockerfile new file mode 100644 index 000000000..e50f17aed --- /dev/null +++ b/release/7-5/mariner2/docker/Dockerfile @@ -0,0 +1,101 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 AS setup-tdnf-repa + +RUN --mount=type=cache,target=/var/cache/tdnf \ + tdnf install -y mariner-repos-microsoft-preview \ + && tdnf makecache + +# Move to +FROM setup-tdnf-repa AS installer-env + +# Define Args for the needed to add the package +ARG PS_VERSION=7.3.0-preview.8 +ARG PACKAGE_VERSION=7.3.0_preview.8 +ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.cm.x86_64.rpm +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} +ARG PS_INSTALL_VERSION=7-preview + +# Download the Linux tar.gz and save it +ADD ${PS_PACKAGE_URL} /tmp/powershell.rpm + +RUN --mount=type=cache,target=/var/cache/tdnf \ + tdnf install -y \ + wget \ + awk \ + tar \ + ca-certificates + +RUN --mount=type=cache,target=/var/cache/tdnf \ + --mount=type=cache,target=/installTmp \ + cd /installTmp \ + && wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \ + && chmod +x ./dotnet-install.sh \ + && ./dotnet-install.sh -Channel 8.0 -Quality preview -Runtime dotnet -InstallDir /usr/share/dotnet + +RUN echo ${PS_PACKAGE_URL} + +# Start a new stage so we lose all the tar.gz layers from the final image +FROM setup-tdnf-repa AS powershell + +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_INSTALL_VERSION=7-preview + +# Define Args and Env needed to create links +ARG PS_INSTALL_VERSION=7-preview +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-Mariner-2.0 + +RUN --mount=type=cache,target=/var/cache/tdnf \ + # install dependencies + tdnf install -y \ + # required for localization + icu \ + # required for help in PowerShell + less \ + # required for SSH + openssh-clients \ + ca-certificates + +# Install dependencies and clean up +RUN --mount=type=cache,target=/var/cache/tdnf \ + tdnf upgrade -y \ + # clean cached data + && tdnf clean all + +COPY --from=installer-env /usr/share/dotnet /usr/share/dotnet + +RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet + +RUN --mount=type=cache,target=/var/cache/tdnf,rw \ + --mount=from=installer-env,target=/mnt/rpm,source=/tmp \ + rpm -i --nodeps /mnt/rpm/powershell.rpm + +# Create the pwsh symbolic link that points to powershell +RUN if [ -f "/opt/microsoft/powershell/7-preview/pwsh" ]; then ln -sf /opt/microsoft/powershell/7-preview/pwsh /usr/bin/pwsh; fi + +# intialize powershell module cache +# and disable telemetry for this ONE session +RUN export POWERSHELL_TELEMETRY_OPTOUT=1 \ + && pwsh \ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/mariner2/meta.json b/release/7-5/mariner2/meta.json new file mode 100644 index 000000000..a8c48a05c --- /dev/null +++ b/release/7-5/mariner2/meta.json @@ -0,0 +1,16 @@ +{ + "IsLinux" : true, + "PackageFormat": "powershell${channelTag}-${PS_VERSION}-1.cm.x86_64.rpm", + "SkipGssNtlmSspTests": true, + "osVersion": "Mariner 2.0", + "shortTags": [ + {"Tag": "2.0"} + ], + "ShortDistroName": "mariner", + "SubImage": "test-deps", + "TestProperties": { + "size": 335 + }, + "EndOfLife": "2022-10-14", + "DistributionState": "Validated" +} diff --git a/release/7-5/mariner2/test-deps/docker/Dockerfile b/release/7-5/mariner2/test-deps/docker/Dockerfile new file mode 100644 index 000000000..396f62ec6 --- /dev/null +++ b/release/7-5/mariner2/test-deps/docker/Dockerfile @@ -0,0 +1,35 @@ +# Docker image file that describes an Mariner image with PowerShell and test dependencies +ARG BaseImage=mcr.microsoft.com/powershell:mariner +FROM ${BaseImage} + +# To find which package provides a particular command, run: +# tdnf install dnf-utils +# dnf provides + +# Install dependencies and clean up +RUN --mount=type=cache,target=/var/cache/tdnf \ + tdnf update -y --exclude=powershell-preview \ + # install dependencies + && tdnf install -y \ + dnf-utils \ + sudo \ + curl \ + wget \ + # provides ping and trace path + iputils \ + # provides ps + procps-ng \ + unzip \ + git \ + mariner-repos-microsoft-preview \ + net-tools \ + tar \ + util-linux \ + # clean cached data + && tdnf clean all + +ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Mariner-2.0 + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/mariner2/test-deps/meta.json b/release/7-5/mariner2/test-deps/meta.json new file mode 100644 index 000000000..222c298b0 --- /dev/null +++ b/release/7-5/mariner2/test-deps/meta.json @@ -0,0 +1,17 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "SkipGssNtlmSspTests": true, + "osVersion": "Mariner 2.0", + "tagTemplates": [ + "mariner-#shorttag#" + ], + "SubRepository": "test-deps", + "OptionalTests": [ + "test-deps", + "test-deps-redhat" + ], + "TestProperties": { + "size": 760 + } +} diff --git a/release/7-5/ubi8/docker/Dockerfile b/release/7-5/ubi8/docker/Dockerfile new file mode 100644 index 000000000..8bfa52029 --- /dev/null +++ b/release/7-5/ubi8/docker/Dockerfile @@ -0,0 +1,59 @@ +# syntax = docker/dockerfile:1.2 +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +FROM registry.access.redhat.com/ubi8/ubi:8.6 AS installer-env +ARG PS_VERSION=7.3.0-preview.8 +ARG PACKAGE_VERSION=7.3.0_preview.8 +ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.rh.x86_64.rpm +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} + +# Install powershell +# create folder at install location +RUN curl -sSL ${PS_PACKAGE_URL} -o /tmp/linux.rpm +# start new stage so that the tar.gz layers are left behind in multi-stage build +FROM registry.access.redhat.com/ubi8/ubi:8.6 AS final-image +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_INSTALL_VERSION=7-preview + +RUN --mount=type=cache,target=/var/cache/yum,rw \ + yum install -y \ + less \ + ncurses \ + openssh-clients \ + glibc-locale-source \ + glibc-langpack-en \ + libicu \ + && yum clean all +RUN --mount=type=cache,target=/var/cache/yum,rw \ + --mount=from=installer-env,target=/mnt/rpm,source=/tmp \ + yum localinstall -y \ + /mnt/rpm/linux.rpm \ + # ubi 8 security updates are not marked as security updates. + && yum upgrade -y \ + && yum clean all +# Define ENVs for Localization/Globalization +ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/${PS_INSTALL_VERSION} \ + 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-UBI-8.4 + +RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG \ + && chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \ + && ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \ + && ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \ + && export POWERSHELL_TELEMETRY_OPTOUT=1 \ + && pwsh\ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD ["pwsh-preview"] diff --git a/release/7-5/ubi8/meta.json b/release/7-5/ubi8/meta.json new file mode 100644 index 000000000..9639070ce --- /dev/null +++ b/release/7-5/ubi8/meta.json @@ -0,0 +1,17 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "PackageFormat": "powershell${channelTag}-${PS_VERSION}-1.rh.x86_64.rpm", + "SkipGssNtlmSspTests": true, + "osVersion": "Universal Base Image 8", + "ShortDistroName": "ubi", + "shortTags": [ + {"Tag": "8"} + ], + "SubImage": "test-deps", + "TestProperties": { + "size": 625 + }, + "DistributionState": "Validating", + "EndOfLife": "2023-05-30" +} diff --git a/release/7-5/ubi8/test-deps/docker/Dockerfile b/release/7-5/ubi8/test-deps/docker/Dockerfile new file mode 100644 index 000000000..c4df646c2 --- /dev/null +++ b/release/7-5/ubi8/test-deps/docker/Dockerfile @@ -0,0 +1,23 @@ +# Docker image file that describes an CentOS7 image with PowerShell installed from Microsoft YUM Repo +ARG BaseImage=mcr.microsoft.com/powershell:ubi-8.4 + +FROM ${BaseImage} + +# Install dependencies and clean up +RUN yum install -y \ + sudo \ + wget \ + openssl \ + hostname \ + iputils \ + procps-ng \ + git \ + unzip \ + && yum clean all \ + && rm -rf /var/cache/yum + +ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-ubi-8.4 + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/ubi8/test-deps/meta.json b/release/7-5/ubi8/test-deps/meta.json new file mode 100644 index 000000000..590284827 --- /dev/null +++ b/release/7-5/ubi8/test-deps/meta.json @@ -0,0 +1,20 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "osVersion": "Universal Base Image 8", + "SkipGssNtlmSspTests": true, + "shortTags": [ + {"Tag": "8"} + ], + "tagTemplates": [ + "ubi-#shorttag#" + ], + "OptionalTests": [ + "test-deps" + ], + "TestProperties": { + "size": 750 + }, + "DistributionState": "Validating", + "EndOfLife": "2023-05-30" +} diff --git a/release/7-5/ubi9/docker/Dockerfile b/release/7-5/ubi9/docker/Dockerfile new file mode 100644 index 000000000..04a96136c --- /dev/null +++ b/release/7-5/ubi9/docker/Dockerfile @@ -0,0 +1,62 @@ +# syntax = docker/dockerfile:1.2 +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +FROM registry.access.redhat.com/ubi9/ubi AS installer-env +ARG PS_VERSION=7.3.0-preview.8 +ARG PACKAGE_VERSION=7.3.0_preview.8 +ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.rh.x86_64.rpm +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} + +# Install powershell +# create folder at install location +RUN curl -sSL ${PS_PACKAGE_URL} -o /tmp/linux.rpm +# start new stage so that the tar.gz layers are left behind in multi-stage build +FROM registry.access.redhat.com/ubi9/ubi AS final-image +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_INSTALL_VERSION=7-preview + +RUN --mount=type=cache,target=/var/cache/yum,rw \ + yum install -y \ + less \ + ncurses \ + openssh-clients \ + openssl \ + glibc-locale-source \ + glibc-langpack-en \ + libicu \ + && yum clean all +RUN --mount=type=cache,target=/var/cache/yum,rw \ + --mount=from=installer-env,target=/mnt/rpm,source=/tmp \ + yum localinstall -y \ + /mnt/rpm/linux.rpm \ + && yum upgrade -y \ + && yum clean all +# Define ENVs for Localization/Globalization +ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/${PS_INSTALL_VERSION} \ + 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-UBI-9 \ + # Needed to talk to many sites, see: https://github.com/dotnet/runtime/issues/65874 + # Fixed in https://github.com/dotnet/runtime/pull/69668 + OPENSSL_ENABLE_SHA1_SIGNATURES=1 + +RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG \ + && chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \ + && ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \ + && ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \ + && export POWERSHELL_TELEMETRY_OPTOUT=1 \ + && pwsh\ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD ["pwsh-preview"] diff --git a/release/7-5/ubi9/meta.json b/release/7-5/ubi9/meta.json new file mode 100644 index 000000000..cf260a311 --- /dev/null +++ b/release/7-5/ubi9/meta.json @@ -0,0 +1,21 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "PackageFormat": "powershell${channelTag}-${PS_VERSION}-1.rh.x86_64.rpm", + "SkipGssNtlmSspTests": true, + "osVersion": "Universal Base Image 9", + "ShortDistroName": "ubi", + "shortTags": [ + {"Tag": "9"} + ], + "manifestLists": [ + "ubi${channelTagPostfix}", + "${channelTagPrefix}ubi" + ], + "SubImage": "test-deps", + "TestProperties": { + "size": 508 + }, + "DistributionState": "ImageCreation", + "EndOfLife": "2023-05-30" +} diff --git a/release/7-5/ubi9/test-deps/docker/Dockerfile b/release/7-5/ubi9/test-deps/docker/Dockerfile new file mode 100644 index 000000000..3ec04a1d8 --- /dev/null +++ b/release/7-5/ubi9/test-deps/docker/Dockerfile @@ -0,0 +1,23 @@ +# Docker image file that describes an CentOS7 image with PowerShell installed from Microsoft YUM Repo +ARG BaseImage=mcr.microsoft.com/powershell:ubi-9 + +FROM ${BaseImage} + +# Install dependencies and clean up +RUN yum install -y \ + sudo \ + wget \ + hostname \ + iputils \ + procps-ng \ + git \ + unzip \ + && yum clean all \ + && yum upgrade -y \ + && rm -rf /var/cache/yum + +ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-ubi-9 + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/ubi9/test-deps/meta.json b/release/7-5/ubi9/test-deps/meta.json new file mode 100644 index 000000000..a0efea4fd --- /dev/null +++ b/release/7-5/ubi9/test-deps/meta.json @@ -0,0 +1,20 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "osVersion": "Universal Base Image 9", + "SkipGssNtlmSspTests": true, + "shortTags": [ + {"Tag": "9"} + ], + "tagTemplates": [ + "ubi-#shorttag#" + ], + "OptionalTests": [ + "test-deps" + ], + "TestProperties": { + "size": 566 + }, + "DistributionState": "ImageCreation", + "EndOfLife": "2023-05-30" +} diff --git a/release/7-5/ubuntu20.04-arm32v7/docker/Dockerfile b/release/7-5/ubuntu20.04-arm32v7/docker/Dockerfile new file mode 100644 index 000000000..82537653b --- /dev/null +++ b/release/7-5/ubuntu20.04-arm32v7/docker/Dockerfile @@ -0,0 +1,65 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +ARG hostRegistry=psdockercache.azurecr.io +FROM --platform=linux/arm/v7 ${hostRegistry}/ubuntu:focal AS installer-env + + ARG PS_VERSION=7.3.0-preview.3 + ENV PS_PACKAGE=powershell-${PS_VERSION}-linux-arm32.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/arm/v7 ${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.0-preview.3 + 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-arm32v7-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" ] diff --git a/release/7-5/ubuntu20.04-arm32v7/meta.json b/release/7-5/ubuntu20.04-arm32v7/meta.json new file mode 100644 index 000000000..5e5d0ee14 --- /dev/null +++ b/release/7-5/ubuntu20.04-arm32v7/meta.json @@ -0,0 +1,22 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "PackageFormat": "powershell-${PS_VERSION}-linux-arm32.tar.gz", + "osVersion": "Ubuntu 20.04 ARM 32v7", + "SkipGssNtlmSspTests": true, + "ShortDistroName": "ubuntu", + "Base64EncodePackageUrl": true, + "UseAcr": false, + "shortTags": [ + {"Tag": "focal-arm32"}, + {"Tag": "20.04-arm32"} + ], + "TestProperties": { + "size": 550, + "Arm32": true + }, + "EndOfLife": "2023-04-02", + "DistributionState": "Validated", + "UseInCi": false, + "Architecture": "arm32" +} diff --git a/release/7-5/ubuntu20.04/docker/Dockerfile b/release/7-5/ubuntu20.04/docker/Dockerfile new file mode 100644 index 000000000..de0d3b08f --- /dev/null +++ b/release/7-5/ubuntu20.04/docker/Dockerfile @@ -0,0 +1,97 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Docker image file that describes an Ubuntu20.04 image with PowerShell installed from Microsoft APT Repo +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/ubuntu:20.04 AS installer-env + +# Define Args for the needed to add the package +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-x64.tar.gz +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} +ARG PS_INSTALL_VERSION=7-preview + +# Download the Linux tar.gz and save it +ADD ${PS_PACKAGE_URL} /tmp/linux.tar.gz + +RUN echo ${PS_PACKAGE_URL} + +# 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} + +# Unzip the Linux tar.gz +RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} + +# Start a new stage so we lose all the tar.gz layers from the final image +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/ubuntu:20.04 AS powershell + +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_INSTALL_VERSION=7-preview + +# Copy only the files we need from the previous stage +COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"] + +# Define Args and Env needed to create links +ARG PS_INSTALL_VERSION=7-preview +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-Ubuntu-20.04 + +# Install dependencies and clean up +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + # less is required for help in powershell + less \ + # requied to setup the locale + locales \ + # required for SSL + ca-certificates \ + gss-ntlmssp \ + libicu66 \ + libssl1.1 \ + libc6 \ + libgcc1 \ + libgssapi-krb5-2 \ + libstdc++6 \ + zlib1g \ + # PowerShell remoting over SSH dependencies + openssh-client \ + # Download the Linux package and save it + && apt-get dist-upgrade -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && locale-gen $LANG && update-locale + +# 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 symbolic link that points to powershell + && ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \ + # intialize powershell module cache + # and disable telemetry + && export POWERSHELL_TELEMETRY_OPTOUT=1 \ + && pwsh \ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh-preview" ] diff --git a/release/7-5/ubuntu20.04/meta.json b/release/7-5/ubuntu20.04/meta.json new file mode 100644 index 000000000..84124cdae --- /dev/null +++ b/release/7-5/ubuntu20.04/meta.json @@ -0,0 +1,19 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "PackageFormat": "powershell-${PS_VERSION}-linux-x64.tar.gz", + "osVersion": "Ubuntu 20.04", + "SkipGssNtlmSspTests": false, + "ShortDistroName": "ubuntu", + "shortTags": [ + {"Tag": "focal"}, + {"Tag": "20.04"} + ], + "TestProperties": { + "size": 340 + }, + "SubImage": "test-deps", + "EndOfLife": "2023-12-15", + "DistributionState": "Validated", + "UseInCi": false +} diff --git a/release/7-5/ubuntu20.04/test-deps/docker/Dockerfile b/release/7-5/ubuntu20.04/test-deps/docker/Dockerfile new file mode 100644 index 000000000..bf15fd900 --- /dev/null +++ b/release/7-5/ubuntu20.04/test-deps/docker/Dockerfile @@ -0,0 +1,23 @@ +# Docker image file that describes an Ubuntu image with PowerShell and test dependencies +ARG BaseImage=mcr.microsoft.com/powershell:ubuntu-20.04 + +FROM ${BaseImage} + +# Install dependencies and clean up +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + sudo \ + curl \ + wget \ + iputils-ping \ + iputils-tracepath \ + git \ + unzip \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Ubuntu-20.04 + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/ubuntu20.04/test-deps/meta.json b/release/7-5/ubuntu20.04/test-deps/meta.json new file mode 100644 index 000000000..b3ecab356 --- /dev/null +++ b/release/7-5/ubuntu20.04/test-deps/meta.json @@ -0,0 +1,16 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "osVersion": "Ubuntu 20.04", + "tagTemplates": [ + "ubuntu-#shorttag#" + ], + "SubRepository": "test-deps", + "OptionalTests": [ + "test-deps", + "test-deps-debian" + ], + "TestProperties": { + "size": 410 + } +} diff --git a/release/7-5/ubuntu22.04-arm32v7/docker/Dockerfile b/release/7-5/ubuntu22.04-arm32v7/docker/Dockerfile new file mode 100644 index 000000000..01779bf8d --- /dev/null +++ b/release/7-5/ubuntu22.04-arm32v7/docker/Dockerfile @@ -0,0 +1,62 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +ARG hostRegistry=psdockercache.azurecr.io +FROM --platform=linux/arm/v7 ${hostRegistry}/ubuntu:jammy AS installer-env + +ARG PS_VERSION=7.3.0-preview.4 +ENV PS_PACKAGE=powershell-${PS_VERSION}-linux-arm32.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/arm/v7 ${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.0-preview.4 +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-arm32v7-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" ] diff --git a/release/7-5/ubuntu22.04-arm32v7/meta.json b/release/7-5/ubuntu22.04-arm32v7/meta.json new file mode 100644 index 000000000..e846f4518 --- /dev/null +++ b/release/7-5/ubuntu22.04-arm32v7/meta.json @@ -0,0 +1,25 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "PackageFormat": "powershell-${PS_VERSION}-linux-arm32.tar.gz", + "osVersion": "Ubuntu 22.04 ARM 32v7", + "SkipGssNtlmSspTests": true, + "ShortDistroName": "ubuntu", + "Base64EncodePackageUrl": true, + "UseAcr": false, + "shortTags": [ + {"Tag": "jammy-arm32"}, + {"Tag": "22.04-arm32"} + ], + "TestProperties": { + "size": 550, + "Arm32": true + }, + "manifestLists": [ + "${channelTag}" + ], + "EndOfLife": "2023-04-02", + "DistributionState": "Validated", + "UseInCi": false, + "Architecture": "arm32" +} diff --git a/release/7-5/ubuntu22.04/docker/Dockerfile b/release/7-5/ubuntu22.04/docker/Dockerfile new file mode 100644 index 000000000..94ca415ee --- /dev/null +++ b/release/7-5/ubuntu22.04/docker/Dockerfile @@ -0,0 +1,95 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Docker image file that describes an Ubuntu20.04 image with PowerShell installed from Microsoft APT Repo +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/ubuntu:22.04 AS installer-env + +# Define Args for the needed to add the package +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_PACKAGE=powershell-preview_${PS_VERSION}-1.deb_amd64.deb +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} +ARG PS_INSTALL_VERSION=7-preview + +RUN --mount=type=cache,target=/var/lib/apt \ + --mount=type=cache,target=/var/cache/apt \ + apt-get update \ + && apt-get install --no-install-recommends -y \ + # curl is required to grab the Linux package + curl \ + # less is required for help in powershell + less \ + # requied to setup the locale + locales \ + # required for SSL + ca-certificates \ + # Download the Linux package and save it + && echo ${PS_PACKAGE_URL} \ + && curl -sSL ${PS_PACKAGE_URL} -o /tmp/powershell.deb + +# Install the deb file in this image and make powershell available +ARG hostRegistry=psdockercache.azurecr.io +FROM ${hostRegistry}/ubuntu:22.04 AS final-image + +# # Define args needed to add the package +ARG PS_VERSION=7.3.0-preview.8 +ARG PS_PACKAGE=powershell-preview_${PS_VERSION}-1.deb_amd64.deb +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} +ARG PS_INSTALL_VERSION=7-preview + +# Define ENVs for Localization/Globalization +ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \ + # set a fixed location for the Module analysis cache + PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \ + POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Ubuntu-22.04 + +# Install dependencies and clean up +RUN --mount=from=installer-env,target=/mnt/pwsh,source=/tmp \ + --mount=type=cache,target=/var/lib/apt \ + --mount=type=cache,target=/var/cache/apt \ + apt-get update \ + && apt-get install --no-install-recommends -y /mnt/pwsh/powershell.deb \ + && apt-get install --no-install-recommends -y \ + # less is required for help in powershell + less \ + # requied to setup the locale + locales \ + # required for SSL + ca-certificates \ + gss-ntlmssp \ + libicu70 \ + libssl3 \ + libc6 \ + libgcc1 \ + libgssapi-krb5-2 \ + liblttng-ust1 \ + libstdc++6 \ + zlib1g \ + # PowerShell remoting over SSH dependencies + openssh-client \ + && apt-get dist-upgrade -y \ + && locale-gen $LANG && update-locale \ + && export POWERSHELL_TELEMETRY_OPTOUT=1 \ + # Give all user execute permissions and remove write permissions for others + && chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \ + # Create the pwsh symbolic link that points to powershell + && ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \ + # Create the pwsh-preview symbolic link that points to powershell + && ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \ + && pwsh \ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh-preview" ] diff --git a/release/7-5/ubuntu22.04/meta.json b/release/7-5/ubuntu22.04/meta.json new file mode 100644 index 000000000..647fa3c84 --- /dev/null +++ b/release/7-5/ubuntu22.04/meta.json @@ -0,0 +1,21 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "PackageFormat": "powershell${channelTag}_${PS_VERSION}-1.deb_amd64.deb", + "osVersion": "Ubuntu 22.04", + "SkipGssNtlmSspTests": false, + "ShortDistroName": "ubuntu", + "shortTags": [ + {"Tag": "jammy"}, + {"Tag": "22.04"} + ], + "manifestLists": [ + "${channelTag}" + ], + "TestProperties": { + "size": 338 + }, + "SubImage": "test-deps", + "EndOfLife": "2023-12-15", + "DistributionState": "Validated" +} diff --git a/release/7-5/ubuntu22.04/test-deps/docker/Dockerfile b/release/7-5/ubuntu22.04/test-deps/docker/Dockerfile new file mode 100644 index 000000000..46f14f92a --- /dev/null +++ b/release/7-5/ubuntu22.04/test-deps/docker/Dockerfile @@ -0,0 +1,23 @@ +# Docker image file that describes an Ubuntu image with PowerShell and test dependencies +ARG BaseImage=mcr.microsoft.com/powershell:ubuntu-22.04 + +FROM ${BaseImage} + +# Install dependencies and clean up +RUN --mount=type=cache,target=/var/lib/apt/lists \ + apt-get update \ + && apt-get install --no-install-recommends -y \ + sudo \ + curl \ + wget \ + iputils-ping \ + iputils-tracepath \ + git \ + unzip \ + && apt-get clean + +ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Ubuntu-22.04 + +# Use PowerShell as the default shell +# Use array to avoid Docker prepending /bin/sh -c +CMD [ "pwsh" ] diff --git a/release/7-5/ubuntu22.04/test-deps/meta.json b/release/7-5/ubuntu22.04/test-deps/meta.json new file mode 100644 index 000000000..c488d53c1 --- /dev/null +++ b/release/7-5/ubuntu22.04/test-deps/meta.json @@ -0,0 +1,16 @@ +{ + "IsLinux" : true, + "UseLinuxVersion": false, + "osVersion": "Ubuntu 22.04", + "tagTemplates": [ + "ubuntu-#shorttag#" + ], + "SubRepository": "test-deps", + "OptionalTests": [ + "test-deps", + "test-deps-debian" + ], + "TestProperties": { + "size": 390 + } +} diff --git a/release/7-5/windowsserver2022/docker/Dockerfile b/release/7-5/windowsserver2022/docker/Dockerfile new file mode 100644 index 000000000..88389cfe8 --- /dev/null +++ b/release/7-5/windowsserver2022/docker/Dockerfile @@ -0,0 +1,72 @@ +# escape=` +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +ARG dockerHost=mcr.microsoft.com +ARG WindowsServerRepo=windows/server +ARG tag=ltsc2022 + +# Use server core as an installer container to extract PowerShell, +# As this is a multi-stage build, this stage will eventually be thrown away +FROM mcr.microsoft.com/${WindowsServerRepo}:${tag} AS installer-env + +ARG PS_VERSION=6.2.0 +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/PowerShell-${PS_VERSION}-win-x64.zip + +SHELL ["C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "-command"] + +ARG PS_PACKAGE_URL_BASE64 + +RUN Write-host "Verifying valid Version..."; ` + if (!($env:PS_VERSION -match '^\d+\.\d+\.\d+(-\w+(\.\d+)?)?$' )) { ` + throw ('PS_Version ({0}) must match the regex "^\d+\.\d+\.\d+(-\w+(\.\d+)?)?$"' -f $env:PS_VERSION) ` + } ` + $ProgressPreference = 'SilentlyContinue'; ` + if($env:PS_PACKAGE_URL_BASE64){ ` + Write-host "decoding: $env:PS_PACKAGE_URL_BASE64" ;` + $url = [System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($env:PS_PACKAGE_URL_BASE64)) ` + } else { ` + Write-host "using url: $env:PS_PACKAGE_URL" ;` + $url = $env:PS_PACKAGE_URL ` + } ` + Write-host "downloading: $url"; ` + [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; ` + Invoke-WebRequest -Uri $url -outfile /powershell.zip -verbose; ` + Expand-Archive powershell.zip -DestinationPath \PowerShell + +# Install PowerShell into WindowsServer +FROM mcr.microsoft.com/${WindowsServerRepo}:${tag} + +# Copy PowerShell Core from the installer container +ENV ProgramFiles="C:\Program Files" ` + # set a fixed location for the Module analysis cache + PSModuleAnalysisCachePath="C:\Users\Public\AppData\Local\Microsoft\Windows\PowerShell\docker\ModuleAnalysisCache" ` + # Persist %PSCORE% ENV variable for user convenience + PSCORE="$ProgramFiles\PowerShell\pwsh.exe" ` + POWERSHELL_DISTRIBUTION_CHANNEL="PSDocker-WindowsServer-ltsc2022" ` + POWERSHELL_TELEMETRY_OPTOUT="1" + +# Copy PowerShell Core from the installer container +COPY --from=installer-env ["\\PowerShell\\", "$ProgramFiles\\PowerShell\\latest"] + +# Set the path +RUN setx /M PATH "%ProgramFiles%\PowerShell\latest;%PATH%;" + +# intialize powershell module cache +RUN pwsh ` + -NoLogo ` + -NoProfile ` + -Command " ` + $stopTime = (get-date).AddMinutes(15); ` + $ErrorActionPreference = 'Stop' ; ` + $ProgressPreference = 'SilentlyContinue' ; ` + while(!(Test-Path -Path $env:PSModuleAnalysisCachePath)) { ` + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; ` + if((get-date) -gt $stopTime) { throw 'timout expired'} ` + Start-Sleep -Seconds 6 ; ` + }" + +# re-enable telemetry +ENV POWERSHELL_TELEMETRY_OPTOUT="0" + +CMD ["pwsh.exe"] diff --git a/release/7-5/windowsserver2022/meta.json b/release/7-5/windowsserver2022/meta.json new file mode 100644 index 000000000..de7049fef --- /dev/null +++ b/release/7-5/windowsserver2022/meta.json @@ -0,0 +1,21 @@ +{ + "IsLinux": false, + "PackageFormat": "PowerShell-${PS_VERSION}-win-x64.zip", + "osVersion": "Windows Server, LTSC 2022", + "shortTags": [ + { + "Tag": "ltsc2022" + } + ], + "Base64EncodePackageUrl": true, + "ShortDistroName": "windowsserver", + "manifestLists": [ + "${channelTagPrefix}windowsserver" + ], + "TestProperties": { + "size": 1 + }, + "UseAcr": true, + "EndOfLife": "2023-12-15", + "DistributionState": "Validated" +} diff --git a/release/7-5/windowsservercore2022/docker/Dockerfile b/release/7-5/windowsservercore2022/docker/Dockerfile new file mode 100644 index 000000000..1a165d3e0 --- /dev/null +++ b/release/7-5/windowsservercore2022/docker/Dockerfile @@ -0,0 +1,72 @@ +# escape=` +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +ARG dockerHost=mcr.microsoft.com +ARG WindowsServerCoreRepo=windows/servercore +ARG tag=ltsc2022 + +# Use server core as an installer container to extract PowerShell, +# As this is a multi-stage build, this stage will eventually be thrown away +FROM mcr.microsoft.com/${WindowsServerCoreRepo}:${tag} AS installer-env + +ARG PS_VERSION=6.2.0 +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/PowerShell-${PS_VERSION}-win-x64.zip + +SHELL ["C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "-command"] + +ARG PS_PACKAGE_URL_BASE64 + +RUN Write-host "Verifying valid Version..."; ` + if (!($env:PS_VERSION -match '^\d+\.\d+\.\d+(-\w+(\.\d+)?)?$' )) { ` + throw ('PS_Version ({0}) must match the regex "^\d+\.\d+\.\d+(-\w+(\.\d+)?)?$"' -f $env:PS_VERSION) ` + } ` + $ProgressPreference = 'SilentlyContinue'; ` + if($env:PS_PACKAGE_URL_BASE64){ ` + Write-host "decoding: $env:PS_PACKAGE_URL_BASE64" ;` + $url = [System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($env:PS_PACKAGE_URL_BASE64)) ` + } else { ` + Write-host "using url: $env:PS_PACKAGE_URL" ;` + $url = $env:PS_PACKAGE_URL ` + } ` + Write-host "downloading: $url"; ` + [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; ` + Invoke-WebRequest -Uri $url -outfile /powershell.zip -verbose; ` + Expand-Archive powershell.zip -DestinationPath \PowerShell + +# Install PowerShell into WindowsServerCore +FROM mcr.microsoft.com/${WindowsServerCoreRepo}:${tag} + +# Copy PowerShell Core from the installer container +ENV ProgramFiles="C:\Program Files" ` + # set a fixed location for the Module analysis cache + PSModuleAnalysisCachePath="C:\Users\Public\AppData\Local\Microsoft\Windows\PowerShell\docker\ModuleAnalysisCache" ` + # Persist %PSCORE% ENV variable for user convenience + PSCORE="$ProgramFiles\PowerShell\pwsh.exe" ` + POWERSHELL_DISTRIBUTION_CHANNEL="PSDocker-WindowsServerCore-ltsc2022" ` + POWERSHELL_TELEMETRY_OPTOUT="1" + +# Copy PowerShell Core from the installer container +COPY --from=installer-env ["\\PowerShell\\", "$ProgramFiles\\PowerShell\\latest"] + +# Set the path +RUN setx /M PATH "%ProgramFiles%\PowerShell\latest;%PATH%;" + +# intialize powershell module cache +RUN pwsh ` + -NoLogo ` + -NoProfile ` + -Command " ` + $stopTime = (get-date).AddMinutes(15); ` + $ErrorActionPreference = 'Stop' ; ` + $ProgressPreference = 'SilentlyContinue' ; ` + while(!(Test-Path -Path $env:PSModuleAnalysisCachePath)) { ` + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; ` + if((get-date) -gt $stopTime) { throw 'timout expired'} ` + Start-Sleep -Seconds 6 ; ` + }" + +# re-enable telemetry +ENV POWERSHELL_TELEMETRY_OPTOUT="0" + +CMD ["pwsh.exe"] diff --git a/release/7-5/windowsservercore2022/meta.json b/release/7-5/windowsservercore2022/meta.json new file mode 100644 index 000000000..a1b9c11ce --- /dev/null +++ b/release/7-5/windowsservercore2022/meta.json @@ -0,0 +1,21 @@ +{ + "IsLinux": false, + "PackageFormat": "PowerShell-${PS_VERSION}-win-x64.zip", + "osVersion": "Windows Server Core, LTSC 2022", + "shortTags": [ + { + "Tag": "ltsc2022" + } + ], + "manifestLists": [ + "${channelTag}" + ], + "Base64EncodePackageUrl": true, + "ShortDistroName": "windowsservercore", + "TestProperties": { + "size": 1 + }, + "UseAcr": true, + "EndOfLife": "2023-12-15", + "DistributionState": "Validated" +} diff --git a/tools/buildHelper/channels.json b/tools/buildHelper/channels.json index 6f611d981..12a3997b8 100644 --- a/tools/buildHelper/channels.json +++ b/tools/buildHelper/channels.json @@ -7,7 +7,7 @@ }, { "name": "preview", - "path": "release/7-4", + "path": "release/7-5", "tagPrefix": "preview", "pwshInstallVersion": "7-preview", "packageTag": "-preview" From 5a68cf2b35ee101d1563e40f9ebbf2fc0a178967 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 16 Nov 2023 09:51:22 -0800 Subject: [PATCH 2/3] Update mariner 7-4 packages to use dotnet from PMC --- release/7-4/mariner2-arm64/docker/Dockerfile | 156 +++++++++-------- release/7-4/mariner2/docker/Dockerfile | 166 +++++++++---------- 2 files changed, 164 insertions(+), 158 deletions(-) diff --git a/release/7-4/mariner2-arm64/docker/Dockerfile b/release/7-4/mariner2-arm64/docker/Dockerfile index de5c18ddc..2b7d76ac9 100644 --- a/release/7-4/mariner2-arm64/docker/Dockerfile +++ b/release/7-4/mariner2-arm64/docker/Dockerfile @@ -1,74 +1,90 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -FROM mcr.microsoft.com/cbl-mariner/base/core:2.0.20221222-arm64 AS installer-env - -# Define Args for the needed to add the package -ARG PS_VERSION=7.4.0-preview.1 -ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-arm64.tar.gz -ARG 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/cache/tdnf \ - tdnf update -y \ - && tdnf install -y ca-certificates wget tar - -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 powershell.tar.gz -RUN tar zxf /tmp/powershell.tar.gz -C ${PS_INSTALL_FOLDER} - -FROM mcr.microsoft.com/cbl-mariner/base/core:2.0.20221222-arm64 AS final-image - -# Define Args and Env needed to create links -ARG PS_INSTALL_VERSION=7-preview -ARG PS_VERSION=7.4.0-preview.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-arm64v7-Mariner-2 - -# 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/cache/tdnf,rw \ - tdnf update -y \ - && tdnf install -y icu less openssh-clients ca-certificates dotnet-runtime-7.0 \ - && tdnf upgrade -y \ - && tdnf clean all - - # 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 \ - && ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview +FROM --platform=linux/arm64 mcr.microsoft.com/cbl-mariner/base/core:2.0 AS setup-tdnf-repa + + RUN --mount=type=cache,target=/var/cache/tdnf \ + tdnf install -y mariner-repos-microsoft-preview \ + && tdnf makecache + +# Download packages into a container so they don't take up space in the final stage +FROM setup-tdnf-repa AS installer-env + + # Define Args for the needed to add the package + ARG PS_VERSION=7.4.0 + ARG PACKAGE_VERSION=7.4.0 + ARG PS_PACKAGE=powershell-${PACKAGE_VERSION}-1.cm.aarch64.rpm + ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} + ARG PS_INSTALL_VERSION=7 + + # Download the Linux tar.gz and save it + ADD ${PS_PACKAGE_URL} /tmp/powershell.rpm + + RUN --mount=type=cache,target=/var/cache/tdnf \ + tdnf install -y \ + wget \ + awk \ + tar \ + ca-certificates + + RUN echo ${PS_PACKAGE_URL} + +# Start a new stage so we lose all the package download layers from the final image +FROM setup-tdnf-repa AS powershell + + ARG PS_VERSION=7.4.0 + ARG PS_INSTALL_VERSION=7 + + # Define Args and Env needed to create links + 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-Mariner-2.0 + + RUN --mount=type=cache,target=/var/cache/tdnf \ + # install dependencies + tdnf install -y \ + # required for localization + icu \ + # required for help in PowerShell + less \ + # required for SSH + openssh-clients \ + dotnet-runtime-8.0 \ + ca-certificates + + # Install dependencies and clean up + RUN --mount=type=cache,target=/var/cache/tdnf \ + tdnf upgrade -y \ + # clean cached data + && tdnf clean all + + RUN --mount=type=cache,target=/var/cache/tdnf,rw \ + --mount=from=installer-env,target=/mnt/rpm,source=/tmp \ + rpm -i --nodeps /mnt/rpm/powershell.rpm -# Use PowerShell as the default shell -# Use array to avoid Docker prepending /bin/sh -c -CMD [ "pwsh" ] + # Create the pwsh symbolic link that points to powershell + RUN if [ -f "/opt/microsoft/powershell/7-preview/pwsh" ]; then ln -sf /opt/microsoft/powershell/7-preview/pwsh /usr/bin/pwsh; fi + + # intialize powershell module cache + # and disable telemetry for this ONE session + RUN export POWERSHELL_TELEMETRY_OPTOUT=1 \ + && pwsh \ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" + + # Use PowerShell as the default shell + # Use array to avoid Docker prepending /bin/sh -c + CMD [ "pwsh" ] diff --git a/release/7-4/mariner2/docker/Dockerfile b/release/7-4/mariner2/docker/Dockerfile index e50f17aed..2a79c2a79 100644 --- a/release/7-4/mariner2/docker/Dockerfile +++ b/release/7-4/mariner2/docker/Dockerfile @@ -3,99 +3,89 @@ FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 AS setup-tdnf-repa -RUN --mount=type=cache,target=/var/cache/tdnf \ - tdnf install -y mariner-repos-microsoft-preview \ - && tdnf makecache + RUN --mount=type=cache,target=/var/cache/tdnf \ + tdnf install -y mariner-repos-microsoft-preview \ + && tdnf makecache -# Move to +# Download packages into a container so they don't take up space in the final stage FROM setup-tdnf-repa AS installer-env -# Define Args for the needed to add the package -ARG PS_VERSION=7.3.0-preview.8 -ARG PACKAGE_VERSION=7.3.0_preview.8 -ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.cm.x86_64.rpm -ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} -ARG PS_INSTALL_VERSION=7-preview - -# Download the Linux tar.gz and save it -ADD ${PS_PACKAGE_URL} /tmp/powershell.rpm - -RUN --mount=type=cache,target=/var/cache/tdnf \ - tdnf install -y \ - wget \ - awk \ - tar \ - ca-certificates + # Define Args for the needed to add the package + ARG PS_VERSION=7.3.0-preview.8 + ARG PACKAGE_VERSION=7.3.0_preview.8 + ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.cm.x86_64.rpm + ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE} + ARG PS_INSTALL_VERSION=7-preview + + # Download the Linux tar.gz and save it + ADD ${PS_PACKAGE_URL} /tmp/powershell.rpm -RUN --mount=type=cache,target=/var/cache/tdnf \ - --mount=type=cache,target=/installTmp \ - cd /installTmp \ - && wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \ - && chmod +x ./dotnet-install.sh \ - && ./dotnet-install.sh -Channel 8.0 -Quality preview -Runtime dotnet -InstallDir /usr/share/dotnet + RUN --mount=type=cache,target=/var/cache/tdnf \ + tdnf install -y \ + wget \ + awk \ + tar \ + ca-certificates -RUN echo ${PS_PACKAGE_URL} + RUN echo ${PS_PACKAGE_URL} -# Start a new stage so we lose all the tar.gz layers from the final image +# Start a new stage so we lose all the package download layers from the final image FROM setup-tdnf-repa AS powershell -ARG PS_VERSION=7.3.0-preview.8 -ARG PS_INSTALL_VERSION=7-preview - -# Define Args and Env needed to create links -ARG PS_INSTALL_VERSION=7-preview -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-Mariner-2.0 - -RUN --mount=type=cache,target=/var/cache/tdnf \ - # install dependencies - tdnf install -y \ - # required for localization - icu \ - # required for help in PowerShell - less \ - # required for SSH - openssh-clients \ - ca-certificates - -# Install dependencies and clean up -RUN --mount=type=cache,target=/var/cache/tdnf \ - tdnf upgrade -y \ - # clean cached data - && tdnf clean all - -COPY --from=installer-env /usr/share/dotnet /usr/share/dotnet - -RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet - -RUN --mount=type=cache,target=/var/cache/tdnf,rw \ - --mount=from=installer-env,target=/mnt/rpm,source=/tmp \ - rpm -i --nodeps /mnt/rpm/powershell.rpm - -# Create the pwsh symbolic link that points to powershell -RUN if [ -f "/opt/microsoft/powershell/7-preview/pwsh" ]; then ln -sf /opt/microsoft/powershell/7-preview/pwsh /usr/bin/pwsh; fi - -# intialize powershell module cache -# and disable telemetry for this ONE session -RUN export POWERSHELL_TELEMETRY_OPTOUT=1 \ - && pwsh \ - -NoLogo \ - -NoProfile \ - -Command " \ - \$ErrorActionPreference = 'Stop' ; \ - \$ProgressPreference = 'SilentlyContinue' ; \ - while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ - Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ - Start-Sleep -Seconds 6 ; \ - }" - -# Use PowerShell as the default shell -# Use array to avoid Docker prepending /bin/sh -c -CMD [ "pwsh" ] + ARG PS_VERSION=7.3.0-preview.8 + ARG PS_INSTALL_VERSION=7-preview + + # Define Args and Env needed to create links + ARG PS_INSTALL_VERSION=7-preview + 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-Mariner-2.0 + + RUN --mount=type=cache,target=/var/cache/tdnf \ + # install dependencies + tdnf install -y \ + # required for localization + icu \ + # required for help in PowerShell + less \ + # required for SSH + openssh-clients \ + dotnet-runtime-8.0 \ + ca-certificates + + # Install dependencies and clean up + RUN --mount=type=cache,target=/var/cache/tdnf \ + tdnf upgrade -y \ + # clean cached data + && tdnf clean all + + RUN --mount=type=cache,target=/var/cache/tdnf,rw \ + --mount=from=installer-env,target=/mnt/rpm,source=/tmp \ + rpm -i --nodeps /mnt/rpm/powershell.rpm + + # Create the pwsh symbolic link that points to powershell + RUN if [ -f "/opt/microsoft/powershell/7-preview/pwsh" ]; then ln -sf /opt/microsoft/powershell/7-preview/pwsh /usr/bin/pwsh; fi + + # intialize powershell module cache + # and disable telemetry for this ONE session + RUN export POWERSHELL_TELEMETRY_OPTOUT=1 \ + && pwsh \ + -NoLogo \ + -NoProfile \ + -Command " \ + \$ErrorActionPreference = 'Stop' ; \ + \$ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + Start-Sleep -Seconds 6 ; \ + }" + + # Use PowerShell as the default shell + # Use array to avoid Docker prepending /bin/sh -c + CMD [ "pwsh" ] From 3e86adf9bfbe213fed844ecdc21812931cec2136 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 16 Nov 2023 10:15:21 -0800 Subject: [PATCH 3/3] update the json to match the package --- release/7-4/mariner2-arm64/meta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/7-4/mariner2-arm64/meta.json b/release/7-4/mariner2-arm64/meta.json index c586b4a90..69ddf55cc 100644 --- a/release/7-4/mariner2-arm64/meta.json +++ b/release/7-4/mariner2-arm64/meta.json @@ -1,7 +1,7 @@ { "IsLinux" : true, "UseLinuxVersion": false, - "PackageFormat": "powershell-${PS_VERSION}-linux-arm64.tar.gz", + "PackageFormat": "powershell-${PS_VERSION}-1.cm.aarch64.rpm", "osVersion": "Mariner 2.0 ARM 64v7", "SkipGssNtlmSspTests": true, "ShortDistroName": "mariner",