1、卸載舊版:sudo apt-get remove docker docker-engine docker-ce docker.io
2、更新:sudo apt-get update
3、 sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
4、添加GPG密鑰curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
5、設置stablesudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
6、更新包sudo apt-get update
7、列出可用版本ceapt-cache madison docker-ce
8、安裝docker-ce docker-cesudo apt-get install -y docker-ce=<VERSION>
不加=安裝默認版
9、查看服務是否啓動systemctl status docker
若未啓動運行sudo systemctl start docker
10、運行hello-worldsudo docker run hello-world
安裝tomcat
1、查找鏡像 sudo docker search tomcat
2、安裝sudo docker pull tomcat
3、查看sudo docker images
4、啓動sudo docker run -p 8080:8080 tomcat
瀏覽器上訪問即可看到tomcat
未完