This guide is was made to help you to start using this repository. It's only showing the steps to build and run a Ubuntu 16.04 LTS (Xenial) base image, other images in this repository might depend on this or a different base image. You need to build base images first to be able to build derived images.
To install Docker and Vagrant, type the commands in a terminal emulator. The links are here if you want to read about these tools - recommended, but optional.
Install the packages and start the docker service. The package names and the configuration differ a bit by distribution, but here are a few tips:
- Make sure you're in the docker group
- Make sure the docker service is running
docker psshould exit without an error
sudo apt-get install make docker.io vagrant
sudo usermod --append --groups docker <username>
sudo service docker start
My personal recommendation is not to use AuFS - the default storage driver. You can read the details here.
Devicemapper is a simple alternative if you're already using and comfortable with LVM.
Add the following into /etc/docker/daemon.json:
{
"storage-driver": "devicemapper"
}
Restart the docker service.
-
Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -
Install Cask
brew tap caskroom/cask -
Install Docker
brew cask install docker -
Start Docker
Start it from the Launchpad.
-
Install Vagrant
brew cask install vagrant
-
Clone this git repo if you haven't already
git clone https://github.com/farkasmate/vm.git -
Build a base image
cd vm/docker/xenial/base makeTo run a quick test you can run:
make testIf everything went according to the plan you will find yourself in the container's shell with a prompt like:
root@77a40185ed64:/#Exit the shell by typing
exit. -
Start a container with Vagrant
If you're still in the
vm/docker/xenial/basedirectory, type:cd ../../..Copy the template Vagrantfile.
cd vagrant cp -a TEMPLATE xenial-baseCreate and start the container.
cd xenial-base vagrant upSSH into the container.
vagrant ssh