image
CentOS 7.4.1708 (7.4, 7.4.1708, 7) CentOS 7.3.1611 (7.3, 7.3.1611) CentOS 7.2.1511 (7.2, 7.2.1511) CentOS 7.1.1503 (7.1, 7.1.1503) CentOS 7.0.1406 (7.0, 7.0.1406) CentOS 6.9 (6.9, 6, latest) CentOS 6.8 (6.8) CentOS 6.7 (6.7) CentOS 6.6 (6.6)
install
#CentOS 6 rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum update -y yum -y install docker-io service docker start chkconfig docker on #CentOS 7、Debian、Ubuntu curl -sSL https://get.docker.com/ | sh systemctl start docker systemctl enable docker
docker run -d -p 2222:22 --name CentOS-Docker ilemonrain/centos-sshd
-d: Start mirroring in Daemon (background) mode -P 2222:22: Expose the 2222 port of the host and map it to the 22 port (SSH) inside the container --Name CentOS Locker: container name Ilemonrain/centos sshd: image name
#If you need to expose more internal ports, you can use multiple - p parameters, such as - p 80:80 - p 53:53. If you need to distinguish protocols, please specify after the - p parameter, such as - p 80:80/tcp - p 53:53/udp. #The image of the ilemonorain/centos sshd is CentOS 6.9 by default. If you want to install CentOS 7.4, the following parameter is ilemonorain/centos sshd: 7.4. Other systems use this as a reference. #If you want to deploy multiple CentOS system containers, please change the container names to different ones!
User name: root Password: centos
Copyright notice: This is an original article, and the copyright belongs to Rat's Blog All, please indicate the source for reprinting!
Link to this article: https://www.moerats.com/archives/635/
If the tutorial needs to be updated, or 404 appears on the related link, you can leave a comment below the article.