搜索 tomcat
镜像
docker 官网:https://hub.docker.com/_/tomcat
1 | docker search tomcat |
下载 tomcat
镜像
默认最新版本
1 | docker pull tomcat |
运行 tomcat
容器
1 | docker run \ |
或者
1 | docker run \ |
命令说明:
-p 8080:8080
:将容器的8080端口映射到主机的8080端口-v $PWD/ROOT:/usr/local/tomcat/webapps/ROOT
:将主机中当前目录下的ROOT
挂载到容器的/ROOT
或者-v /usr/local/docker/web/ROOT:/usr/local/tomcat/webapps/ROOT
:直接指定宿主机的绝对路径
查看容器启动情况
1 | root@ubuntu:/usr/local/docker# docker ps |
If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !