Staging machine setup

To start, you need to install and run Docker services on a staging machine running Ubuntu 18.04 LTS.

  1. Update software repositories:
    sudo apt-get update
  2. Update your list of packages:
    sudo apt update
  3. Install the packages that allow the apt packaging tool to use packages over HTTPS:
    sudo apt install apt-transport-https ca-certificates curl software-properties-common
  4. Add the GPG (GNU Privacy Guard) key for the official Docker repository to your system:
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
  5. Add the Docker repository to APT sources:
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
  6. Update the package database with the Docker packages from the newly added repository:
    sudo apt update
  7. Make sure that you are about to install Docker from the Docker repository instead of from the default Ubuntu repository:
    apt-cache policy docker-ce
    You should see output like this, although the version number for Docker may differ:
    docker-ce:
      Installed: (none)
      Candidate: 18.03.1~ce~3-0~ubuntu
      Version table:
         18.03.1~ce~3-0~ubuntu 500
            500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages

    Notice that docker-ce (Docker Community Edition) isn't installed, but that the Docker version candidate for installation is from the Docker repository for Ubuntu 18.04 (bionic).

  8. Install Docker:
    sudo apt install docker-ce
  9. Docker should now be installed, the Docker service started, and the process enabled to start on boot. To confirm that the service is running, enter this command:
    sudo systemctl status docker
    You should see output like this, showing that the service is active and running:
    docker.service - Docker Application Container Engine
      Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
      Active: active (running) since Thu 2018-07-05 15:08:39 UTC; 2min 55s ago
        Docs: https://docs.docker.com
    Main PID: 10096 (dockerd)
       Tasks: 16
      CGroup: /system.slice/docker.service
              ├─10096 /usr/bin/dockerd -H fd://
              └─10113 docker-containerd --config /var/run/docker/containerd/containerd.toml
    

    Installing Docker will now give you not only the Docker daemon (docker.service) but also the docker command-line utility, or the Docker client.

  10. Install Docker:
    sudo apt install docker.io