Install virtualbox and the extension pack:
brew install --cask docker virtualbox virtualbox-extension-pack
Download the ubuntu server image and create a VBox for it, the rest of the readme assumes it is named "Ubuntu Server".
sudo apt install openssh-server
VBoxManage modifyvm "Ubuntu Server" --natpf1 "ssh,tcp,,3022,,22"
This will forward the ssh port 22 to the host on 3022. Next, start the server without a window:
VBoxManage startvm "Ubuntu Server" --type headless
And connect to it:
ssh -p 3022 username@127.0.0.1
Once your ssh session is running in the box:
https://docs.docker.com/engine/installation/linux/ubuntulinux/
Add yourself to the docker and vboxsf group:
sudo usermod -aG docker,vboxsf `whoami`;
sudo reboot
vboxsf
is needed to access shared folders.docker
is needed to see the docker daemon.
You can mount host folders in the VirtualBox:
https://devtidbits.com/2010/03/11/virtualbox-shared-folders-with-ubuntu-server-guest/
The only thing that's changed is the command sudo /media/cdrom/VBoxLinuxAdditions.run
(not -amd64.run).
Shares are visible under /media/sf_<name-of-share>
.
Install by running the following (curl method did not work for me so using pip):
sudo apt install python-pip;
export LC_ALL=C; # http://stackoverflow.com/questions/36394101/pip-install-locale-error-unsupported-locale-setting
pip install docker-compose;
echo "alias d='docker'" >> .bashrc;
echo "alias dc='docker-compose'" >> .bashrc;
source .bashrc