Skip to content

Instantly share code, notes, and snippets.

@d4gh0s7
Created May 6, 2019 21:43
Show Gist options
  • Save d4gh0s7/227d81beab5e30ed0a9d02c5a5c27bcb to your computer and use it in GitHub Desktop.
Save d4gh0s7/227d81beab5e30ed0a9d02c5a5c27bcb to your computer and use it in GitHub Desktop.
Run vmware workstation in a Docker container.
FROM centos/systemd
LABEL maintainer="[email protected]"
LABEL version="0.5"
LABEL description="Run vmware workstation in a Docker container."
ARG VAGRANT_VERSION=2.2.4
ARG PACKER_VERSION=1.4.0
ARG VMWARE_WORKSTATION_VERSION=12.5.7-5813279
COPY vagrant.lic /root/vagrant.lic
RUN set -xe \
&& yum -y update \
&& yum -y install \
bash \
wget \
unzip \
ca-certificates \
libxinerama1 \
libxtst6 \
libxcursor1 \
libxi6 \
libfuse2 \
build-essential \
net-tools \
zlib-devel \
libvirt-devel \
rubygem-ruby-libvirt \
ruby-devel \
redhat-rpm-config \
gcc dkms make libgomp patch \
kernel-headers \
kernel-devel \
binutils \
glibc-headers \
glibc-devel \
linux-headers-$(uname -r) \
linux-image-$(uname -r)
RUN set -xe \
&& yum -y groupinstall "Development tools"
RUN set -xe \
&& wget -q https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.rpm -O /tmp/vagrant.rpm \
&& yum install -y /tmp/vagrant.rpm \
&& wget -q https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip -O /tmp/packer.zip \
&& unzip /tmp/packer.zip -d /usr/bin/
# && vagrant plugin install vagrant-vmware-workstation \
# && vagrant plugin license vagrant-vmware-workstation /root/vagrant.lic \
RUN set -xe \
&& wget -q https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-${VMWARE_WORKSTATION_VERSION}.x86_64.bundle -O /tmp/VMWareWorkstation.bundle \
&& chmod a+x /tmp/VMWareWorkstation.bundle \
&& /tmp/VMWareWorkstation.bundle --console --required --eulas-agreed
RUN yum clean all ; yum autoremove -y ; rm -rf /tmp/* /var/tmp/*
VOLUME /root
VOLUME /tmp
# ENTRYPOINT ["/entrypoint"]
CMD ["/usr/sbin/init"]
# docker run --privileged --name whatever -v /sys/fs/cgroup:/sys/fs/cgroup:ro -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment