2, system software update
$ sudo apt-get update
3, the installation dependencies
$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common
4, add a key official
When this command is executed, as encountered for a long time did not respond to instructions Fi less than a docker website, you need to use on behalf of - process proceeds.
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Display OK, represent added successfully.
5, add warehouse
$ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
6, update the software again
The practice, this step can not be omitted, we need to update to the latest software again, otherwise the next step is likely an error.
$ sudo apt-get update
7, install docker
If you want to install a version specified, may be used sudo apt-get install docker-ce = <VERSION> command, the <VERSION> Replace specific version.
The following command does not specify a version, the default will install the latest version
$ sudo apt-get install docker-ce
8, see docker version
$ docker -v
Show "Docker version 17.09.0-ce, build afdb6d4" word to indicate a successful installation.
In the win10 subsystem, you will find the service fails to start, the following error in the log /var/log/docker.log.
Check the service status service docker status as follows:
* Docker is not running
solution:
In the / etc / fstab adding the last line of code
none / sys / fs / cgroup cgroup defaults 0 0
Then when you start ubuntu terminal window and run as administrator, and then execute the command sudo service docker start, you can run properly.
ref: https://www.cnblogs.com/sweetsunnyflower/p/9862943.html
ref: https://www.jianshu.com/p/d1b2b4240256