What is docker?

Docker is an open-source project for automating the deployment of applications as portable, self-sufficient containers that can run on the cloud or on-premises. Docker is also a company that promotes and evolves this technology. Docker works in collaboration with the cloud, Linux, and Windows vendors, including Microsoft.

How to install Docker

With one of the latest releases of Docker. They added official support for Raspbian. You now can easily install Docker on your Raspberry Pi with one simple command.

Install Docker with the following command.

curl -sSL https://get.docker.com | sh

After running this command Docker has been installed on your Raspberry Pi. If the installation has finished correctly, Docker must be up and running. You can verify your installation by running “docker ps”.

sudo docker ps

Screen 1

Add your user to the docker group (optional) If you don’t like to run all your Docker command with the sudo. It is possible to add your pi user to the docker group. This will allow you to invoke all docker commands without sudo. Added your user with the following command.

sudo usermod -aG docker pi

Run your first docker image

Now is time to run your first Docker image on your Raspberry Pi. To run a container we could run the command “run docker hello-world image”.

docker run hello-world

Screen 2

If you have run the command, you’ll see a Hello World message from the freshly started container. Now you have started your first Docker container :)