Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions release/preview/alpine/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ 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
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/PSModuleAnalysisCache/ModuleAnalysisCache

# Install dotnet dependencies and ca-certificates
RUN apk add --no-cache \
Expand All @@ -67,12 +69,24 @@ RUN apk add --no-cache \
&& 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
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \
# intialize powershell module cache
&& pwsh \
-NoLogo \
-NoProfile \
-Command " \
\$ErrorActionPreference = 'Stop' ; \
\$ProgressPreference = 'SilentlyContinue' ; \
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
Start-Sleep -Seconds 6 ; \
}"

# Define args needed only for the labels
ARG PS_VERSION=6.2.0-preview.2
ARG IMAGE_NAME=mcr.microsoft.com/powershell:preview-alpine-3.8
ARG VCS_REF="none"

# Add label last as it's just metadata and uses a lot of parameters
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" \
Expand Down
17 changes: 15 additions & 2 deletions release/preview/centos7/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ ADD ${PS_PACKAGE_URL} /tmp/powershell.rpm
# Define ENVs for Localization/Globalization
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/PSModuleAnalysisCache/ModuleAnalysisCache

# Install dependencies and clean up
RUN yum install -y /tmp/powershell.rpm \
Expand All @@ -27,7 +29,18 @@ RUN yum install -y /tmp/powershell.rpm \
&& localedef --charmap=UTF-8 --inputfile=en_US $LANG \
# remove powershell package
&& rm /tmp/powershell.rpm \
&& ln -sf /opt/microsoft/powershell/6-preview/pwsh /usr/bin/pwsh
&& ln -sf /opt/microsoft/powershell/6-preview/pwsh /usr/bin/pwsh \
# intialize powershell module cache
&& pwsh \
-NoLogo \
-NoProfile \
-Command " \
\$ErrorActionPreference = 'Stop' ; \
\$ProgressPreference = 'SilentlyContinue' ; \
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
Start-Sleep -Seconds 6 ; \
}"

# Define args needed only for the labels
ARG VCS_REF="none"
Expand Down
87 changes: 87 additions & 0 deletions release/preview/debian8/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Docker image file that describes an Debian 8 image with PowerShell installed from Microsoft APT Repo
ARG fromTag=jessie
ARG imageRepo=debian


FROM ${imageRepo}:${fromTag} AS installer-env

ARG PS_VERSION=6.2.0-preview.3
ARG PS_PACKAGE=powershell-preview_${PS_VERSION}-1.debian.8_amd64.deb
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}

RUN echo ${PS_PACKAGE_URL}
# Download the Linux package and save it
ADD ${PS_PACKAGE_URL} /tmp/powershell.deb

# Define ENVs for Localization/Globalization
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
# required to remove gdebi on debian 8
Comment thread
TravisEz13 marked this conversation as resolved.
SUDO_FORCE_REMOVE=yes \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/PSModuleAnalysisCache/ModuleAnalysisCache

# Install dependencies and clean up
RUN apt-get update \
&& apt-get install -y \
# less is required for help in powershell
less \
# requied to setup the locale
locales \
# required for SSL
ca-certificates \
# simplifies deb file install
gdebi \
&& gdebi --n /tmp/powershell.deb \
# gdebi isn't needed anymore remove it
&& apt-get purge -y gdebi \
# remove any unused dependecies
&& apt-get autoremove -y \
# upgrade all packages
&& apt-get dist-upgrade -y \
# clean the cache
&& 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 \
# remove powershell package
&& rm /tmp/powershell.deb \
&& ln -sf /opt/microsoft/powershell/6-preview/pwsh /usr/bin/pwsh \
# intialize powershell module cache
&& pwsh \
-NoLogo \
-NoProfile \
-Command " \
\$ErrorActionPreference = 'Stop' ; \
\$ProgressPreference = 'SilentlyContinue' ; \
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
Start-Sleep -Seconds 6 ; \
}"

# Define args needed only for the labels
ARG VCS_REF="none"
ARG IMAGE_NAME=mcr.microsoft.com/powershell:debian-8

LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
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.version=${PS_VERSION} \
org.label-schema.schema-version="1.0" \
org.label-schema.vcs-ref=${VCS_REF} \
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"

# Use PowerShell as the default shell
# Use array to avoid Docker prepending /bin/sh -c
CMD [ "pwsh" ]
14 changes: 14 additions & 0 deletions release/preview/debian8/getLatestTag.ps1
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'
5 changes: 5 additions & 0 deletions release/preview/debian8/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"IsLinux" : true,
"UseLinuxVersion" : false,
"PackageFormat": "powershell-preview_${PS_VERSION}-1.debian.8_amd64.deb"
}
4 changes: 4 additions & 0 deletions release/preview/debian8/tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"#psversion#-debian-#tag#",
"preview-debian-#shorttag#"
]
77 changes: 77 additions & 0 deletions release/preview/debian9/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Docker image file that describes an Debian 9 image with PowerShell installed from Microsoft APT Repo
ARG fromTag=stretch
ARG imageRepo=debian


FROM ${imageRepo}:${fromTag} AS installer-env

ARG PS_VERSION=6.2.0-preview.3
ARG PS_PACKAGE=powershell-preview_${PS_VERSION}-1.debian.9_amd64.deb
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}

RUN echo ${PS_PACKAGE_URL}
# Download the Linux package and save it
ADD ${PS_PACKAGE_URL} /tmp/powershell.deb

# Define ENVs for Localization/Globalization
ENV 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=/PSModuleAnalysisCache/ModuleAnalysisCache

# Install dependencies and clean up
RUN apt-get update \
&& apt install -y /tmp/powershell.deb \
&& apt-get install -y \
# less is required for help in powershell
less \
# requied to setup the locale
locales \
# required for SSL
ca-certificates \
&& 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 \
# remove powershell package
&& rm /tmp/powershell.deb \
&& ln -sf /opt/microsoft/powershell/6-preview/pwsh /usr/bin/pwsh \
# intialize powershell module cache
&& pwsh \
-NoLogo \
-NoProfile \
-Command " \
\$ErrorActionPreference = 'Stop' ; \
\$ProgressPreference = 'SilentlyContinue' ; \
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
Start-Sleep -Seconds 6 ; \
}"

# Define args needed only for the labels
ARG VCS_REF="none"
ARG IMAGE_NAME=mcr.microsoft.com/powershell:debian-9

LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
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.version=${PS_VERSION} \
org.label-schema.schema-version="1.0" \
org.label-schema.vcs-ref=${VCS_REF} \
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"

# Use PowerShell as the default shell
# Use array to avoid Docker prepending /bin/sh -c
CMD [ "pwsh" ]
14 changes: 14 additions & 0 deletions release/preview/debian9/getLatestTag.ps1
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'
5 changes: 5 additions & 0 deletions release/preview/debian9/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"IsLinux" : true,
"UseLinuxVersion" : false,
"PackageFormat": "powershell-preview_${PS_VERSION}-1.debian.9_amd64.deb"
}
4 changes: 4 additions & 0 deletions release/preview/debian9/tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"#psversion#-debian-#tag#",
"preview-debian-#shorttag#"
]
17 changes: 15 additions & 2 deletions release/preview/fedora27/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ ADD ${PS_PACKAGE_URL} /tmp/powershell.rpm
# Define ENVs for Localization/Globalization
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/PSModuleAnalysisCache/ModuleAnalysisCache

# Install dependencies and clean up
RUN dnf install -y /tmp/powershell.rpm \
Expand All @@ -32,7 +34,18 @@ RUN dnf install -y /tmp/powershell.rpm \
&& localedef --charmap=UTF-8 --inputfile=en_US $LANG \
# remove powershell package
&& rm /tmp/powershell.rpm \
&& ln -sf /opt/microsoft/powershell/6-preview/pwsh /usr/bin/pwsh
&& ln -sf /opt/microsoft/powershell/6-preview/pwsh /usr/bin/pwsh \
# intialize powershell module cache
&& pwsh \
-NoLogo \
-NoProfile \
-Command " \
\$ErrorActionPreference = 'Stop' ; \
\$ProgressPreference = 'SilentlyContinue' ; \
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
Start-Sleep -Seconds 6 ; \
}"

# Define args needed only for the labels
ARG VCS_REF="none"
Expand Down
17 changes: 15 additions & 2 deletions release/preview/fedora28/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ ADD ${PS_PACKAGE_URL} /tmp/powershell.rpm
# Define ENVs for Localization/Globalization
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
LANG=en_US.UTF-8 \
# set a fixed location for the Module analysis cache
PSModuleAnalysisCachePath=/PSModuleAnalysisCache/ModuleAnalysisCache

# Install dependencies and clean up
RUN dnf install -y /tmp/powershell.rpm \
Expand All @@ -32,7 +34,18 @@ RUN dnf install -y /tmp/powershell.rpm \
&& localedef --charmap=UTF-8 --inputfile=en_US $LANG \
# remove powershell package
&& rm /tmp/powershell.rpm \
&& ln -sf /opt/microsoft/powershell/6-preview/pwsh /usr/bin/pwsh
&& ln -sf /opt/microsoft/powershell/6-preview/pwsh /usr/bin/pwsh \
# intialize powershell module cache
&& pwsh \
-NoLogo \
-NoProfile \
-Command " \
\$ErrorActionPreference = 'Stop' ; \
\$ProgressPreference = 'SilentlyContinue' ; \
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
Start-Sleep -Seconds 6 ; \
}"

# Define args needed only for the labels
ARG VCS_REF="none"
Expand Down
Loading