Docker Install CentOS

Docker Install CentOS

CentOS (Community Enterprise Operating System) is one of the Linux distributions that comes from the source code of Red Hat Enterprise Linux (RHEL) compiled in accordance with open source regulations. Because it comes from the same source code, some servers that require high stability use CentOS instead of the commercial version of Red Hat Enterprise Linux.

1. Check the available CentOS versions

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

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

Docker Install CentOS

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

Docker Install CentOS

2. Pull the CentOS image of the specified version, here we install the specified version for example (centos7):

$ docker pull centos:centos7

Docker Install CentOS

3. Check the local image

Use the following command to see if centos7 is installed.

$ docker images

Docker Install CentOS

4. Run the container and you can access the CentOS container with the exec command.

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

Docker Install CentOS

5. Successful installation

Finally, we can view the running information of the container by using the docker ps command.

Docker Install CentOS

Like(0)