-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Debian 8, 9 and OpenSuse 42.3 images (#47)
- Add test to verify local of images - fix various typos
- Loading branch information
1 parent
bd2e0a1
commit 05ad055
Showing
28 changed files
with
348 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Development | ||
|
||
## Adding new docker image | ||
## Adding new Docker image | ||
|
||
### Folder structure | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,8 @@ RUN mkdir -p ${PS_INSTALL_FOLDER} | |
# Unzip the Linux tar.gz | ||
RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} | ||
|
||
# TODO: once the official build produces a full package for Alpine, remove this overlay of the apline files | ||
# Download the apline powershell .tar.gz package | ||
# TODO: once the official build produces a full package for Alpine, remove this overlay of the Alpine files | ||
# Download the Alpine powershell .tar.gz package | ||
ADD ${PS_PACKAGE_MUSL_URL} /tmp/alpine.tar.gz | ||
|
||
# Extract the Alpine tar.gz | ||
|
@@ -79,7 +79,8 @@ RUN apk add --no-cache \ | |
ARG PS_VERSION=6.1.0 | ||
ARG IMAGE_NAME=mcr.microsoft.com/powershell:alpine-3.8 | ||
ARG VCS_REF="none" | ||
# Add label last as it's just metadata and usere a lot a parameters | ||
|
||
# Add label last as it's just metadata and uses a lot of parameters | ||
LABEL maintainer="PowerShell Team <[email protected]>" \ | ||
readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" \ | ||
description="This Dockerfile will install the latest release of PowerShell." \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Docker image file that describes an Debian 8 image with PowerShell installed from Microsoft APT Repo | ||
ARG fromTag=jessie | ||
|
||
FROM debian:${fromTag} | ||
|
||
ARG PS_VERSION=6.1.0 | ||
ARG PS_VERSION_POSTFIX=-1.debian.8 | ||
ARG IMAGE_NAME=mcr.microsoft.com/powershell:debian-jessie | ||
ARG VCS_REF="none" | ||
|
||
# Install dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
apt-utils \ | ||
ca-certificates \ | ||
curl \ | ||
apt-transport-https \ | ||
locales | ||
|
||
# Setup the locale | ||
ENV LANG en_US.UTF-8 | ||
ENV LC_ALL $LANG | ||
RUN locale-gen $LANG && update-locale | ||
|
||
# Import the public repository GPG keys | ||
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | ||
|
||
# Register the Microsoft Product feed | ||
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-jessie-prod jessie main" > /etc/apt/sources.list.d/microsoft.list | ||
|
||
# Install powershell from Microsoft Repo | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
powershell=${PS_VERSION}${PS_VERSION_POSTFIX} \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Use PowerShell as the default shell | ||
# Use array to avoid Docker prepending /bin/sh -c | ||
CMD [ "pwsh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
# return objects representing the tags we need to base the debian image on | ||
|
||
# The versions of debian we care about | ||
$shortTags = @('jessie') | ||
|
||
$parent = Join-Path -Path $PSScriptRoot -ChildPath '..' | ||
$repoRoot = Join-Path -path (Join-Path -Path $parent -ChildPath '..') -ChildPath '..' | ||
$modulePath = Join-Path -Path $repoRoot -ChildPath 'tools\getDockerTags' | ||
Import-Module $modulePath | ||
|
||
Get-DockerTags -ShortTags $shortTags -Image "debian" -FullTagFilter 'jessie-\d{8}[\.\d{1}]?' -AlternativeShortTag '8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"IsLinux" : true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ | ||
"#psversion#-debian-#tag#", | ||
"debian-#shorttag#" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Docker image file that describes an Debian 9 image with PowerShell installed from Microsoft APT Repo | ||
ARG fromTag=stretch | ||
|
||
FROM debian:${fromTag} | ||
|
||
ARG PS_VERSION=6.1.0 | ||
ARG PS_VERSION_POSTFIX=-1.debian.9 | ||
ARG IMAGE_NAME=mcr.microsoft.com/powershell:debian-jessie | ||
ARG VCS_REF="none" | ||
|
||
# Install dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
apt-utils \ | ||
ca-certificates \ | ||
curl \ | ||
apt-transport-https \ | ||
locales \ | ||
gnupg | ||
|
||
# Setup the locale | ||
ENV LANG en_US.UTF-8 | ||
ENV LC_ALL $LANG | ||
RUN locale-gen $LANG && update-locale | ||
|
||
# Import the public repository GPG keys | ||
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | ||
|
||
# Register the Microsoft Product feed | ||
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/microsoft.list | ||
|
||
# Install powershell from Microsoft Repo | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
powershell=${PS_VERSION}${PS_VERSION_POSTFIX} \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Use PowerShell as the default shell | ||
# Use array to avoid Docker prepending /bin/sh -c | ||
CMD [ "pwsh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
# return objects representing the tags we need to base the debian image on Docker | ||
|
||
# The versions of debian we care about | ||
$shortTags = @('stretch') | ||
|
||
$parent = Join-Path -Path $PSScriptRoot -ChildPath '..' | ||
$repoRoot = Join-Path -path (Join-Path -Path $parent -ChildPath '..') -ChildPath '..' | ||
$modulePath = Join-Path -Path $repoRoot -ChildPath 'tools\getDockerTags' | ||
Import-Module $modulePath | ||
|
||
Get-DockerTags -ShortTags $shortTags -Image "debian" -FullTagFilter 'stretch-\d{8}[\.\d{1}]?' -AlternativeShortTag '8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"IsLinux" : true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ | ||
"#psversion#-debian-#tag#", | ||
"debian-#shorttag#" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Docker image file that describes an OpenSuse 42.3 image with PowerShell installed from tar.gz | ||
# Implemented in two stages, one that downloads and uncompresses the tar.gz | ||
# The next stage simply copies the files from the first stage, | ||
# effectively removing the tar.gz and packages that are not needed from the final image. | ||
|
||
# Define arg(s) needed for the From statement | ||
ARG fromTag=42.3 | ||
|
||
FROM opensuse:${fromTag} AS installer-env | ||
|
||
|
||
# Define Args for the needed to add the package | ||
ARG PS_VERSION=6.1.0 | ||
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=6 | ||
|
||
# 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} | ||
|
||
# Install dependencies | ||
RUN zypper --non-interactive update --skip-interactive | ||
|
||
RUN zypper --non-interactive install \ | ||
tar | ||
|
||
# downoad the Linux tar.gz and save it | ||
ADD ${PS_PACKAGE_URL} /tmp/linux.tar.gz | ||
|
||
# Unzip the Linux tar.gz | ||
RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} | ||
|
||
# ------ Second stage ------ | ||
# Start a new stage so we loose all the tar.gz layers from the final image | ||
FROM opensuse:${fromTag} | ||
|
||
# Install dependencies | ||
RUN zypper --non-interactive update --skip-interactive \ | ||
&& zypper --non-interactive install \ | ||
glibc-locale \ | ||
glibc-i18ndata \ | ||
libunwind \ | ||
libicu \ | ||
openssl | ||
|
||
# Copy only the files we need from the previous stag | ||
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"] | ||
|
||
# Define Args and Env needed to create links | ||
ARG PS_INSTALL_VERSION=6 | ||
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 | ||
|
||
RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG \ | ||
\ | ||
# Create the pwsh symbolic link that points to powershell | ||
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh | ||
|
||
# Define args needed only for the labels | ||
ARG PS_VERSION=6.1.0 | ||
ARG IMAGE_NAME=mcr.microsoft.com/powershell:opensuse-42.3 | ||
ARG VCS_REF="none" | ||
|
||
# Add label last as it's just metadata and uses a lot of parameters | ||
LABEL maintainer="PowerShell Team <[email protected]>" \ | ||
readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" \ | ||
description="This Dockerfile will install the latest release of PowerShell." \ | ||
org.label-schema.usage="https://github.com/PowerShell/PowerShell/tree/master/docker#run-the-docker-image-you-built" \ | ||
org.label-schema.url="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" \ | ||
org.label-schema.vcs-url="https://github.com/PowerShell/PowerShell-Docker" \ | ||
org.label-schema.name="powershell" \ | ||
org.label-schema.vendor="PowerShell" \ | ||
org.label-schema.vcs-ref=${VCS_REF} \ | ||
org.label-schema.version=${PS_VERSION} \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.docker.cmd="docker run ${IMAGE_NAME} pwsh -c '$psversiontable'" \ | ||
org.label-schema.docker.cmd.devel="docker run ${IMAGE_NAME}" \ | ||
org.label-schema.docker.cmd.test="docker run ${IMAGE_NAME} pwsh -c Invoke-Pester" \ | ||
org.label-schema.docker.cmd.help="docker run ${IMAGE_NAME} pwsh -c Get-Help" | ||
|
||
CMD [ "pwsh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
# return objects representing the tags we need to base the opensuse image on Docker | ||
|
||
# The versions of opensuse we care about | ||
$shortTags = @('42.3') | ||
|
||
$parent = Join-Path -Path $PSScriptRoot -ChildPath '..' | ||
$repoRoot = Join-Path -path (Join-Path -Path $parent -ChildPath '..') -ChildPath '..' | ||
$modulePath = Join-Path -Path $repoRoot -ChildPath 'tools\getDockerTags' | ||
Import-Module $modulePath | ||
|
||
Get-DockerTags -ShortTags $shortTags -Image "opensuse" -FullTagFilter '^42.3$' -OnlyShortTags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"IsLinux" : true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ | ||
"#psversion#-opensuse-#tag#", | ||
"opensuse-#shorttag#" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.