-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathDockerfile
57 lines (41 loc) · 2.47 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM mcr.microsoft.com/powershell:lts-ubuntu-20.04
LABEL authors="atanas-dimitrov.atanasov@broadcom.com"
# Set PowerShell Gallery Repository
RUN pwsh -c 'Set-PSRepository -Name PSGallery -InstallationPolicy Trusted'
# Add Commuunity Examples
# Note: VMware.vSphere.SsoAdmin is removed and later installed from the PowerShell Gallery.
WORKDIR /root
ENV TZ=Etc/UTC
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
RUN apt-get update && \
apt-get install -y --no-install-recommends git dnsutils && \
git clone https://github.com/vmware/PowerCLI-Example-Scripts.git && \
mkdir --parents /usr/local/share/powershell/Modules && \
mv ./PowerCLI-Example-Scripts/Modules/* /usr/local/share/powershell/Modules/ && \
rm -rf /usr/local/share/powershell/Modules/VMware.vSphere.SsoAdmin && \
apt-get remove -y git
# Install PowerShell Modules
## Invoke-DscResource is no longer an experimental feature starting with PSDesiredStateConfiguration version 2.0.6
RUN pwsh -c "Install-Module PSDesiredStateConfiguration -MinimumVersion 2.0.6" && \
pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module -Name VMware.PowerCLI" && \
pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module -Name VMware.vSphereDSC" && \
pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module -Name VMware.CloudServices" && \
pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module -Name VMware.vSphere.SsoAdmin" && \
pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module -Name PowerVCF" && \
pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module -Name PowerNSX" && \
pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module -Name PowervRA" && \
find / -name "net45" | xargs rm -rf
# Install VMware.DeployAutomation dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends wget build-essential libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev libtk8.6 libgdm-dev libdb4o-cil-dev libpcap-dev && \
cd /usr/src && \
wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz && \
tar xzf Python-3.7.9.tgz && \
cd Python-3.7.9 && \
./configure && \
make && \
make install
# Install required pip modules and set python path
RUN pip3 install six psutil lxml pyopenssl && \
pwsh -c "Set-PowerCLIConfiguration -PythonPath /usr/local/bin/python3 -Scope AllUsers -Confirm:\$false"