使用 docker run 直接运行 CentOS 7 镜像,并登录 bash

C:\Users\yhu>docker run -it centos:centos7 bash
Unable to find image 'centos:centos7' locally
centos7: Pulling from library/centos
2d473b07cdd5: Pull complete
Digest: sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4
Status: Downloaded newer image for centos:centos7
[root@3ceb808f5a6c /]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@3ceb808f5a6c /]#

Docker 使用 CentOS 镜像_centos

从镜像的发布日期来看,CentOS 的版本已经有多年没有更新了。

对于操作系统来看,这可能会导致很多潜在的安全性问题。

Docker 使用 CentOS 镜像_容器_02

针对上面的情况,不建议在服务器生产环境中继续使用了。