Get the App
SLTechnology News&Howtos  ›  Development  › 

How to build Docker environment under CentOS7

Shulou Source: shulou.com Published: 2022-06-01 17:05:19 11月14日 Update

This article mainly introduces the relevant knowledge of how to build the Docker environment under CentOS7, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to build the Docker environment under CentOS7. Let's take a look.

Docker is an open source, lightweight container engine that runs on Linux and Windows for creating, managing, and orchestrating containers. Compared with VMware virtual machines, Docker uses containers to host applications instead of the operating system, so it has little overhead and high performance.

1 、 Remove the old version: yum remove docker\ docker-client\ docker-client-latest\ docker-common\ docker-latest\ docker-latest-logrotate\ docker-logrotate\ docker-selinux\ docker-engine-selinux\ Docker-enginerm-rf / etc/systemd/system/docker.service.drm-rf / var/lib/dockerrm-rf / var/run/dockerrm-rf / usr/local/dockerrm-rf / etc/docker2, Install some necessary system tools: yum- y install yum-utils device-mapper-persistent-data lvm23, add software source information: yum-config-manager-add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo4, update yum cache: yum makecache fast5, install Docker-ce:yum-y install docker-ce6, start Docker background service: systemctl start docker7, test run hello-world:docker run hello-world8, install centos And run centos:docker run-itd centos / bin/bash9 in the way of background startup, Enter the centos image: [root@myserver ~] # docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESf57d4703adc3 centos "/ bin/bash" About a minute ago Up About a minute jolly_ dhawan [root @ myserver ~] # docker exec-it f57d4703adc3 / bin/bash [root@f57d4703adc3 /] # [ Root@f57d4703adc3 /] # cat / etc/RedHat-releaseCentOS Linux release 7.6.1810 (Core) [root@f57d4703adc3 /] # this is the end of the article on "how to build a Docker environment under CentOS7" Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to build a Docker environment under CentOS7". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Environment container knowledge run content background article system necessity operating system value tools application overhead engine performance easy to operate article way easy to understand Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Linux Microsoft Shulou Information Shulou Technology