欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

docker安装指定版本TAG的镜像

程序员文章站 2023-10-17 20:09:12
在docker中安装镜像,一般过程是,docker search 软件名称。 本文以tomcat为例,讲解下载指定版本TAG的tomcat。 搜索tomcat镜像 发现只有tomcat,而如果docker pull tomcat,下载下来的是最新版的tomcat,也就是tomcat11。假设希望下载 ......

在docker中安装镜像,一般过程是,docker search 软件名称。

本文以tomcat为例,讲解下载指定版本tag的tomcat。

搜索tomcat镜像

$ sudo docker search tomcat
name                                       description                                     stars               official            automated
tomcat                                     apache tomcat is an open source implementati…   2318                [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]
tutum/tomcat                               base docker image to run a tomcat applicatio…   11                                      
aallam/tomcat-mysql                        debian, oracle jdk, tomcat & mysql              11                                      [ok]
...

发现只有tomcat,而如果docker pull tomcat,下载下来的是最新版的tomcat,也就是tomcat11。假设希望下载的是tomcat:8-jre8。那么该如何做呢?

如果search出来的镜像,不是自己想要的版本,可通过在docker hub上搜索好版本tag

地址如下:

进入之后,在页面左上角搜索框搜索

docker安装指定版本TAG的镜像

搜索出来之后,点详情

docker安装指定版本TAG的镜像

点击标签

docker安装指定版本TAG的镜像

在下面通过翻页,找到8-jre标签

docker安装指定版本TAG的镜像

复制标签名:8-jre8

下载tomcat镜像

$ sudo docker pull tomcat:8-jre8