This article describes the Ubuntu 16.04 installation Docker tutorial, as follows:
Environment
Operating system: Ubuntu 16.04 64-bit, default installation
Get ready
1. Add GPG key:
$ sudo apt-key adv--keyserver hkp://p80.pool.sks-keyservers.net:80--recv-keys 58118e89f3a912897c070adbf76221572c52609d
2. Add Source
New file:/etc/apt/sources.list.d/docker.list, add content inside:
Deb Https://apt.dockerproject.org/repo ubuntu-xenial Main
3. Update source
Installation and Testing
Installation
$ sudo apt install docker-engine
Start and test
$ sudo service docker start
$ sudo docker run Hello-world
Hello-world is mirrored, the mirror is downloaded from the Mirror library, and the results are as follows:
Configure Power-on Startup
Configuration
$ sudo systemctl enable Docker
Execute using the current user
If executed using the current user, the following error will be reported:
$ docker Run Hello-world
cannot connect to the Docker daemon. Is ' Docker daemon ' running in this host?
Therefore, the current user needs to be added to the group Docker, which is automatically created when the Docker is installed.
$ sudo usermod-ag docker ubuntu
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.