2020-12-30 10:58:00 +00:00
|
|
|
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
|
2021-01-04 10:09:50 +00:00
|
|
|
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
|
2020-12-30 10:58:00 +00:00
|
|
|
|
|
|
|
RUN apk --update add --no-cache \
|
2021-06-17 08:59:06 +00:00
|
|
|
curl \
|
|
|
|
jq && \
|
|
|
|
curl -L https://api.github.com/repos/PowerShell/PowerShell/releases/latest | \
|
|
|
|
jq -r '.assets[] | select(.name | contains("debian.10_amd64")) | .browser_download_url' | \
|
|
|
|
xargs -I {} curl -L -o /tmp/packages-microsoft-prod.deb {}
|
2020-12-30 10:58:00 +00:00
|
|
|
|
|
|
|
FROM ruby:slim
|
|
|
|
|
|
|
|
COPY --from=packer /bin/packer /bin/packer
|
|
|
|
COPY --from=terraform /bin/terraform /bin/terraform
|
|
|
|
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 \
|
2021-05-27 10:57:22 +00:00
|
|
|
# (build-essential) Dependency for installation of InSpec
|
2021-01-05 16:59:31 +00:00
|
|
|
build-essential \
|
2021-01-04 22:02:25 +00:00
|
|
|
curl \
|
2020-12-30 10:58:00 +00:00
|
|
|
git \
|
|
|
|
jq \
|
2021-05-27 10:57:22 +00:00
|
|
|
# (locales) Dependency for InSpec
|
2020-12-30 10:58:00 +00:00
|
|
|
locales \
|
|
|
|
netcat-openbsd \
|
|
|
|
openssh-client \
|
2021-04-09 07:35:45 +00:00
|
|
|
powershell \
|
2021-05-27 10:57:22 +00:00
|
|
|
# (python3-*) Dependency for installation of Ansible
|
|
|
|
python3-pip \
|
|
|
|
python3-setuptools \
|
|
|
|
python3-wheel \
|
2021-06-17 08:45:43 +00:00
|
|
|
# (qemu-utils) Dependency for Packer (conversion to raw disk format)
|
|
|
|
qemu-utils \
|
2021-06-08 14:51:38 +00:00
|
|
|
# (sshpass) Dependency for Packer (non-interactive password authentication)
|
|
|
|
sshpass \
|
2021-06-08 14:54:22 +00:00
|
|
|
# (xorriso) Dependency for Packer (generating isofs image)
|
2021-06-07 12:03:34 +00:00
|
|
|
xorriso \
|
2021-04-09 07:35:45 +00:00
|
|
|
yamllint && \
|
2020-12-30 10:58:00 +00:00
|
|
|
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
|
|
|
|
locale-gen && \
|
2021-01-04 22:12:58 +00:00
|
|
|
curl https://omnitruck.chef.io/install.sh | bash -s -- -P inspec && \
|
2021-01-05 16:59:31 +00:00
|
|
|
gem update --system && gem update && \
|
2021-05-27 10:57:22 +00:00
|
|
|
pip3 install --upgrade pip && \
|
|
|
|
pip3 install ansible-core && \
|
2020-12-30 10:58:00 +00:00
|
|
|
pwsh -Command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose" && \
|
2021-01-02 09:52:29 +00:00
|
|
|
pwsh -Command "Install-Module -Name 'powershell-yaml','VMware.PowerCLI' -Verbose" && \
|
2021-01-04 22:02:25 +00:00
|
|
|
pwsh -Command "Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP \$False -Confirm:\$False" && \
|
2020-12-30 10:58:00 +00:00
|
|
|
sh /tmp/ovftool-installer --console --eulas-agreed --required && \
|
2021-01-11 11:46:41 +00:00
|
|
|
apt-get remove -y \
|
|
|
|
build-essential \
|
|
|
|
curl && \
|
|
|
|
apt-get autoremove -y && \
|
2021-01-04 22:12:58 +00:00
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
2020-12-30 10:58:00 +00:00
|
|
|
rm -f /tmp/ovftool-installer
|
|
|
|
|
|
|
|
ENTRYPOINT []
|
|
|
|
CMD []
|