From b6bcea1b86be4f2a37551787077e16e2fa46a77d Mon Sep 17 00:00:00 2001 From: Ryen Tang Date: Tue, 16 Jun 2020 16:49:50 +0800 Subject: [PATCH] Update and fixes Photon PWSH terminal issue --- .../community-stable/photon/docker/Dockerfile | 18 +++++++----------- .../community-stable/photon/getLatestTag.ps1 | 14 -------------- release/community-stable/photon/meta.json | 7 +++++-- 3 files changed, 12 insertions(+), 27 deletions(-) delete mode 100644 release/community-stable/photon/getLatestTag.ps1 diff --git a/release/community-stable/photon/docker/Dockerfile b/release/community-stable/photon/docker/Dockerfile index a027dab11..e65ec3b8a 100644 --- a/release/community-stable/photon/docker/Dockerfile +++ b/release/community-stable/photon/docker/Dockerfile @@ -5,13 +5,10 @@ # installed from full PowerShell linux tar.gz package # Define arg(s) needed for the From statement -ARG fromTag=2.0-20181017 -ARG imageRepo=photon - -FROM ${imageRepo}:${fromTag} AS installer-env +FROM photon:latest AS installer-env # Define Args for the needed to add the package -ARG PS_VERSION=6.2.3 +ARG PS_VERSION=7.0.1 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 @@ -36,13 +33,13 @@ RUN \ && tar zxf /tmp/powershell-linux.tar.gz -C ${PS_INSTALL_FOLDER} # Start a new stage so we lose all the tar.gz layers from the final image -FROM ${imageRepo}:${fromTag} +FROM photon:latest # 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_VERSION=6.1.0 +ARG PS_VERSION=7.0.1 ARG PS_INSTALL_VERSION=7 ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \ \ @@ -57,10 +54,7 @@ ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \ # Invoke-WebRequest : Authentication failed" issue when executing using # docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [Invoke-WebRequest] [-Uri ] DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0 \ - # Set terminal to linux because there is no xterm library in Photon image - # when docker allocate pseudo-tty - TERM=linux \ - POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Photon-${fromTag} + POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Photon-latest # Installation RUN \ @@ -76,6 +70,8 @@ RUN \ icu \ # required for help in powershell less \ + # required for xterm library + ncurses-terminfo-6.1-2.ph3.x86_64 \ # generate locale && locale-gen.sh \ # create the pwsh symbolic link that points to powershell diff --git a/release/community-stable/photon/getLatestTag.ps1 b/release/community-stable/photon/getLatestTag.ps1 deleted file mode 100644 index 70e80bd17..000000000 --- a/release/community-stable/photon/getLatestTag.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -# return objects representing the tags we need to base the vmware photon image on - -# The versions of photon we care about -$shortTags = @('2.0') - -$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 "photon" -FullTagFilter '^2\.0\-\d{8}?$' diff --git a/release/community-stable/photon/meta.json b/release/community-stable/photon/meta.json index 7bd510541..a47b1b00b 100644 --- a/release/community-stable/photon/meta.json +++ b/release/community-stable/photon/meta.json @@ -1,10 +1,13 @@ { "IsLinux" : true, - "SkipWebCmdletTests": true, + "SkipWebCmdletTests": false, "PackageFormat": "powershell-${PS_VERSION}-linux-x64.tar.gz", "SkipGssNtlmSspTests": true, + "shortTags": [ + {"Tag": "latest"} + ], "tagTemplates": [ "#psversion#-photon-#tag#", - "photon-#shorttag#" + "photon" ] }