The Docker package is already included in the default CentOS-Extras repository. So if you want to install docker, just run the following yum command: [root@localhost ~]# yum install docker Start the Docker service <br /> After the installation is complete, use the following command to start the Docker service and set it to start at boot: [root@localhost ~]# service docker start [root@localhost ~]# chkconfig docker on (LCTT translation note: The old sysv syntax is used here. For example, the new systemd syntax supported in CentOS 7 is as follows: [root@localhost ~]# systemctl start docker.service [root@localhost ~]# systemctl enable docker.service ) Download the official CentOS image to your local computer [root@localhost ~]# docker pull centos Pulling repository centos 192178b11d36: Download complete 70441cac1ed5: Download complete ae0c2d0bdc10: Download complete 511136ea3c5a: Download complete 5b12ef8fd570: Download complete Confirm that the CentOS image has been obtained: [root@localhost ~]# docker images centos REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE centos centos5 192178b11d36 2 weeks ago 466.9 MB centos centos6 70441cac1ed5 2 weeks ago 215.8 MB centos centos7 ae0c2d0bdc10 2 weeks ago 224 MB centos latest ae0c2d0bdc10 2 weeks ago 224 MB Run a Docker container: [root@localhost ~]# docker run -i -t centos /bin/bash [root@dbf66395436d /]# We can see that the CentOS container has been started and we get a bash prompt. In the docker command we used the "-i to capture standard input and output" and "-t to allocate a terminal or console" options. To disconnect from the container, type exit. [root@cd05639b3f5c /]# cat /etc/redhat-release CentOS Linux release 7.0.1406 (Core) [root@cd05639b3f5c /]# exit exit [root@localhost ~]# We can also search for containers based on Fedora and Ubuntu operating systems. [root@localhost ~]# docker search ubuntu [root@localhost ~]# docker search fedora This is the end of this article about the installation of docker in linux. For more relevant linux docker installation content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Record of the actual process of packaging and deployment of Vue project
>>: MySQL complete collapse: detailed explanation of query filter conditions
Table of contents url module 1.parse method 2. fo...
Why optimize: With the launch of the actual proje...
dig - DNS lookup utility When a domain name acces...
Since myeclipse2017 and idea2017 are installed on...
0x0 Parameter verification Most of the parameter ...
1. Command Introduction bzip2 is used to compress...
Preface The author has always felt that it would ...
The mysql on the server is installed with version...
When Docker starts a container, it specifies the ...
1. The startup menu is to move the cursor to the ...
Why doesn't your height:100% work? This knowl...
Purpose of using Nginx Using Alibaba Cloud ECS cl...
I have been relearning HTML recently, which can be...
1. Force no line break and end with an ellipsis. C...
Method 1: Please add the following code after <...