A environment and series of examples to learn about docker.
- a laptop with
- 1-2GB of free RAM
- 5GB of free disk space in your home directory
- To have performed the setup steps below.
This tutorial was presented to the Kitchener Waterloo Ruby MeetUp. You can find videos here of that presentation and follow along.
- Install Virtual Box if you don't already have it
You can get there here
https://www.virtualbox.org/wiki/Downloads
- Install docker-machine
You ONLY need docker-machine, not the completion scripts. You find the installation steps for your platform here.
https://docs.docker.com/machine/install-machine/
- Run the following commands to prepare your laptop
docker-machine create --driver virtualbox tutorial
docker-machine ssh tutorial curl --silent -L https://raw.githubusercontent.com/timdaman/docker-tutorial/master/setup_lab.sh \| sh
docker-machine stop tutorial
The reason why I asking you to do this work ahead of time is because
- I am going to dive straight into using Docker rather than wasting a lot of time showing how to install it. If you are not prepared you will fall behind.
- In a busy class if everyone tried to download the needed files for the example there is a high risk that the network would collapse under the combined demand. These prep steps caches almost all the data you need to follow along.
- This give you a chance to deal with any installation problems before coming to tutorial.
- review of terms
image
layers
containers - Basic docker commands
images
pull
Reuse of layers
run
ps
exec
rm
rmi - Playing with a container
getting a bash shell
copying files in and out if containers
mounting volumes - Our first dockerfile
Making a mysql Dockerfile
exposing to network - Second docker file
Install our app
Explore networking and dns - Bring it all together
Introduce compose
Private networks