Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Docker install CentOS

Docker install CentOS

CentOS (Community Enterprise Operating System) is one of the Linux distributions; it is compiled from the source code released by Red Hat Enterprise Linux (RHEL) under open-source regulations. Because it comes from the same source code, some servers requiring high stability use CentOS as a replacement for the commercial version of Red Hat Enterprise Linux.

1. Check available CentOS versions

Visit the CentOS image repository address:https://hub.docker.com/_/centos?tab=tags&page=1。

You can use Sort by to view other versions of CentOS. The default is the latest version, centos:latest.

You can also find other versions you want in the drop-down list:

2. Pull a specified version of the CentOS image; here we take installing a specified version (centos7) as an example:

$ docker pull centos:centos7

3. View local images

Use the following command to check whether centos7 is installed:

$ docker images

4. Run the container, and you can enter the CentOS container via the exec command.

$ docker run -itd --name centos-test centos:centos7

5. Installation successful

Finally, we can check the container's running information with the docker ps command: