本镜像是https://hub.docker.com/_/tomcat%E7%9A%84%60amd64%60%E6%9E%B6%E6%9E%84%E4%B8%93%E7%94%A8%E4%BB%93%E5%BA%93%EF%BC%8CApache Tomcat(简称Tomcat)是由Apache软件基金会开发的开源Web服务器和Servlet容器。它实现了Java Servlet和JavaServer Pages(JSP)规范,提供纯Java环境用于运行Java Web应用程序。在简单配置下,Tomcat以单进程模式运行,通过Java虚拟机(JVM)处理HTTP请求,每个请求由独立线程处理。
server.xml、web.xml),支持自定义服务器行为| 标签格式 | 示例标签 | Dockerfile链接 |
|---|---|---|
| JDK 25 + Temurin + Ubuntu Noble | 11.0.13-jdk25-temurin-noble, 11-jdk25-temurin-noble, jdk25-temurin-noble | https://github.com/docker-library/tomcat/blob/1ecfffb225b58096cf8b93aed73fa25c2320d99c/11.0/jdk25/temurin-noble/Dockerfile |
| JRE 25 + Temurin + Ubuntu Noble | 11.0.13-jre25-temurin-noble, 11-jre25-temurin-noble, jre25-temurin-noble | https://github.com/docker-library/tomcat/blob/1ecfffb225b58096cf8b93aed73fa25c2320d99c/11.0/jre25/temurin-noble/Dockerfile |
| JDK 25 + Temurin + Ubuntu Jammy | 11.0.13-jdk25-temurin-jammy, 11-jdk25-temurin-jammy | https://github.com/docker-library/tomcat/blob/1ecfffb225b58096cf8b93aed73fa25c2320d99c/11.0/jdk25/temurin-jammy/Dockerfile |
| JRE 25 + Temurin + Ubuntu Jammy | 11.0.13-jre25-temurin-jammy, 11-jre25-temurin-jammy | https://github.com/docker-library/tomcat/blob/1ecfffb225b58096cf8b93aed73fa25c2320d99c/11.0/jre25/temurin-jammy/Dockerfile |
| JDK 21 + Temurin + Ubuntu Noble | 11.0.13-jdk21-temurin-noble, 11-jdk21-temurin-noble, jdk21-temurin-noble | https://github.com/docker-library/tomcat/blob/1ecfffb225b58096cf8b93aed73fa25c2320d99c/11.0/jdk21/temurin-noble/Dockerfile |
| JRE 21 + Temurin + Ubuntu Noble | 11.0.13-jre21-temurin-noble, 11-jre21-temurin-noble, jre21-temurin-noble | https://github.com/docker-library/tomcat/blob/1ecfffb225b58096cf8b93aed73fa25c2320d99c/11.0/jre21/temurin-noble/Dockerfile |
| JDK 17 + Temurin + Ubuntu Noble | 11.0.13-jdk17-temurin-noble, 11-jdk17-temurin-noble, jdk17-temurin-noble | https://github.com/docker-library/tomcat/blob/1ecfffb225b58096cf8b93aed73fa25c2320d99c/11.0/jdk17/temurin-noble/Dockerfile |
| JRE 17 + Temurin + Ubuntu Noble | 11.0.13-jre17-temurin-noble, 11-jre17-temurin-noble, jre17-temurin-noble | https://github.com/docker-library/tomcat/blob/1ecfffb225b58096cf8b93aed73fa25c2320d99c/11.0/jre17/temurin-noble/Dockerfile |
| 标签格式 | 示例标签 | Dockerfile链接 |
|---|---|---|
| JDK 25 + Temurin + Ubuntu Noble | 10.1.48-jdk25-temurin-noble, 10-jdk25-temurin-noble | https://github.com/docker-library/tomcat/blob/480e55f6c958e717cc9aa8923cffa4fa3d362133/10.1/jdk25/temurin-noble/Dockerfile |
| JRE 25 + Temurin + Ubuntu Noble | 10.1.48-jre25-temurin-noble, 10-jre25-temurin-noble | https://github.com/docker-library/tomcat/blob/480e55f6c958e717cc9aa8923cffa4fa3d362133/10.1/jre25/temurin-noble/Dockerfile |
| JDK 21 + Temurin + Ubuntu Noble | 10.1.48-jdk21-temurin-noble, 10-jdk21-temurin-noble | https://github.com/docker-library/tomcat/blob/480e55f6c958e717cc9aa8923cffa4fa3d362133/10.1/jdk21/temurin-noble/Dockerfile |
| JRE 21 + Temurin + Ubuntu Noble | 10.1.48-jre21-temurin-noble, 10-jre21-temurin-noble | https://github.com/docker-library/tomcat/blob/480e55f6c958e717cc9aa8923cffa4fa3d362133/10.1/jre21/temurin-noble/Dockerfile |
| JDK 17 + Temurin + Ubuntu Noble | 10.1.48-jdk17-temurin-noble, 10-jdk17-temurin-noble | https://github.com/docker-library/tomcat/blob/480e55f6c958e717cc9aa8923cffa4fa3d362133/10.1/jdk17/temurin-noble/Dockerfile |
| JRE 17 + Temurin + Ubuntu Noble | 10.1.48-jre17-temurin-noble, 10-jre17-temurin-noble | https://github.com/docker-library/tomcat/blob/480e55f6c958e717cc9aa8923cffa4fa3d362133/10.1/jre17/temurin-noble/Dockerfile |
| 标签格式 | 示例标签 | Dockerfile链接 |
|---|---|---|
| JDK 25 + Temurin + Ubuntu Noble | 9.0.111-jdk25-temurin-noble, 9-jdk25-temurin-noble | https://github.com/docker-library/tomcat/blob/64514e960376b7e889c705ce48f6a57af1cff0de/9.0/jdk25/temurin-noble/Dockerfile |
| JRE 25 + Temurin + Ubuntu Noble | 9.0.111-jre25-temurin-noble, 9-jre25-temurin-noble | https://github.com/docker-library/tomcat/blob/64514e960376b7e889c705ce48f6a57af1cff0de/9.0/jre25/temurin-noble/Dockerfile |
| JDK 21 + Temurin + Ubuntu Noble | 9.0.111-jdk21-temurin-noble, 9-jdk21-temurin-noble | https://github.com/docker-library/tomcat/blob/64514e960376b7e889c705ce48f6a57af1cff0de/9.0/jdk21/temurin-noble/Dockerfile |
| JRE 21 + Temurin + Ubuntu Noble | 9.0.111-jre21-temurin-noble, 9-jre21-temurin-noble | https://github.com/docker-library/tomcat/blob/64514e960376b7e889c705ce48f6a57af1cff0de/9.0/jre21/temurin-noble/Dockerfile |
| JDK 17 + Temurin + Ubuntu Noble | 9.0.111-jdk17-temurin-noble, 9-jdk17-temurin-noble | https://github.com/docker-library/tomcat/blob/64514e960376b7e889c705ce48f6a57af1cff0de/9.0/jdk17/temurin-noble/Dockerfile |
| JRE 17 + Temurin + Ubuntu Noble | 9.0.111-jre17-temurin-noble, 9-jre17-temurin-noble | https://github.com/docker-library/tomcat/blob/64514e960376b7e889c705ce48f6a57af1cff0de/9.0/jre17/temurin-noble/Dockerfile |
| JDK 8 + Temurin + Ubuntu Noble | 9.0.111-jdk8-temurin-noble, 9-jdk8-temurin-noble | https://github.com/docker-library/tomcat/blob/64514e960376b7e889c705ce48f6a57af1cff0de/9.0/jdk8/temurin-noble/Dockerfile |
| JRE 8 + Temurin + Ubuntu Noble | 9.0.111-jre8-temurin-noble, 9-jre8-temurin-noble | https://github.com/docker-library/tomcat/blob/64514e960376b7e889c705ce48f6a57af1cff0de/9.0/jre8/temurin-noble/Dockerfile |
标签说明:标签格式为
[Tomcat版本]-[JDK/JRE版本]-[JVM提供商]-[基础镜像],如11.0.13-jdk25-temurin-noble表示Tomcat 11.0.13、JDK 25、Temurin JVM、基于Ubuntu Noble。
运行默认Tomcat服务器(使用catalina.sh run启动):
bashdocker run -it --rm amd64/tomcat:latest
将容器的8080端口映射到主机的8888端口,便于外部访问:
bashdocker run -it --rm -p 8888:8080 amd64/tomcat:9.0
访问http://localhost:8888或http://主机IP:8888即可访问Tomcat(默认无Web应用,会显示404页面)。
通过挂载本地Web应用到容器的webapps目录部署应用:
bashdocker run -it --rm -p 8080:8080 -v /path/to/your/webapp:/usr/local/tomcat/webapps/your-webapp amd64/tomcat:latest
注意:上游提供的示例Web应用默认未启用,位于容器内
/usr/local/tomcat/webapps.dist目录,如需启用可复制到webapps目录:bashdocker run -it --rm -p 8080:8080 amd64/tomcat:latest bash -c "cp -r /usr/local/tomcat/webapps.dist/* /usr/local/tomcat/webapps/ && catalina.sh run"
创建docker-compose.yml文件:
yamlversion: '3.8' services: tomcat: image: amd64/tomcat:11.0-jdk21-temurin-noble container_name: tomcat-server ports: - "8080:8080" # HTTP端口 - "8009:8009" # AJP端口(如需要) volumes: - ./webapps:/usr/local/tomcat/webapps # 挂载Web应用目录 - ./conf:/usr/local/tomcat/conf # 挂载配置文件目录(可选) - tomcat-logs:/usr/local/tomcat/logs # 挂载日志目录 environment: - CATALINA_OPTS=-Xms512m -Xmx1024m # JVM内存配置 - TZ=Asia/Shanghai # 设置时区 restart: unless-stopped volumes: tomcat-logs: # 持久化日志数据
启动服务:
bashdocker-compose up -d
Tomcat配置文件位于容器内/usr/local/tomcat/conf/目录,主要配置文件包括:
server.xml:服务器核心配置(端口、连接器、引擎等)web.xml:Web应用默认配置tomcat-users.xml:用户认证配置context.xml:上下文配置如需自定义配置,可通过挂载本地配置文件覆盖:
bashdocker run -it --rm -p 8080:8080 -v /path/to/your/server.xml:/usr/local/tomcat/conf/server.xml amd64/tomcat:latest
默认tomcat-users.xml中无用户配置,无法访问"/manager/html"管理页面。需编辑tomcat-users.xml添加用户:
xml<tomcat-users xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0"> <user username="admin" password="securepassword" roles="manager-gui,admin-gui"/> </tomcat-users>
挂载修改后的配置文件启动:
bashdocker run -it --rm -p 8080:8080 -v /path/to/your/tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml amd64/tomcat:latest
容器内
以下是 amd64/tomcat 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务