我的環境是在vm虛擬機中,Ubuntu17.04
前期安裝步驟不過多介紹,下面這個博客就很好
ubuntu16.10安裝docker17.03.0-ce並配置國內源和加速器
http://www.cnblogs.com/wish123/p/6501569.html
如果要是以后過時了,也可以看官方文檔,現在有兩款,CE(社區版)和EE(企業版),視情況選擇,我練習就用CE了,EE好像要收費吧。。
https://docs.docker.com/engine/installation/linux/ubuntu/

報錯信息:
root@zhaijhubuntu17:~# sudo apt-get install docker-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'docker-ce' has no installation candidate
一開始查網上的解決方法是這樣,但是照做還是一樣的報錯。
# apt-get update
# apt-get upgrade
# apt-get install <packagename>
原因可能是沒找到合適的更新源,通過這樣一條命令加進去可以解決,如果再不行就要翻牆試試了。
sudo echo "deb https://download.docker.com/linux/ubuntu zesty edge" > /etc/apt/sources.list.d/docker.list sudo apt update && sudo apt install docker-ce
