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
71 changes: 71 additions & 0 deletions release/community-stable/amazonlinux/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#
# Docker image file that describes an Amazon Linux image with PowerShell
# installed from RHEL7 PowerShell package

# Define arg(s) needed for the From statement
ARG fromTag=2.0.20181010
ARG imageRepo=amazonlinux

FROM ${imageRepo}:${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}-1.rhel.7.x86_64.rpm
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
ARG PS_INSTALL_VERSION=6

# Define Args and Env needed to create links
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION

# Download the Linux package and save it
ADD ${PS_PACKAGE_URL} /tmp/powershell-linux.rpm

# Define Args and Env needed to create links
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

# Installation
RUN \
# install dependencies
yum install -y \
# required for help in powershell
less \
# install powershell package
&& yum install -y /tmp/powershell-linux.rpm \
# remove powershell package
&& rm -f /tmp/powershell-linux.rpm \
# upgrade packages
&& yum upgrade -y \
# clean cached data
&& yum clean all \
# remove cache folders and files
&& rm -rf /var/cache/yum

# Define args needed only for the labels
ARG IMAGE_NAME=pshorg/powershellcommunity:amazonlinux
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" \
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" ]
14 changes: 14 additions & 0 deletions release/community-stable/amazonlinux/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 kali image on

# The versions of photon we care about
$shortTags = @('2.0-20181010')

$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 "amazonlinux" -FullTagFilter '^2.0-\d{8}$' -OnlyShortTags
4 changes: 4 additions & 0 deletions release/community-stable/amazonlinux/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"IsLinux" : true,
"PackageFormat": "powershell-${PS_VERSION}-1.rhel.7.x86_64.rpm"
}
4 changes: 4 additions & 0 deletions release/community-stable/amazonlinux/tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"#psversion#-amazonlinux-#tag#",
"amazonlinux-#shorttag#"
]
9 changes: 9 additions & 0 deletions vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ phases:
preview: false
communityStable: true

- template: .vsts-ci/phase.yml
parameters:
name: amazonLinux
imagename: amazonLinux
stable: false
servicing: false
preview: false
communityStable: true

# Use CI switch to disable 1709 and 1803 builds because the VSTS hosted instances don't yet support 1709 or 1803
# Skipping previews on windows due to how long it takes to build on windows
- template: .vsts-ci/phase.yml
Expand Down