Installing VirtualBox, Ubuntu, and Docker
Note: I'm on a mac. If you are doing this through windows, some steps may be slightly different, but the overall process will still apply. This is the most basic and generic process of getting Docker to run in a virtual machine provided through Virtual Box.
If you want, you can use a more integrated solution such as
Docker Toolbox: https://www.docker.com/toolbox
Kitematic: https://kitematic.com/
Install Virtual Box (VB): https://www.virtualbox.org/wiki/Downloads
Get Ubuntu: http://virtualboxes.org/images/ubuntu/
Download the .iso file
Create new VB Image:
Click "New" in VB
When you start the VM, select the iso file for ubuntu you downloaded
You may to set the HD space to around 20G, just to have enough room to do some stuff
When Ubuntu runs in the VM, you’ll have to install it (the iso is the installation "disk" for Ubuntu)
Tips and tricks:
After installation, I noticed that my screen resolution was too small. To change:
Click “Devices” from VirtualBox menu bar at top of screen
Click “Insert guest additions"
I then applied updates to Ubuntu
Restart guest OS
Resize works!
To enable copy/paste between your Mac Desktop and the Guest OS VM
Virtualbox->Machine->Settings
Select Advance tab
Select “Bidirectional” for Shared Clipboard and Drag’n'Drop
Install Docker
https://docs.docker.com/installation/ubuntulinux/#for-trusty-14-04
sudo apt- get updatesudo apt- get install linux- image -generic-lts-trustysudo rebootcurl -sSL http s: // get .docker. com / | sh
Start docker deamon:
sudo docker -d &Note: I had this error: "ubuntu 14.04 docker your kernel does not support cgroup memory limit: mountpoint for memory not found"
To fix:
sudo vi /etc/default/grubModify: GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
Save and close file
sudo update-grubsudo reboot
Verify Docker is installed
sudo docker run hello-world
If you don’t want to run docker as root all the time: