在docker中安装镜像,一般过程是,docker search 软件名称。
本文以tomcat为例,讲解下载指定版本TAG的tomcat。
搜索tomcat镜像
linuxidc@linuxidc:~/www.linuxidc.com$ sudo docker search tomcat
[sudo] linuxidc 的密码:
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
tomcat Apache Tomcat is an open source implementati… 2322 [OK]
tomee Apache TomEE is an all-Apache Java EE certif… 64 [OK]
dordoka/tomcat Ubuntu 14.04, Oracle JDK 8 and Tomcat 8 base… 52 [OK]
davidcaste/alpine-tomcat Apache Tomcat 7/8 using Oracle Java 7/8 with… 34 [OK]
bitnami/tomcat Bitnami Tomcat Docker Image 27 [OK]
cloudesire/tomcat Tomcat server, 6/7/8 14 [OK]
meirwa/spring-boot-tomcat-mysql-app a sample spring-boot app using tomcat and My… 12 [OK]
aallam/tomcat-mysql Debian, Oracle JDK, Tomcat & MySQL 11 [OK]
tutum/tomcat Base docker image to run a Tomcat applicatio… 11
jeanblanchard/tomcat Minimal Docker image with Apache Tomcat 8
arm32v7/tomcat Apache Tomcat is an open source implementati… 6
maluuba/tomcat7-java8 Tomcat7 with java8. 3
rightctrl/tomcat CentOS , Oracle Java, tomcat application ssl… 3 [OK]
amd64/tomcat Apache Tomcat is an open source implementati… 2
fabric8/tomcat-8 Fabric8 Tomcat 8 Image 2 [OK]
arm64v8/tomcat Apache Tomcat is an open source implementati… 2
99taxis/tomcat7 Tomcat7 1 [OK]
camptocamp/tomcat-logback Docker image for tomcat with logback integra… 1 [OK]
1and1internet/debian-9-java-8-tomcat-8.5 Our tomcat 8.5 image 0 [OK]
swisstopo/service-print-tomcat backend tomcat for service-print "the true, … 0
picoded/tomcat7 tomcat7 with jre8 and MANAGER_USER / MANAGER… 0 [OK]
oobsri/tomcat8 Testing CI Jobs with different names. 0
cfje/tomcat-resource Tomcat Concourse Resource 0
jelastic/tomcat An image of the Tomcat Java application serv… 0
s390x/tomcat Apache Tomcat is an open source implementati… 0
发现只有tomcat,而如果docker pull tomcat,下载下来的是最新版的tomcat,也就是tomcat11。假设希望下载的是tomcat:8-jre8。那么该如何做呢?
如果search出来的镜像,不是自己想要的版本,可通过在docker hub上搜索好版本TAG
地址如下:https://hub.docker.com/
进入之后,在页面左上角搜索框搜索
搜索出来之后,点详情
点击标签
在下面通过翻页,找到8-jre标签
复制标签名:8-jre8
下载tomcat镜像
$ sudo docker pull tomcat:8-jre8