Skip to content

Commit 99ed21a

Browse files
gngeorgievggeorgiev-gitlabTravisEz13
authored
Add alpine 3.13.6 images (#575)
Co-authored-by: ggeorgiev_ <ggeorgiev@gitlab.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
1 parent 2b4ca76 commit 99ed21a

File tree

9 files changed

+327
-2
lines changed

9 files changed

+327
-2
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ version: 2
22

33
# update_schedule: live is not supported by docker
44

5-
updates:
65
- package-ecosystem: "docker"
7-
directory: "/release/preview/alpine312/docker"
6+
directory: "/release/preview/alpine313/docker"
87
schedule:
98
interval: "weekly"
109

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# Docker image file that describes an Alpine3.13 image with PowerShell installed from .tar.gz file(s)
5+
6+
FROM alpine:3.13.6 AS installer-env
7+
8+
# Define Args for the needed to add the package
9+
ARG PS_VERSION=7.0.0-preview.1
10+
ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-alpine-x64.tar.gz
11+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
12+
ARG PS_INSTALL_VERSION=7-preview
13+
14+
# Download the Linux tar.gz and save it
15+
ADD ${PS_PACKAGE_URL} /tmp/linux.tar.gz
16+
17+
# define the folder we will be installing PowerShell to
18+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION
19+
20+
# Create the install folder
21+
RUN mkdir -p ${PS_INSTALL_FOLDER}
22+
23+
# Unzip the Linux tar.gz
24+
RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v
25+
26+
# Start a new stage so we lose all the tar.gz layers from the final image
27+
FROM alpine:3.13.6
28+
29+
# Copy only the files we need from the previous stage
30+
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
31+
32+
# Define Args and Env needed to create links
33+
ARG PS_INSTALL_VERSION=7-preview
34+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
35+
\
36+
# Define ENVs for Localization/Globalization
37+
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
38+
LC_ALL=en_US.UTF-8 \
39+
LANG=en_US.UTF-8 \
40+
# set a fixed location for the Module analysis cache
41+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
42+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Alpine-3.13
43+
44+
# Install dotnet dependencies and ca-certificates
45+
RUN apk add --no-cache \
46+
ca-certificates \
47+
less \
48+
\
49+
# PSReadline/console dependencies
50+
ncurses-terminfo-base \
51+
\
52+
# .NET Core dependencies
53+
krb5-libs \
54+
libgcc \
55+
libintl \
56+
libssl1.1 \
57+
libstdc++ \
58+
tzdata \
59+
userspace-rcu \
60+
zlib \
61+
icu-libs \
62+
&& apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \
63+
lttng-ust \
64+
\
65+
# PowerShell remoting over SSH dependencies
66+
openssh-client \
67+
\
68+
# Create the pwsh symbolic link that points to powershell
69+
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
70+
\
71+
# Create the pwsh-preview symbolic link that points to powershell
72+
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \
73+
# Give all user execute permissions and remove write permissions for others
74+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
75+
# intialize powershell module cache
76+
# and disable telemetry
77+
&& export POWERSHELL_TELEMETRY_OPTOUT=1 \
78+
&& pwsh \
79+
-NoLogo \
80+
-NoProfile \
81+
-Command " \
82+
\$ErrorActionPreference = 'Stop' ; \
83+
\$ProgressPreference = 'SilentlyContinue' ; \
84+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
85+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
86+
Start-Sleep -Seconds 6 ; \
87+
}"
88+
89+
CMD [ "pwsh" ]

release/preview/alpine313/meta.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"PackageFormat": "powershell-${PS_VERSION}-linux-alpine-x64.tar.gz",
5+
"osVersion": "Alpine 3.13",
6+
"tagTemplates": [
7+
"#psversion#-alpine-#shorttag#-#fulltag#",
8+
"preview-alpine-#shorttag#"
9+
],
10+
"shortTags": [
11+
{"Tag": "3.13"}
12+
],
13+
"SkipGssNtlmSspTests": true,
14+
"SubImage": "test-deps",
15+
"TestProperties": {
16+
"size": 221
17+
}
18+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Docker image file that describes an Alpine image with PowerShell and test dependencies
2+
3+
ARG BaseImage=mcr.microsoft.com/powershell:alpine-3.13.6
4+
5+
FROM node:14.3.0-alpine as node
6+
7+
# Do nothing, just added to borrow the already built node files.
8+
9+
FROM ${BaseImage}
10+
11+
ENV NODE_VERSION=14.3.0 \
12+
YARN_VERSION=1.22.4 \
13+
NVM_DIR="/root/.nvm" \
14+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-3.13
15+
16+
# workaround for Alpine to run in Azure DevOps
17+
ENV NODE_NO_WARNINGS=1
18+
19+
# Copy node and yarn into image
20+
COPY --from=node /usr/local/bin/node /usr/local/bin/node
21+
COPY --from=node /opt/yarn-v${YARN_VERSION} /opt/yarn-v${YARN_VERSION}
22+
23+
RUN apk add --no-cache --virtual .pipeline-deps readline linux-pam \
24+
&& apk add \
25+
bash \
26+
sudo \
27+
shadow \
28+
openssl \
29+
curl \
30+
&& apk del .pipeline-deps \
31+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
32+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg
33+
34+
LABEL com.azure.dev.pipelines.agent.handler.node.path="/usr/local/bin/node"
35+
36+
# Use PowerShell as the default shell
37+
# Use array to avoid Docker prepending /bin/sh -c
38+
CMD [ "pwsh" ]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"SkipGssNtlmSspTests": true,
5+
"osVersion": "Alpine 3.13",
6+
"tagTemplates": [
7+
"#tag#"
8+
],
9+
"OptionalTests": [
10+
"test-deps",
11+
"test-deps-musl"
12+
],
13+
"TestProperties": {
14+
"size": 295
15+
},
16+
"TagMapping": {
17+
"^.*-alpine-3.13$" : "preview-alpine-3.13"
18+
}
19+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# Docker image file that describes an Alpine3.13 image with PowerShell installed from .tar.gz file(s)
5+
6+
FROM alpine:3.13.6 AS installer-env
7+
8+
# Define Args for the needed to add the package
9+
ARG PS_VERSION=7.0.0
10+
ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-alpine-x64.tar.gz
11+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
12+
ARG PS_INSTALL_VERSION=7
13+
14+
# Download the Linux tar.gz and save it
15+
ADD ${PS_PACKAGE_URL} /tmp/linux.tar.gz
16+
17+
# define the folder we will be installing PowerShell to
18+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION
19+
20+
# Create the install folder
21+
RUN mkdir -p ${PS_INSTALL_FOLDER}
22+
23+
# Unzip the Linux tar.gz
24+
RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v
25+
26+
# Start a new stage so we lose all the tar.gz layers from the final image
27+
FROM alpine:3.13.6
28+
29+
# Copy only the files we need from the previous stage
30+
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
31+
32+
# Define Args and Env needed to create links
33+
ARG PS_INSTALL_VERSION=7
34+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
35+
\
36+
# Define ENVs for Localization/Globalization
37+
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
38+
LC_ALL=en_US.UTF-8 \
39+
LANG=en_US.UTF-8 \
40+
# set a fixed location for the Module analysis cache
41+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
42+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Alpine-3.13
43+
44+
# Install dotnet dependencies and ca-certificates
45+
RUN apk add --no-cache \
46+
ca-certificates \
47+
less \
48+
\
49+
# PSReadline/console dependencies
50+
ncurses-terminfo-base \
51+
\
52+
# .NET Core dependencies
53+
krb5-libs \
54+
libgcc \
55+
libintl \
56+
libssl1.1 \
57+
libstdc++ \
58+
tzdata \
59+
userspace-rcu \
60+
zlib \
61+
icu-libs \
62+
&& apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \
63+
lttng-ust \
64+
\
65+
# PowerShell remoting over SSH dependencies
66+
openssh-client \
67+
\
68+
# Create the pwsh symbolic link that points to powershell
69+
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
70+
\
71+
# Give all user execute permissions and remove write permissions for others
72+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
73+
# intialize powershell module cache
74+
# and disable telemetry
75+
&& export POWERSHELL_TELEMETRY_OPTOUT=1 \
76+
&& pwsh \
77+
-NoLogo \
78+
-NoProfile \
79+
-Command " \
80+
\$ErrorActionPreference = 'Stop' ; \
81+
\$ProgressPreference = 'SilentlyContinue' ; \
82+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
83+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
84+
Start-Sleep -Seconds 6 ; \
85+
}"
86+
87+
CMD [ "pwsh" ]

release/stable/alpine313/meta.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"PackageFormat": "powershell-${PS_VERSION}-linux-alpine-x64.tar.gz",
5+
"osVersion": "Alpine 3.13",
6+
"tagTemplates": [
7+
"#psversion#-alpine-#shorttag#-#fulltag#",
8+
"alpine-#shorttag#"
9+
],
10+
"shortTags": [
11+
{"Tag": "3.13"}
12+
],
13+
"SkipGssNtlmSspTests": true,
14+
"SubImage": "test-deps",
15+
"TestProperties": {
16+
"size": 221
17+
}
18+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Docker image file that describes an Alpine image with PowerShell and test dependencies
2+
3+
ARG BaseImage=mcr.microsoft.com/powershell:alpine-3.13.6
4+
5+
FROM node:14.3.0-alpine as node
6+
7+
# Do nothing, just added to borrow the already built node files.
8+
9+
FROM ${BaseImage}
10+
11+
ENV NODE_VERSION=14.3.0 \
12+
YARN_VERSION=1.22.4 \
13+
NVM_DIR="/root/.nvm" \
14+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-3.13
15+
16+
# workaround for Alpine to run in Azure DevOps
17+
ENV NODE_NO_WARNINGS=1
18+
19+
# Copy node and yarn into image
20+
COPY --from=node /usr/local/bin/node /usr/local/bin/node
21+
COPY --from=node /opt/yarn-v${YARN_VERSION} /opt/yarn-v${YARN_VERSION}
22+
23+
RUN apk add --no-cache --virtual .pipeline-deps readline linux-pam \
24+
&& apk add \
25+
bash \
26+
sudo \
27+
shadow \
28+
openssl \
29+
curl \
30+
&& apk del .pipeline-deps \
31+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
32+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg
33+
34+
LABEL com.azure.dev.pipelines.agent.handler.node.path="/usr/local/bin/node"
35+
36+
# Use PowerShell as the default shell
37+
# Use array to avoid Docker prepending /bin/sh -c
38+
CMD [ "pwsh" ]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"SkipGssNtlmSspTests": true,
5+
"osVersion": "Alpine 3.13",
6+
"tagTemplates": [
7+
"#tag#"
8+
],
9+
"OptionalTests": [
10+
"test-deps",
11+
"test-deps-musl"
12+
],
13+
"TestProperties": {
14+
"size": 295
15+
},
16+
"TagMapping": {
17+
"^.*-alpine-3.13$" : "preview-alpine-3.13"
18+
}
19+
}

0 commit comments

Comments
 (0)