安装tomcat

进入docker hub(https://hub.docker.com/)网站,搜索tomcat的镜像

选择官方认证的排在前面的镜像,点击进入详情页面,通过 tag 选择版本号

阅读页面中How to use this image.

拉取镜像:

$ docker pull tomcat[:tag]

启动容器

$ docker run --name tomcat -d -p 8080:8080 tomcat[:tag]

测试

在上述设置下,宿主机的8080端口将作为进入tomcat服务器的入口,若宿主机的ip地址为222.20.77.242,在浏览器中输入http:\\222.20.77.242:8080。

Last updated

Was this helpful?