Exercise on getting images

  1. Get the latest image or latest release
docker pull ubuntu

2. Check the versions of Ubuntu present and fetch version 18.04 using tags

docker pull ubuntu:18.04

When you ran this command, Docker first looked for the image on your local machine, and when it couldn’t find it, pulled it down from a cloud registry of Docker images called Docker Hub

Note: depending on the installation, there is a common error message.

docker pull ubuntu
Using default tag: latest
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/create?fromImage=ubuntu&tag=latest: dial unix /var/run/docker.sock: connect: permission denied

Usually, these post-installation steps have to be followed: https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user

Otherwise, the workaround is using

sudo docker pull ubuntu