Created
March 4, 2022 14:02
-
-
Save lamw/bda4820e33532319423e6669c73af905 to your computer and use it in GitHub Desktop.
PowerCLI Ubuntu Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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