Docker for Ubuntu

Kwesi Smart
2 min readDec 26, 2021

Docker is the new black! But what exactly is it?

Credits: CloudSavyyIT

Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers.Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.

In simple terms, docker allows one to create an temporary isolated environment where an application runs. Unlike traditional Virtual Machines (VMs), docker runs on the host system, efficiently using system resources. Ever replied to your boss “..but it works on my machine?” You need docker.

Docker can be installed on Ubuntu in a number of ways including:

  1. From docker repository — https://docs.docker.com/engine/install/ubuntu/
  2. From snapstore — https://snapcraft.io/docker

I have docker what next?

Once you have docker installed, you can create docker images from docker files, pull images from a docker registry like DockerHub or spin up containers from images to run applications.

Common errors

  1. Cannot run docker commands from non-root user account
    A bad approach will be to run as root user only to circumvent this. A better approach will be to first create the “docker” user group, then add your non-root user account to the group and re-login. Click here for the steps.
  2. docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
    This happens due to insufficient user permissions to read/write the docker socket file
    Run sudo chmod 666 /var/run/docker.sock to resolve

--

--