docker安装CentOS

CentOS 系统简介

CentOS 和 Fedora 都是基于 Redhat 的常见 Linux 分支。CentOS 是目前企业级服务器的常用操作系统;Fedora 则主要面向个人桌面用户。

CentOS 操作系统图 1.23.4.1 - CentOS 操作系统

CentOS(Community Enterprise Operating System,中文意思是:社区企业操作系统),它是基于 Red Hat Enterprise Linux 源代码编译而成。由于 CentOS 与 Redhat Linux 源于相同的代码基础,所以很多成本敏感且需要高稳定性的公司就使用 CentOS 来替代商业版 Red Hat Enterprise Linux。CentOS 自身不包含闭源软件。

使用 CentOS 官方镜像

首先使用 docker search 命令来搜索标星至少为 25 的 CentOS 相关镜像。

1 $ docker search -f stars=25 centos
2 NAME      DESCRIPTION      STARS     OFFICIAL   AUTOMATED
3 centos    The official...  2543      [OK]
4 jdeathe/centos-ssh         27                   [OK]

使用 docker run 直接运行最新的 CentOS 镜像,并登录 bash。

$ docker run -it centos bash
Unable to find image 'centos:latest' locally
latest: Pulling from library/centos
3d8673bd162a: Pull complete
Digest: sha256:a66ffcb73930584413de83311ca11a4cb4938c9b2521d331026dad970c19adf4
Status: Downloaded newer image for centos:latest
[root@43eb3b194d48 /]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

相关资源

  • CentOS 官网:https://getfedora.org/
  • CentOS 官方仓库:https://github.com/CentOS
  • CentOS 官方镜像:https://hub.docker.com/_/centos/
  • CentOS 官方镜像仓库:https://github.com/CentOS/CentOS-Dockerfiles
原文地址:https://www.cnblogs.com/yu-hailong/p/7629293.html