一、总体步骤
- 搜索镜像
- 拉取镜像
- 查看镜像
- 启动镜像
- 停止容器
- 移除容器
1、docker hub上面查找tomcat镜像
docker search tomcat
2、从docker hub上拉取tomcat镜像到本地
docker pull tomcat
3、docker images查看是否有拉取到的tomcat
docker images
4、使用tomcat镜像创建容器(也叫运行镜像)
docker run -it -p 8080:8080 tomcat
参数
-p 主机端口:docker容器端口 -P 随机分配端口 i:交互 t:终端