Get the App
SLTechnology News&Howtos  ›  Servers  › 

Five minutes to get to know docker

Shulou Source: shulou.com Published: 2022-06-03 10:04:49 12月06日 Update

Main points of content:

I. Overview of docker

II. The core concept and installation mode of docker

3. Docker container operation

IV. Docker resource control

V. docker database management

I. Overview of Docker

What is Docker?

1. It is a lightweight "virtual machine"

two。 Open source tools for running applications in a Linux container

The difference between Docker and virtual machine

Refer to Table 1-1 of the case guidance document

Usage scenario of Docker (spring clond microservice)

1. Packaged applications simplify deployment

two。 Can be migrated at will without underlying hardware

3. For example, servers are migrated from Tencent Cloud to Aliyun

II. The core concept and installation mode of Docker

Core concepts of Docker

1. Mirror image

two。 Container

3. Warehouse (public, private)

Two ways to install Docker in CentOS

1. Use CURL to get Docker's installation script for installation

two。 Use the YUM repository to install Docker

Demo: install Docker on CentOS 7-4

[root@localhost ~] # yum install yum-utils device-mapper-persistent-data lvm2-y [root@localhost ~] # yum-config-manager-- add-repo [root@localhost ~] # ls / etc/yum.repos.d/CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo docker-ce.repo# now displays docker's mirror source [root@localhost ~] # yum install-y docker-ce [root@localhost ~] # systemctl stop firewalld.service [root@localhost ~ ] # setenforce 0 [root@localhost ~] # systemctl start docker.service [root@localhost ~] # systemctl enable docker.service [root@localhost ~] # docker search nginx # search for nginx image NAME DESCRIPTION STARS OFFICIAL AUTOMATEDnginx Official build of Nginx. 12375 [OK] jwilder/nginx-proxy Automated Nginx reverse proxy for docker con... 1704 [OK] richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable of … [OK] linuxserver/nginx An Nginx container, brought to you by LinuxS... 84. The images in the warehouse shown in # are ranked by stars. The higher the stars, the greater the number of downloads. [root@localhost ~] # docker pull nginx# We do not use acceleration to download Using default tag: latestlatest: Pulling from library/nginx000eee12ec04: Downloading 3.083MB/27.09MBeb22865337de: Downloading 1.703MB/23.74MBbee5d581ef8b: Download complete# will be very slow at this time. Sometimes even stutter # We can do an optimization operation here is: image acceleration: this command can search "official Image acceleration" on Aliyun's official website to get its own command code (you need to register the account of Aliyun platform first) ``to find the console, log in and find the "products and Services" on the left, then find the "Container Image Service", and then find the "Image Accelerator" on the left. Select your own system in the "Operation document". Here we need to select "CentOS" to find the image acceleration profile generated by your account `[root@localhost ~] # tee / etc/docker/daemon.json.

Tags: Container data image limit file run name command resource status directory two warehouse mode core device control service management configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Xiaomi Docker Shulou Tech Info Apple