Skip to content

Instantly share code, notes, and snippets.

Last active Jul 16, 2018
What would you like to do?
MSDN Channel 9: This is the Dockerfile used to build a PowerShell Core Docker container image on a Linux Docker Host
FROM ubuntu:xenial
MAINTAINER Trevor Sullivan <>
### Install .NET Core
RUN apt-get update \
&& apt-get install apt-transport-https curl -y \
&& sh -c 'echo "deb [arch=amd64] xenial main" > /etc/apt/sources.list.d/dotnetdev.list' \
&& apt-get update \
&& apt-key adv --keyserver --recv-keys 417A0893 \
&& apt-get update \
&& apt-get install dotnet-dev-1.0.0-preview2-003121 -y \
&& mkdir /powershell \
&& apt-get clean
# Install PowerShell
### Set the working directory to /powershell
WORKDIR /powershell
### Set some environment variables
RUN curl -SL $POWERSHELL_DOWNLOAD_URL --output powershell.deb \
&& apt-get install libunwind8 libicu55 \
&& dpkg --install powershell.deb \
&& rm powershell.deb \
&& apt-get clean
ENTRYPOINT ["powershell"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment