Skip to content

Instantly share code, notes, and snippets.

@lamw
Created March 4, 2022 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lamw/bda4820e33532319423e6669c73af905 to your computer and use it in GitHub Desktop.
Save lamw/bda4820e33532319423e6669c73af905 to your computer and use it in GitHub Desktop.
PowerCLI Ubuntu Dockerfile
FROM mirror.gcr.io/library/ubuntu:bionic
ENV TERM linux
WORKDIR /root
ARG POWERCLI_VERSION="12.4.0.18633274"
RUN echo "/usr/bin/pwsh" >> /etc/shells && \
echo "/bin/pwsh" >> /etc/shells && \
apt update && \
apt-get install -y wget apt-transport-https software-properties-common && \
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
apt-get update && \
apt-get install -y powershell/focal && \
pwsh -c "Set-PSRepository -Name PSGallery -InstallationPolicy Trusted" && \
pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module VMware.PowerCLI -RequiredVersion ${POWERCLI_VERSION}" && \
pwsh -c 'Set-PowerCLIConfiguration -ParticipateInCEIP $true -confirm:$false'
CMD ["pwsh","./server.ps1"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment