FROM debian:bullseye ARG VERSION SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update \ && apt-get install -y --no-install-recommends \ fasttrack-archive-keyring software-properties-common curl gpg \ && curl -fsSL "https://www.virtualbox.org/download/oracle_vbox_2016.asc" \ | gpg --dearmor -o /etc/apt/trusted.gpg.d/oracle_vbox_2016.gpg \ && curl -fsSL "https://www.virtualbox.org/download/oracle_vbox.asc" \ | gpg --dearmor -o /etc/apt/trusted.gpg.d/oracle_vbox.gpg \ && apt-add-repository "deb http://deb.debian.org/debian bullseye-backports main contrib" \ && apt-add-repository "deb https://fasttrack.debian.net/debian-fasttrack/ bullseye-fasttrack main contrib" \ && apt-add-repository "deb https://fasttrack.debian.net/debian-fasttrack/ bullseye-backports-staging main contrib" \ && apt-add-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bullseye contrib" \ && apt-get update \ && apt-get install -y --no-install-recommends \ virtualbox-$(echo "$VERSION" | cut -d. -f-2) vagrant procps kmod \ && mkdir -p /etc/vbox \ && echo "* 0.0.0.0/0 ::/0" > /etc/vbox/networks.conf \ && apt-get clean \ && curl -fsSLOJ "https://download.virtualbox.org/virtualbox/$VERSION/Oracle_VM_VirtualBox_Extension_Pack-$VERSION.vbox-extpack" \ && echo y | VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-*.vbox-extpack \ && rm -f Oracle_VM_VirtualBox_Extension_Pack-*.vbox-extpack \ && rm -Rf /var/lib/apt/lists/* \ && rm -Rf /usr/share/doc \ && rm -Rf /usr/share/man ENTRYPOINT ["vboxmanage"]