In this topic, we will put together all the configuration from our Vagrant repo and knowledge of the Puppet Forge to create the Docker environment.
The first thing that we need to do to install Docker is set our manifest to include the Docker class on our node. To do this, let's go to our Vagrant repo. In the repo, there is a file in the manifests
directory called default.pp
. We need to edit the file to include the Docker class node 'node-01' { include docker}
. We can now save the file, and we are ready to run our environment.
The first step is to open our terminal and change to root of the Vagrant repo. Then, we need to enter the vagrant up
command:
This will now provide us with our CentOS 7 box. Install r10k and then run Puppet and apply the Docker class. This will take about 4 minutes depending on your laptop and network connection. If the box was provisioned successfully, you will see the following output:
We can also verify that the Docker installation was successful by logging in to the box via SSH. We will do that with the vagrant ssh
command. Once we are in, we will sudo up to root (sudo -i
). Now, let's just check whether Docker is installed with the docker
command.
You will see the following output on the terminal: