Docker concept and installation method

Docker concept and installation method

1. Introduction to Docker

Docker is an open source application container engine, developed based on the Go language and complies with the Apache 2.0 protocol. It is an open source application container engine.

An open platform for the development, delivery and operation of applications.

Docker allows developers to package their applications and dependent packages into a lightweight, portable container, and then publish to

Virtualization can also be achieved on any popular Linux machine. The container is completely using the sandbox mechanism, and there will be nothing between each other.

The interface, and more importantly, the container performance overhead is extremely low. Note: Sandbox: In the field of computer security, sandbox is a process

Isolated operating mechanism

Docker has been divided into CE (Community Edition: Community Edition) and EE (Enterprise Edition:

Enterprise Edition).

Two, Docker application scenarios

Package the application to simplify the deployment process

Can be freely migrated away from the underlying hardware (Isolation of the application is realized, and the application is split and decoupled)

Continuous integration and continuous delivery (CI/CD): development to test release

Deploy microservices

Provide PAAS products (platform as a service)

Three, the core concept of Docker

Mirroring

A read-only template for the docker container engine (that is, to package an environment where a service has been deployed)

container

A running instance (ie virtual machine) created based on the image

warehouse

A place to centrally save images (divided into public warehouses and private warehouses, the public warehouse is the official docker warehouse)

Fourth, the installation method of Docker

Install dependencies

yum install -y yum-utils device-mapper-persistent-data lvm2

Set Alibaba Cloud image source

yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Install Docker-CE

systemctl stop firewalld.service

setenforce 0

vim /etc/selinux/config
SELINUX=disabled

yum install -y docker-ce

systemctl start docker.service
systemctl enable docker.service

Insert picture description here

Mirror acceleration

Just go to the official website of Alibaba Cloud to register

Insert picture description here

tee /etc/docker/daemon.json <<-'EOF'
{
    
    
  "registry-mirrors": ["https://xxxxxxxx.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker

Network Optimization

echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf
sysctl -p

systemctl restart network
systemctl restart docker

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44505291/article/details/115124606