Docker: Install on linux

Docker is a technology that allow you to package an application with all it needs to run correctly into a standardized unit called container.

This idea is very useful because you can develop your application and then deploy that into the correct environment and don’t be in trouble about the target machine and the other software installed.

First of all you need to install the docker environment on your machine. I try docker on a linux mint virtualized machine. Docker doesn’t have many requirements but a reasonable modern kerlel is advised. For this point is important to verify if the wget is correctly installed, on command line write:

which wget

if the prompt respond something like this:

Schermata del 2016-01-17 08:00:05

you have wget on your machine and now we can install docker, great!

wget -qO- |sh

then, you linux, starts to download the file and install it.

When the installation is finished you see something like this on your consolle:

Schermata del 2016-01-17 07:56:04

now we can verify the installation:

sudo docker run hello-world

Now Docker try to find the hello-world container on you machine, if don’t find it the engine stats to download from Docker hub. At the end you read this:

Schermata del 2016-01-17 08:03:40.png

It’s important to underline that, in this way, you need to run docker with sudo. If you would like to run Docker as a non-root user, should consider adding your user to the docker group with something like:

sudo usermod -aG docker klaus

Rememeber that logout and new login is necessary!