My system is elementary os, kernel Ubuntu18.0.4
By way of installation, a bunch of online tutorials warehouse, but it is prejudiced, when it came to issues not to think for themselves
1. First update the system and install the dependent packages, so apt repository can be accessed through https
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
2, the official added docker GPG certificate
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
3. Write source software information
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
After adding a mirror source, the update will update unsuccessful life and death, reported 404 errors, online tutorials are like ah, how it will be 404, it is still not the main active thinking
This step, in fact, is the mirror of the source system into /etc/apt/sources.list,update update package index
Inside the $ (lsb_release -cs ) is to get your own computer's release number, my computer out of the juno, are they not the official version number, this is elementary os own version number, which should be the Ubuntu version number again Defined
So direct manually modify /etc/apt/sources.list, juno into the inside of the Bionic , because Ubuntu version number 18.0.4 hair is bionic, change step 4 finished successfully
4. Update Source
sudo apt update
5. Install the latest version of Docker CE
sudo apt install -y docker-ce
6. View Docker service status
systemctl status docker
7. Start Docker
sudo systemctl start docker
8.Docker boot
sudo systemctl enable docker
9. Run Docker helloworld
# View Docker version information
sudo docker version
# Run Docker helloworld
sudo docker run hello-world
# View Docker container status
sudo docker ps