How to Install Docker On Ubuntu 18.04

Step by step tutorial for install Docker on Ubuntu 18.04 LTS

Installation from the standard Ubuntu repository consists of a single apt command. It may yield stable but lower docker version number:


$ sudo apt install docker.io
        

The following linux commands will start Docker and ensure that starts after the reboot:


$ sudo systemctl start docker
$ sudo systemctl enable docker
        

Docket are installed. All done. Please chechk follow command


$ docker --version
Docker version 17.12.1-ce, build 7390fc6
        

You can run "Hello world" container


$ docker run hello-world
        

If you get error. Example:


docker: 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.35/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

        

Please, follow post-installation steps for Linux

  1. To create the docker group and add your user:
    
    $ sudo groupadd docker
            
  2. Add your user to the docker group.
    
    $ sudo usermod -aG docker $USER
            
  3. Log out and log back in so that your group membership is re-evaluated.
  4. Please, try again run command $ docker run hello-world

2018-06-02 06:01:27