Danny Bessems
39966a4f2c
All checks were successful
continuous-integration/drone/push Build is passing
64 lines
2.6 KiB
Docker
64 lines
2.6 KiB
Docker
FROM hashicorp/packer:light as packer
|
|
FROM hashicorp/terraform:light as terraform
|
|
|
|
FROM alpine:latest AS download
|
|
|
|
ENV OVFTOOL_VERSION=4.4.1-16812187
|
|
ENV OVFTOOL_INSTALLER=VMware-ovftool-${OVFTOOL_VERSION}-lin.x86_64.bundle
|
|
ENV OVFTOOL_SHA256=ecdb3dcb58494d643d35661dcda948025661ec12ce615f043e1ec5d4c85de2ce
|
|
ARG REPO_USERNAME
|
|
ARG REPO_PASSWORD
|
|
ADD https://${REPO_USERNAME}:${REPO_PASSWORD}@sn.itch.fyi/Repository/bin/VMware/ovftool/4.4.x/${OVFTOOL_INSTALLER} /tmp/ovftool-installer
|
|
|
|
RUN apk --update add --no-cache \
|
|
curl \
|
|
jq && \
|
|
curl -L https://api.github.com/repos/rgl/packer-provisioner-windows-update/releases/latest | \
|
|
jq -r '.assets[] | select(.name | contains("linux_amd64")) | .browser_download_url' | \
|
|
xargs -I {} curl -L -o /tmp/packer-provisioner-windows-update.tar.gz {} && \
|
|
tar -xzf /tmp/packer-provisioner-windows-update.tar.gz -C /tmp && \
|
|
chmod +x /tmp/packer-provisioner-windows-update && \
|
|
curl -L https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -o /tmp/packages-microsoft-prod.deb
|
|
|
|
FROM ruby:slim
|
|
|
|
COPY --from=packer /bin/packer /bin/packer
|
|
COPY --from=terraform /bin/terraform /bin/terraform
|
|
COPY --from=download /tmp/packer-provisioner-windows-update /bin/packer-provisioner-windows-update
|
|
COPY --from=download /tmp/packages-microsoft-prod.deb /tmp/packages-microsoft-prod.deb
|
|
COPY --from=download /tmp/ovftool-installer /tmp/ovftool-installer
|
|
|
|
ENV LANG en_US.UTF-8
|
|
ENV LANGUAGE en_US:en
|
|
ENV LC_ALL en_US.UTF-8
|
|
|
|
RUN dpkg -i /tmp/packages-microsoft-prod.deb && \
|
|
rm -f /tmp/packages-microsoft-prod.deb && \
|
|
apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
|
|
ansible \
|
|
build-essential \
|
|
curl \
|
|
git \
|
|
jq \
|
|
locales \
|
|
netcat-openbsd \
|
|
openssh-client \
|
|
powershell \
|
|
unzip && \
|
|
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
|
|
locale-gen && \
|
|
curl https://omnitruck.chef.io/install.sh | bash -s -- -P inspec && \
|
|
gem update --system && gem update && \
|
|
pwsh -Command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose" && \
|
|
pwsh -Command "Install-Module -Name 'powershell-yaml','VMware.PowerCLI' -Verbose" && \
|
|
pwsh -Command "Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP \$False -Confirm:\$False" && \
|
|
sh /tmp/ovftool-installer --console --eulas-agreed --required && \
|
|
apt-get remove -y \
|
|
build-essential \
|
|
curl && \
|
|
apt-get autoremove -y && \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
rm -f /tmp/ovftool-installer
|
|
|
|
ENTRYPOINT []
|
|
CMD [] |