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
Preface Using css to generate dotted lines is a p...
In actual development, the primary key of MySQL c...
1. Use of CSS scope (style division) In Vue, make...
There are three pages A, B, and C. Page A contains...
In this blog, we will discuss ten performance set...
Table of contents 1. Introduction to SELinux 2. B...
1. Simple configuration of nginx's dynamic an...
■ Website theme planning Be careful not to make yo...
Table of contents 1. Install ESXi 2. Set up ESXi ...
I don't expect to be an expert DBA, but when ...
1 System Installation Steps OS Version:1804 Image...
Table of contents Demand background Thought Analy...
view What is a view? What is the role of a view? ...
This article shares the specific code of jQuery t...
Table of contents 01 Introduction to GTID 02 How ...