Difficulty: beginner
Estimated Time: 10 minutes
What is Container ?

A container is a lightweight, standalone package that encapsulates application code and all of its dependencies so the application can run in any environment. Containers are considered as lightweight virtualization technology. They are created from a container image.

What is Container Image ?

A container image is a readonly, static file that includes executable code. It can be roughly considered as similar to template that is used to create something concrete that runs, which in our case if containers. Containers are created from container images. Image contains various layers which serves as a base for upper layers.

What is Docker ?

Docker is a containerization platform developed by a company called Docker Inc. It provides a runtime environment to run containers and interact with them. Docker uses some technologies like CGroups, Namespaces, etc to create an isolated containers.

This scenario has explained how to install Docker. In the next scenario we shall see how you will create your first container.

Install Docker

Step 1 of 2

Step 1

Install Docker

Follow steps given below to install Docker.

  1. Update the apt package index.

    sudo apt-get update

  2. Install packages to allow apt to use repository over HTTPS.

    sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

  3. Add Docker's official GPG key.

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

  4. Setup a stable repository.

    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

  5. Update the apt package index.

    sudo apt-get update

  6. Install the latest version of Docker CE and containerd.

    sudo apt-get install docker-ce=18.06.1~ce~3-0~ubuntu