In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains the "steps to install Docker CE in CentOS". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn the steps of installing Docker CE in CentOS.
CentOS install Docker CE
Install Docker CE
System requirements
Uninstall the old version
Preparatory work
Install using yum
Use script to install automatically
Start Docker CE
Establish a docker user group
Test whether Docker is installed correctly
Mirror acceleration
Add kernel parameters
Reference documentation
CentOS install Docker CE
Warning: do not directly use the yum command to install Docker. Docker YUM without configuring the Docker source.
Preparation work system requirements
Docker CE supports the 64-bit version of CentOS 7, and requires a kernel version of no less than 3.10. CentOS 7 meets the minimum kernel requirements, but due to the lower kernel version, some features (such as overlay2 storage layer drivers) cannot be used, and some functions may be unstable.
Uninstall the old version
The old version of Docker is called docker or docker-engine, and use the following command to uninstall the old version:
$sudo yum remove docker\ docker-client\ docker-client-latest\ docker-common\ docker-latest\ docker-latest-logrotate\ docker-logrotate\ docker-selinux\ docker-engine-selinux\ Docker-engine is installed using yum
Execute the following command to install the dependency package:
$sudo yum install-y yum-utils\ device-mapper-persistent-data\ lvm2
In view of domestic network problems, it is strongly recommended to use domestic sources. Please check the official sources in the notes.
Execute the following command to add the yum software source:
$sudo yum-config-manager\-add-repo\ https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo# official source # $sudo yum-config-manager\ #-add-repo\ # https://download.docker.com/linux/centos/docker-ce.repo
If you need a test version of Docker CE, use the following command:
$sudo yum-config-manager-enable docker-ce-test
If you need a daily build of Docker CE, use the following command:
$sudo yum-config-manager-- enable docker-ce-nightly installs Docker CE
Update the yum software source cache and install docker-ce.
$sudo yum makecache fast$ sudo yum install docker-ce automatically installs using scripts
Docker officially provides a convenient set of installation scripts in a test or development environment to simplify the installation process, which can be used on CentOS systems:
$curl-fsSL get.docker.com-o get-docker.sh$ sudo sh get-docker.sh-- mirror Aliyun
After executing this command, the script automatically prepares everything and installs the Edge version of Docker CE on the system.
Start Docker CE$ sudo systemctl enable docker$ sudo systemctl start docker to establish docker user group
By default, the docker command uses Unix socket to communicate with the Docker engine. Only root users and users of the docker group can access the Unix socket of the Docker engine. For security reasons, root users are not directly used on Linux systems. Therefore, it is better to add users who need to use docker to the docker user group.
Set up a docker group:
$sudo groupadd docker
Add the current user to the docker group:
$sudo usermod-aG docker $USER
Log out of the current terminal and log in again, and do the following test.
Test whether Docker is installed correctly $docker run hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-worldd1725b59e92d: Pull completeDigest: sha256:0add3ace90ecb4adbf7777e9aacf18357296e799f81cabc9fde470971e499788Status: Downloaded newer image for hello-world:latestHello from docking this message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.To try something more ambitious, you can run an Ubuntu container with: $docker run-it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://hub.docker.com/For more examples and ideas, visit: https://docs.docker.com/get-started/
If the above information can be output normally, the installation is successful.
Mirror acceleration
If you find that pulling Docker images is very slow during use, you can configure Docker domestic image acceleration.
Add kernel parameters
If you use Docker CE in CentOS, you will see the following warning messages:
WARNING: bridge-nf-call-iptables is disabledWARNING: bridge-nf-call-ip6tables is disabled
Please add kernel configuration parameters to enable these features.
$sudo tee-a / etc/sysctl.conf
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.