Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Learn the introduction and installation of Docker:docker from me (1)

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

When is docker?

Docker provides container resource isolation and resource restrictions through kernel virtualization technologies (namespaces and cgroups). Because Docker is isolated through the virtualization of the operating system layer (there are requirements for the kernel of the operating system, centos6 can not install the latest version of docker, at least the system of centos7, if you need the latest docker features, you need to use unbantu, because the redhalt kernel is lower than the unbantu kernel version), so the Docker container does not need additional operating system overhead like the virtual machine (VM), so it is lighter than the kvm virtual machine. Docker is a software packaging technology.

Docker concept

The main goal of docker is "Build,Ship and Run any App,Angwhere", build, transport, run everywhere: create docker image, package container all system directory files transport: download docker image run: based on the rootfs provided by docker image, start container summary: as long as you can run docker container, then the software already installed in docker image can also run, so docker is a software packaging technology, a build The provenance runs.

Advantages of docker

1. Solved the dependence of operating system and software running environment

two。 For developers, they no longer have to worry about not deploying the development environment.

3. The development environment, test environment and production environment are highly consistent.

4. Another way to let users experience the new features of the product.

Installation of docker

1. Install a CentOS7 (CentOS7.4 for bloggers)

[root@docker01 /] # cat / etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

two。 Modify the hostname to docker01

Hostnamectl set-hostname docker01

3. Configure yum Feed

# Delete local source

Rm-fr / etc/yum.repos.d/local.repo

# download Ali Cloud Source

Curl-o / etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

# download docker feeds

Curl-o / etc/yum.repos.d/docker-ce.repo https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo

# replace the address in the source file with the Tsinghua source

Sed-I's download.docker.compositionmirrors.tuna.tsinghua.edu.cnAccording to dockerMurcephalg'/ etc/yum.repos.d/docker-ce.repo

4. Install docker

Yum install docker-ce-y

5. Start docker, and set it to boot.

[root@docker01 /] # systemctl start docker.service

[root@docker01 /] # systemctl enable docker.service

Created symlink from / etc/systemd/system/multi-user.target.wants/docker.service to / usr/lib/systemd/system/docker.service.

[root@docker01 /] # systemctl status docker.service

● docker.service-Docker Application Container Engine

Loaded: loaded (/ usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)

Active: active (running) since Mon 2019-07-22 10:34:27 CST; 21s ago

Docs: https://docs.docker.com

Main PID: 2602 (dockerd)

CGroup: / system.slice/docker.service

└─ 2602 / usr/bin/dockerd-H fd://-- containerd=/run/containerd/containerd.sock

Jul 22 10:34:27 docker01 dockerd [2602]: time= "2019-07-22T10:34:27.023394018+08:00" level=info msg= "pickfirstBalancer: HandleSubConnStateChange: 0xc4200452e0, REA...module=grpc

Jul 22 10:34:27 docker01 dockerd [2602]: time= "2019-07-22T10:34:27.029328234+08:00" level=info msg= "pickfirstBalancer: HandleSubConnStateChange: 0xc4200450b0, REA...module=grpc

Jul 22 10:34:27 docker01 dockerd [2602]: time= "2019-07-22T10:34:27.043464741+08:00" level=info msg= "Graph migration to content-addressability took 0.00 seconds"

Jul 22 10:34:27 docker01 dockerd [2602]: time= "2019-07-22T10:34:27.044024276+08:00" level=info msg= "Loading containers: start."

Jul 22 10:34:27 docker01 dockerd [2602]: time= "2019-07-22T10:34:27.273802596+08:00" level=info msg= "Default bridge (docker0) is assigned with an IP address 172.17...IP address"

Jul 22 10:34:27 docker01 dockerd [2602]: time= "2019-07-22T10:34:27.334002476+08:00" level=info msg= "Loading containers: done."

Jul 22 10:34:27 docker01 dockerd [2602]: time= "2019-07-22T10:34:27.355108588+08:00" level=info msg= "Docker daemon" commit=0dd43dd graphdriver (s) = overlay2 version=18.09.8

Jul 22 10:34:27 docker01 dockerd [2602]: time= "2019-07-22T10:34:27.355245821+08:00" level=info msg= "Daemon has completed initialization"

Jul 22 10:34:27 docker01 dockerd [2602]: time= "2019-07-22T10:34:27.399274108+08:00" level=info msg= "API listen on / var/run/docker.sock"

Jul 22 10:34:27 docker01 systemd [1]: Started Docker Application Container Engine.

Hint: Some lines were ellipsized, use-l to show in full.

Docker architecture

Start docker: systemctl start docker

Self-booting: systemctl enable docker

Docker is a cs architecture: look at it through docker version

The three most important components of docker: image, container, and repository

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report