CentOS7 deploys version 19 of docker (simple, you can follow it)

CentOS7 deploys version 19 of docker (simple, you can follow it)

1. Install dependency packages

[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2

2. Set up the Alibaba Cloud image source

[root@localhost ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

3. Install Docker-CE

[root@localhost ~]# yum install -y docker-ce

4. Turn off firewall and enhanced security features

[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# setenforce 0
[root@localhost ~]#

5. Enable the service and set it to start automatically at boot

[root@localhost ~]# systemctl start docker.service
[root@localhost ~]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]#

6. Set up Alibaba Cloud image acceleration

(1) Go to the Alibaba Cloud homepage and select Login. If you don’t have an account, you can register one.

(2) After successful login, select the console

(3) Select products and services, then select container image service

(4) Select the mirror accelerator at the bottom. At this time, you can provide the corresponding accelerator address according to your system. Everyone has their own accelerator address.

(5) Configuring image acceleration

[root@localhost ~]# cd /etc/docker/ ##If this directory does not exist, you need to create it manually [root@localhost docker]# ls
key.json
[root@localhost docker]# tee /etc/docker/daemon.json <<-'EOF' ##Configure image acceleration> {
> "registry-mirrors": ["https://******.******.aliyuncs.com"]
> }
> EOF
{
 "registry-mirrors": ["https://******.*******.aliyuncs.com"]
}
[root@localhost docker]# ls
daemon.json key.json
[root@localhost docker]# systemctl daemon-reload ##Reload the daemon process [root@localhost docker]# systemctl restart docker ##Restart docker
[root@localhost docker]#

7. Enable the system's packet forwarding function

[root@localhost docker]# echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
[root@localhost docker]# sysctl -p ##Load configuration net.ipv4.ip_forward = 1
[root@localhost docker]#

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Implementation of Centos7+Docker+Jenkins+ASP.NET Core 2.0 automated release and deployment
  • Detailed explanation of CentOS7 Docker Nginx deployment and operation
  • Docker Practice - Detailed Explanation of Deploying Kubernetes on CentOS7
  • Docker installation and deployment on CentOS7 system and basic tutorial

<<:  WeChat applet implements simple calculator function

>>:  Will this SQL writing method really cause the index to fail?

Recommend

Detailed explanation of Grid layout and Flex layout of display in CSS3

Gird layout has some similarities with Flex layou...

How to use squid to build a proxy server for http and https

When we introduced nginx, we also used nginx to s...

JavaScript parseInt() and Number() difference case study

Learning objectives: The two functions parseInt()...

How to deploy LNMP & phpMyAdmin in docker

Environmental preparation: Deploy lnmp on a host ...

Docker-compose steps to configure the spring environment

Recently, I need to package the project for membe...

JavaScript implements double-ended queue

This article example shares the specific code of ...

Tutorial on binary compilation and installation of MySql centos7 under Linux

// It took me a whole afternoon to install this, ...

Vue uses the Element el-upload component to step on the pit

Table of contents 1. Basic Use 2. Image quantity ...

Detailed explanation of vue.js dynamic components

:is dynamic component Use v-bind:is="compone...

A problem with MySQL 5.5 deployment

MySQL deployment Currently, the company deploys M...

Detailed explanation of 8 ways to pass parameters in Vue routing components

When we develop a single-page application, someti...

The difference between float and position attributes in CSS layout

CSS Layout - position Property The position attri...

JavaScript plugin encapsulation for table switching

This article shares the encapsulation code of Jav...

Solution to BT Baota Panel php7.3 and php7.4 not supporting ZipArchive

The solution to the problem that the PHP7.3 versi...