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

How to use RHEL7 Docker Virtualization

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is about how to use RHEL7 Docker virtualization. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it with the editor.

Docker is an open source tool that makes it easy to create and manage linux containers. Containers are like lightweight virtual machines. As a new way of virtualization, Docker has many advantages over traditional virtualization methods.

Environment: Centos7

Ip:172.16.1.10

Docker version 1.13.1

Install docker

[root@localhost ~] # yum install-y docker loaded plug-in: fastestmirror Langpacksbase | 3.6 kB 00:00:00 extras | | 2.9 kB 00:00:00 updates | 2.9 kB 00 | : 00:00 updates/7/x86_64/primary_db | 6.7 MB 00:00:08 Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.neusoft.edu.cn positive After resolving dependencies-- > checking transactions-- > software package docker.x86_64.2.1.13.1-108.git4ef4b30.el7.centos will be installed-- > processing dependencies docker-common = 2docker-common 1.13.1-108.git4ef4b30.el7.centos It is required by the package 2:docker-1.13.1-108.git4ef4b30.el7.centos.x86_64-- > processing dependencies docker-client = 2 108.git4ef4b30.el7.centos 1.13.1-108.git4ef4b30.el7.centos, it is required by the package 2:docker-1.13.1-108.git4ef4b30.el7.centos.x86_64-- > processing dependencies subscription-manager-rhsm-certificates It is required by the package 2:docker-1.13.1-108.git4ef4b30.el7.centos.x86_64-- > checking transactions-> package docker-client.x86_64.2.1.13.1-108.git4ef4b30.el7.centos will be installed-- > package docker-common.x86_64.2.1.13.1-108.git4ef4b30.el7.centos will be installed-- > processing dependency skopeo-containers > = 1docker-client.x86_64.2.1.13.1 0.1.26-2 It is required by the package 2:docker-common-1.13.1-108.git4ef4b30.el7.centos.x86_64-- > processing dependencies oci-umount > = 2oci-umount 2.3.3-3, it is required by the software package 2:docker-common-1.13.1-108.git4ef4b30.el7.centos.x86_64-- > processing dependencies oci-systemd-hook > = 1VR 0.1.4-9 It is required by the package 2:docker-common-1.13.1-108.git4ef4b30.el7.centos.x86_64-- > processing dependencies oci-register-machine > = 1:0-5.13, it is needed by the package 2:docker-common-1.13.1-108.git4ef4b30.el7.centos.x86_64-- > processing dependencies container-storage-setup > = 0.9.0-1 It is required by the package 2:docker-common-1.13.1-108.git4ef4b30.el7.centos.x86_64-- > processing dependencies container-selinux > = 2 2:docker-common-1.13.1 2.51-1, it is needed by the package 2:docker-common-1.13.1-108.git4ef4b30.el7.centos.x86_64.-- > processing dependencies policycoreutils = 2.5-17.1.el7 It is required by package policycoreutils-python-2.5-17.1.el7.x86_64-> package policycoreutils.x86_64.0.2.5-33.el7 will be updated-- > processing dependency libselinux-utils > = 2.5-14 It is required by package policycoreutils-2.5-33.el7.x86_64-- > checking transaction-- > package libselinux.x86_64.0.2.5-11.el7 will be upgraded-- > processing dependency libselinux (x86-64) = 2.5-11.el7 It is required by package libselinux-python-2.5-11.el7.x86_64-> package libselinux.x86_64.0.2.5-14.1.el7 will be updated-- > package libselinux-utils.x86_64.0.2.5-11.el7 will be upgraded-- > package libselinux-utils.x86_64.0.2.5-14.1.el7 will be updated-- > package libsemanage- Python.x86_64.0.2.5-8.el7 will be upgraded-> package libsemanage-python.x86_64.0.2.5-14.el7 will be updated-- > package libsepol.x86_64.0.2.5-6.el7 will be upgraded-- > package libsepol.x86_64.0.2.5-10.el7 will be updated-- > package policycoreutils-python.x86_64.0. 2.5-17.1.el7 will be upgraded-> package policycoreutils-python.x86_64.0.2.5-33.el7 will be updated-- > processing dependency setools-libs > = 3.3.8-4 It is required by the package policycoreutils-python-2.5-33.el7.x86_64-- > checking transactions-> package libselinux-python.x86_64.0.2.5-11.el7 will be upgraded-- > package libselinux-python.x86_64.0.2.5-14.1.el7 will be updated-- > package setools-libs.x86_64.0.3.3.8-1.1.el7 will Upgraded-- > package setools-libs.x86_64.0.3.3.8-4.el7 will be updated-- > resolve dependencies complete dependency resolution omitted. Upgraded as a dependency: libselinux.x86_64 0 14.1.el7 libsemanage.x86_64 2.5-14.1.el7 libselinux-python.x86_64 0 14.1.el7 libsemanage.x86_64 2.5-14.el7 libsemanage-python. X86 '640 33.el7 policycoreutils-python.x86_64 2.5-14.el7 libsepol.x86_64 0 33.el7 policycoreutils-python.x86_64 0 33.el7 policycoreutils-python.x86_64 0 252.el7_7.6 selinux-policy-targeted-33.el7 selinux-policy.noarch 013. 1-252.el7_7.6 selinux-policy-targeted .noarch 0VOV 3.13.1-252.el7_7.6 setools-libs.x86_64 0RU 3.3.8-4.el7 over!

Start docker

[root@localhost ~] # systemctl start docker

Set boot self-boot

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

Get the image

[root@localhost ~] # docker pull centosUsing default tag: latestTrying to pull repository docker.io/library/centos. Latest: Pulling from docker.io/library/centos8a29a15cefae: Pull complete Digest: sha256:fe8d824220415eed5477b63addf40fb06c3b049404242b31982106ac204f6700Status: Downloaded newer image for docker.io/centos:latest

View the downloaded image

[root@localhost ~] # docker images centosREPOSITORY TAG IMAGE ID CREATED SIZEdocker.io/centos latest 470671670cac 6 weeks ago 237 MB

View docker status

[root@localhost] # systemctl status docker ● docker.service-Docker Application Container Engine Loaded: loaded (/ usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: active (running) since-2020-03-02 20:50:46 CST 27min ago Docs: http://docs.docker.com Main PID: 24748 (dockerd-current) CGroup: / system.slice/docker.service ├─ 24748 / usr/bin/dockerd-current-add-runtime docker-runc=/usr/libexec/docker/docker-runc-current-default-runtime=docker-runc-exec-opt native.cgroupd... └─ 24753 / usr/bin/docker-containerd-current-l unix:///var/run/docker/libcontainerd/docker-containerd.sock-metrics-interval=0-start-timeout 2m-state-.. March 02 20:50:43 localhost.localdomain dockerd-current [24748]: time= "2020-03-02T20:50:43.911901519+08:00" level=info msg= "libcontainerd: new containerd proce...: 24753" March 02 20:50:45 localhost.localdomain dockerd-current [24748]: time= "2020 -03-02T20:50:45.142091477+08:00 "level=info msg=" Graph migration to content-addressa...seconds "March 02 20:50:45 localhost.localdomain dockerd-current [24748]: time=" 2020-03-02T20:50:45.143284289+08:00 "level=info msg=" Loading containers: start. "March 02 20:50:45 localhost.localdomain dockerd-current [24748]: time=" 2003-02T20:50:45.225796058+08:00 "level=info msg=" Firewalld running: true March 02 20:50:45 Localhost.localdomain dockerd-current [24748]: time= "2020-03-02T20:50:45.954561065+08:00" level=info msg= "Default bridge (docker0) is assigne...address" March 02 20:50:46 localhost.localdomain dockerd-current [24748]: time= "2020-03-02T20:50:46.527870909+08:00" level=info msg= "Loading containers: done." March 02 20:50:46 localhost.localdomain dockerd-current [24748]: time= "2020-03-02T20:50:46.629201628+08:00" level=info msg= "Daemon has completed initialization" March 02 20:50:46 localhost.localdomain dockerd-current [24748]: time= "2020-03-02T20:50:46.629229137+08:00" level=info msg= "Docker daemon" commit= "4ef4b30 localhost.localdomain systemd 1.13... n = 1.13.13 March 02 20:50:46 localhost.localdomain systemd [1]: Started Docker Application Container Engine.3 02 20:50:46 localhost.localdomain dockerd-current [24748]: time=" 2020-03-02T20:50:46.642881482+08:00 "level=info msg=" API Listen on / var/run/docker.sock "Hint: Some lines were ellipsized Use-l to show in full. The above is how to use RHEL7 Docker virtualization, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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