Rat's

Linux VPS uses Docker to quickly deploy a CentOS system container
Note: Many of us need new systems to test something. If we don't have many VPS servers, it will be very painful. At this time, we can make
Scan the QR code on the right to read the full text
twenty-three
2018/05

Linux VPS uses Docker to quickly deploy a CentOS system container

explain: Many of us need new systems to test some things, if not more VPS The server is very painful. At this time, we can use it on the only server Docker It is convenient to deploy a new system for us to test, and empty the container directly after the test without affecting the server itself. It seems that you can use this method to VPS There are many similar NAT chick? It's just true NAT The difference is that all the resources are shared. Generally, it is OK to play. Let's share here Blogger of ilemonorain Made CentOS Mirror.

image

1. Image description
This image is based on CentOS Official image production, integration OpenSSH-Server OpenSSH-Client initscripts (You can use service Command) EPEL Mirror source wget passwd tar unzip , meet the minimum operating environment requirements, if other needs, please use it yourself yum install Install.

Be subject to systend stay Docker Compatibility on, CentOS 7.x The system will not be available systemd Relevant procedures (e.g systemctl service Etc.), if you need to start the service in the background, please use CentOS 6.x Image, (the default pulled image is CentOS 6.9 )。

It is recommended to use the latest image( CentOS 6.9 And CentOS 7.4 ), subject to Docker Its own mechanism cannot be used in yum update After upgrading the system version reboot (Restart) Complete the upgrade. Therefore, unless special needs, it is recommended that you use the latest image to avoid many problems.

2. Mirror label

 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

1. Install Docker

 #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

2. Pull CentOS image
Start command:

 docker run -d -p 2222:22 --name CentOS-Docker ilemonrain/centos-sshd

Parameter description:

 -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

Please expose the corresponding ports according to your actual needs.

More instructions:

 #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!

After deployment, SSH Login information:

 User name: root Password: centos

Please login successfully at SSH Modify your SSH Password to prevent malicious explosion.

Vultr New user registration send one hundred USD/ sixteen Each computer room is charged by hour, and Alipay is supported【 Click to view 】。
Last modification: 08:30 PM, May 23, 2018

Comment

2 comments

  1. La La La

    Can Debian be deployed? It takes a small amount of time

    1. Rat's
      @Lala la

      All right, but if you need to find an image, you can go to the docker store to find it