1.卸载现有docker:apt-get remove docker docker-engine docker.io
2.安装:apt-get install /
apt-transport-https /
ca-certificates /
curl /
software-properties-common
3.curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4.apt-key fingerprint 0EBFCD88
5.add-apt-repository /
"deb [arch=amd64] https://download.docker.com/linux/ubuntu /
$(lsb_release -cs) /
stable"
6.apt-get update
7.apt-get install docker-ce
备注:
自定义网络
docker network create --subnet 10.136.22.0/24 cnpro
查看创建的网桥
docker network ls
常见docker使用:
docker run -d --name test /
--privileged --restart=always /
--net uspro --ip 172.31.3.11 /
-v /opt/app/test:/usr/local/tomcat/webapps/ROOT /
-v /opt/app/logs/test:/usr/local/tomcat/logs /
-v /storage:/storage /
-p 8081:8080 /
tomcat:8.0
参考官网:https://docs.docker.com/install/linux/docker-ce/ubuntu/#docker-ee-customers
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/182898.html