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 install the Docker package offline using CentOS 8.4

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article shows you how to use CentOS 8.4 offline installation Docker package, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.

The virtual machine of CentOS 8.4, the simulated server environment, can not connect to the external network, so the software can only be installed offline.

First of all, download the Docker installation package from the external network machine and download the address:

Index of linux/static/stable/x86_64/

Https://download.docker.com/linux/static/stable/x86_64/

You can download the corresponding version according to your own needs. What I downloaded is 20.10.8.

Extract the package:

Tar zxvf docker-20.10.8.tgz

Get the docker folder, enter the folder, and you can see the following files:

In order for the docker command to be executed anywhere, you need to move the above files to a system executable directory, such as the / usr/bin directory, or add the current directory to the environment variable. Here, we use the first way.

Cp * / usr/bin/

You can choose not to overwrite runc.

At this point, you are ready to execute the docker command, and the following command can view the version information of docker.

Further, to facilitate the management of docker, we need to configure docker service. Create a docker.service file in the / etc/systemd/system directory with the following contents:

[Unit] Description=Docker Application Container EngineDocumentation= https://docs.docker.comAfter=network-online.target firewalld.serviceWants=network-online.target [Service] Type=notify# the default is not to use systemd for cgroups because the delegate issues still# exists and systemd currently does not support the cgroup feature set required# for containers run by dockerExecStart=/usr/bin/dockerd-H tcp://0.0.0.0:2375-H unix://var/run/docker.sockExecReload=/bin/kill-s HUP $MAINPID# Having non-zero Limit*s causes performance problems due to accounting overhead# in the kernel. We recommend using cgroups to do container-local accounting.LimitNOFILE=infinityLimitNPROC=infinityLimitCORE=infinity# Uncomment TasksMax if your systemd version supports it.# Only systemd 226 and above support this version.#TasksMax=infinityTimeoutStartSec=0# set delegate yes so that systemd does not reset the cgroups of docker containersDelegate=yes# kill only the docker process, not all processes in the cgroupKillMode=process# restart the docker process if it exits prematurelyRestart=on-failureStartLimitBurst=3StartLimitInterval=60s [Install] WantedBy=multi-user.target

Add executable permissions to docker.service:

Chmod + x / etc/systemd/system/docker.service

Reload the service profile:

Systemctl daemon-reload

Restart docker:

Systemctl restart docker

Enable power on self-boot:

Systemctl enable docker

View docker status:

Systemctl status docker

The above content is how to use CentOS 8.4 offline installation Docker package, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to 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

Development

Wechat

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

12
Report