Skip to content

Commit 7370f2f

Browse files
authored
add ubi8.3 image (#624)
1 parent a9f97ef commit 7370f2f

File tree

8 files changed

+246
-0
lines changed

8 files changed

+246
-0
lines changed

Diff for: release/preview/ubi83/docker/Dockerfile

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# syntax = docker/dockerfile:1.2
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
FROM registry.access.redhat.com/ubi8/ubi:8.3 AS installer-env
5+
ARG PS_VERSION=7.3.0-preview.1
6+
ARG PACKAGE_VERSION=7.3.0_preview.1
7+
ARG PS_PACKAGE=powershell-preview-${PACKAGE_VERSION}-1.rh.x86_64.rpm
8+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
9+
ARG PS_INSTALL_VERSION=7
10+
11+
# define the folder we will be installing PowerShell to
12+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/${PS_INSTALL_VERSION}-preview
13+
# Install powershell
14+
# create folder at install location
15+
RUN curl -sSL ${PS_PACKAGE_URL} -o /tmp/linux.rpm
16+
# start new stage so that the tar.gz layers are left behind in multi-stage build
17+
FROM registry.access.redhat.com/ubi8/ubi:8.3 AS final-image
18+
ARG PS_VERSION=7.3.0-preview.1
19+
ARG PS_INSTALL_VERSION=7
20+
21+
RUN --mount=type=cache,target=/var/cache/yum,rw \
22+
yum update -y \
23+
&& yum install -y \
24+
less \
25+
ncurses \
26+
openssh-clients \
27+
glibc-locale-source \
28+
glibc-langpack-en \
29+
libicu \
30+
&& yum upgrade-minimal -y --security \
31+
&& yum clean all
32+
RUN --mount=type=cache,target=/var/cache/yum,rw \
33+
--mount=from=installer-env,target=/mnt/rpm,source=/tmp \
34+
yum update -y \
35+
&& yum localinstall -y \
36+
/mnt/rpm/linux.rpm \
37+
&& yum upgrade-minimal -y --security \
38+
&& yum clean all
39+
# Define ENVs for Localization/Globalization
40+
ENV PS_INSTALL_VERSION=7 \
41+
PS_INSTALL_FOLDER=/opt/microsoft/powershell/${PS_INSTALL_VERSION}-preview \
42+
LC_ALL=en_US.UTF-8 \
43+
LANG=en_US.UTF-8 \
44+
# set a fixed location for the Module analysis cache
45+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
46+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-UBI-8.3
47+
48+
RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG \
49+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
50+
&& ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
51+
&& ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \
52+
&& export POWERSHELL_TELEMETRY_OPTOUT=1 \
53+
&& pwsh\
54+
-NoLogo \
55+
-NoProfile \
56+
-Command " \
57+
\$ErrorActionPreference = 'Stop' ; \
58+
\$ProgressPreference = 'SilentlyContinue' ; \
59+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
60+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
61+
Start-Sleep -Seconds 6 ; \
62+
}"
63+
# Use PowerShell as the default shell
64+
# Use array to avoid Docker prepending /bin/sh -c
65+
CMD ["pwsh-preview"]

Diff for: release/preview/ubi83/meta.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"PackageFormat": "powershell${previewTag}-${PS_VERSION}-1.rh.x86_64.rpm",
5+
"SkipGssNtlmSspTests": true,
6+
"osVersion": "Universal Base Image 8.3",
7+
"FullRepository": "powershell/rhel",
8+
"tagTemplates": [
9+
"preview-ubi-#shorttag#"
10+
],
11+
"shortTags": [
12+
{"Tag": "8.3"}
13+
],
14+
"SubImage": "test-deps",
15+
"TestProperties": {
16+
"size": 726
17+
}
18+
}

Diff for: release/preview/ubi83/test-deps/docker/Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Docker image file that describes an CentOS7 image with PowerShell installed from Microsoft YUM Repo
2+
ARG BaseImage=mcr.microsoft.com/powershell:ubi-8.3
3+
4+
FROM ${BaseImage}
5+
6+
# Install dependencies and clean up
7+
RUN yum install -y \
8+
sudo \
9+
wget \
10+
openssl \
11+
hostname \
12+
iputils \
13+
procps-ng \
14+
&& yum clean all \
15+
&& rm -rf /var/cache/yum
16+
17+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-ubi-8.3
18+
19+
# Use PowerShell as the default shell
20+
# Use array to avoid Docker prepending /bin/sh -c
21+
CMD [ "pwsh" ]

Diff for: release/preview/ubi83/test-deps/meta.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"osVersion": "Universal Base Image 8.3",
5+
"SkipGssNtlmSspTests": true,
6+
"shortTags": [
7+
{"Tag": "8.3"}
8+
],
9+
"tagTemplates": [
10+
"preview-ubi-#shorttag#"
11+
],
12+
"FullRepository": "powershell/rhel/test-deps",
13+
"OptionalTests": [
14+
"test-deps"
15+
],
16+
"TestProperties": {
17+
"size": 750
18+
}
19+
}

Diff for: release/stable/ubi83/docker/Dockerfile

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# syntax = docker/dockerfile:1.2
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
FROM registry.access.redhat.com/ubi8/ubi:8.3 AS installer-env
5+
ARG PS_VERSION=7.2.2
6+
ARG PS_PACKAGE=powershell-${PS_VERSION}-1.rh.x86_64.rpm
7+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
8+
ARG PS_INSTALL_VERSION=7
9+
# define the folder we will be installing PowerShell to
10+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION
11+
# Install powershell
12+
# create folder at install location
13+
RUN curl -sSL ${PS_PACKAGE_URL} -o /tmp/linux.rpm
14+
# start new stage so that the tar.gz layers are left behind in multi-stage build
15+
FROM registry.access.redhat.com/ubi8/ubi:8.3 AS final-image
16+
ARG PS_VERSION=7.2.2
17+
ARG PS_INSTALL_VERSION=7
18+
19+
RUN --mount=type=cache,target=/var/cache/yum,rw \
20+
yum update -y \
21+
&& yum install -y \
22+
less \
23+
ncurses \
24+
openssh-clients \
25+
glibc-locale-source \
26+
glibc-langpack-en \
27+
libicu \
28+
&& yum upgrade-minimal -y --security \
29+
&& yum clean all
30+
RUN --mount=type=cache,target=/var/cache/yum,rw \
31+
--mount=from=installer-env,target=/mnt/rpm,source=/tmp \
32+
yum update -y \
33+
&& yum localinstall -y \
34+
/mnt/rpm/linux.rpm \
35+
&& yum upgrade-minimal -y --security \
36+
&& yum clean all
37+
# Define ENVs for Localization/Globalization
38+
ENV PS_INSTALL_VERSION=7 \
39+
PS_INSTALL_FOLDER=/opt/microsoft/powershell/${PS_INSTALL_VERSION} \
40+
LC_ALL=en_US.UTF-8 \
41+
LANG=en_US.UTF-8 \
42+
# set a fixed location for the Module analysis cache
43+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
44+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-UBI-8.3
45+
46+
RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG \
47+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
48+
&& ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
49+
&& ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \
50+
&& export POWERSHELL_TELEMETRY_OPTOUT=1 \
51+
&& pwsh\
52+
-NoLogo \
53+
-NoProfile \
54+
-Command " \
55+
\$ErrorActionPreference = 'Stop' ; \
56+
\$ProgressPreference = 'SilentlyContinue' ; \
57+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
58+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
59+
Start-Sleep -Seconds 6 ; \
60+
}"
61+
# Use PowerShell as the default shell
62+
# Use array to avoid Docker prepending /bin/sh -c
63+
CMD ["pwsh"]

Diff for: release/stable/ubi83/meta.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"PackageFormat": "powershell-${PS_VERSION}-1.rh.x86_64.rpm",
5+
"SkipGssNtlmSspTests": true,
6+
"osVersion": "Universal Base Image 8.3",
7+
"FullRepository": "powershell/rhel",
8+
"tagTemplates": [
9+
"#psversion#-ubi-#shorttag#",
10+
"ubi-#shorttag#"
11+
],
12+
"shortTags": [
13+
{"Tag": "8.3"}
14+
],
15+
"SubImage": "test-deps",
16+
"TestProperties": {
17+
"size": 725
18+
}
19+
}

Diff for: release/stable/ubi83/test-deps/docker/Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Docker image file that describes an CentOS7 image with PowerShell installed from Microsoft YUM Repo
2+
ARG BaseImage=mcr.microsoft.com/powershell:ubi-8.3
3+
4+
FROM ${BaseImage}
5+
6+
# Install dependencies and clean up
7+
RUN yum install -y \
8+
sudo \
9+
wget \
10+
openssl \
11+
hostname \
12+
iputils \
13+
procps-ng \
14+
&& yum clean all \
15+
&& rm -rf /var/cache/yum
16+
17+
ENV POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-ubi-8.3
18+
19+
# Use PowerShell as the default shell
20+
# Use array to avoid Docker prepending /bin/sh -c
21+
CMD [ "pwsh" ]

Diff for: release/stable/ubi83/test-deps/meta.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"osVersion": "Universal Base Image 8.3",
5+
"SkipGssNtlmSspTests": true,
6+
"shortTags": [
7+
{"Tag": "8.3"}
8+
],
9+
"tagTemplates": [
10+
"#psversion#-ubi-#shorttag#",
11+
"ubi-#shorttag#"
12+
],
13+
"FullRepository": "powershell/rhel/test-deps",
14+
"OptionalTests": [
15+
"test-deps"
16+
],
17+
"TestProperties": {
18+
"size": 750
19+
}
20+
}

0 commit comments

Comments
 (0)