Ubuntu Docker installation


Docker supports the following Ubuntu versions:

  • Ubuntu Precise 12.04 (LTS)

  • Ubuntu Trusty 14.04 (LTS)

  • Ubuntu Wily 15.10

  • Other newer versions...


    • Prerequisite

      Docker requires the kernel version of the Ubuntu system to be higher than 3.10. Check the prerequisites on this page to verify whether your Ubuntu version supports Docker.

      Check your current kernel version through the uname -r command

      php@php:~$ uname -r

      docker02.png


      ##Use a script to install Docker

      1. Get the latest Version of the Docker installation package

      php@php:~$ wget -qO- https://get.docker.com/ | sh

      docker03.png

      After entering the current user's password, the script will be downloaded and Docker and dependent packages will be installed.

      docker04.png

      docker05.png

      There is a prompt after the installation is completed:

      	If you would like to use Docker as a non-root user, you should now consider
      	adding your user to the "docker" group with something like:
      
      	sudo usermod -aG docker php
         Remember that you will have to log out and back in for this to take effect!

      When you want to run docker directly as a non-root user, You need to execute the

      sudo usermod -aG docker php command and then log in again, otherwise the following error will be reported

      docker06.png

      2. Start the docker background service

      php@php:~$ sudo service docker start

      docker07.png

      3. Test run hello-world

      php@php:~$ docker run hello-world