提交Docker镜像
提交Docker镜像
1 | docker pull tomcat //下载tomcat镜像 |
1 | docker run -d --name="MyTomcat" -p 8888:8080 tomcat //后台方式,以外部主机端口8888映射容器端口8080,运行Tomcat,容器别名为MyTomcat |
1 | curl localhost:8888 //测试访问显示404 |
此处要注意,【有坑】!
1 | docker exec -it 2dd5319e4047 /bin/bash //进入容器 |
1 | cp -r webapps.dist/* webapps //将webapps.dist目录下的所以文件,拷贝到webapps目录 |
1 | curl localhost:8888 //测试访问显示正常 |
1 | docker commit --help //查看commit帮助 |
1 | docker commit -a "codingdgsun" -m "Init tomcat webapps" 27db1b0306bd mytomcat:1.0.0 //提交镜像,作者:codingdgsun;提交的备注信息:Init tomcat webapps;提交的镜像ID:27db1b0306bd;镜像的别名:mytomcat;版本号:1.0.0 |
-
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.