玖叶教程网

前端编程开发入门

如何查看仓库(REPOSITORY)的具体版本了

我们通常从docker仓库里下载了PHP,不知道什么版本的。

我们看一下库里有什么镜像

[root@localhost ~]# docker image ls
[root@localhost ~]# docker image ls
REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
nginx         latest    605c77e624dd   16 months ago   141MB
php           7.4-fpm   854be5bd67a6   16 months ago   460MB
php           latest    13b9b1961ba3   16 months ago   484MB
mysql         latest    3218b38490ce   16 months ago   516MB
hello-world   latest    feb5d9fea6a5   19 months ago   13.3kB

很明显上面写的是PHP的 TAG为 latest,另一个显示的是7.4-fpm。

我们可以用下面的命令来看看,latest的最新版本是什么:

docker image inspect (docker image名称):latest|grep -i version

如果看php 那么就应该是:

[root@localhost ~]# docker image inspect php:latest|grep -i version

得到的结果如下:

[root@localhost ~]# docker image inspect php:latest|grep -i version
                "PHP_VERSION=8.1.1",
        "DockerVersion": "20.10.7",
                "PHP_VERSION=8.1.1",

可以看到PHP的版本号为:8.1.1


发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言