53 lines
2.2 KiB
Docker
53 lines
2.2 KiB
Docker
# Docker image file that describes an Ubuntu16.04 image with PowerShell installed from Microsoft APT Repo
|
|
|
|
FROM ubuntu:xenial
|
|
|
|
ARG POWERSHELL_VERSION=6.0.0-beta.7
|
|
ARG IMAGE_NAME=microsoft/powershell:ubuntu16.04
|
|
|
|
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 PS." \
|
|
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" \
|
|
org.label-schema.name="powershell" \
|
|
org.label-schema.vendor="PowerShell" \
|
|
org.label-schema.version=${POWERSHELL_VERSION} \
|
|
org.label-schema.schema-version="1.0" \
|
|
org.label-schema.docker.cmd="docker run ${IMAGE_NAME} powershell -c '$psversiontable'" \
|
|
org.label-schema.docker.cmd.devel="docker run ${IMAGE_NAME}" \
|
|
org.label-schema.docker.cmd.test="docker run ${IMAGE_NAME} powershell -c Invoke-Pester" \
|
|
org.label-schema.docker.cmd.help="docker run ${IMAGE_NAME} powershell -c Get-Help"
|
|
|
|
# TODO: addd LABEL org.label-schema.vcs-ref=${VCS_REF}
|
|
|
|
# Install dependencies and clean up
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
apt-utils \
|
|
ca-certificates \
|
|
curl \
|
|
apt-transport-https \
|
|
locales\
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# 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 for Microsoft
|
|
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
|
|
|
|
# Register the Microsoft Ubuntu 16.04 repository
|
|
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list
|
|
|
|
# Install powershell from Microsoft Repo
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
powershell
|
|
|
|
# Use PowerShell as the default shell
|
|
# Use array to avoid Docker prepending /bin/sh -c
|
|
CMD [ "powershell" ]
|