About the problem of offline installation of Docker package on CentOS 8.4

About the problem of offline installation of Docker package on CentOS 8.4

The virtual machine used is CentOS 8.4, which simulates the server environment. It cannot connect to the external network and can only install software offline.

First, download the Docker installation package from the external network machine. Download 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 needs. I downloaded 20.10.8.

Unzip the file package:

tar zxvf docker-20.10.8.tgz

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

In order to make the docker command executable in any location, you need to move the above files to the system executable directory, such as the /usr/bin directory; or add the current directory to the environment variable. Here, we use the first method.

cp * /usr/bin/

Optionally, do not overwrite runc.

At this point, you can execute the docker command. The following command can view the docker version information.

Furthermore, in order to facilitate the management of docker, we need to configure the docker service. Create a docker.service file in the /etc/systemd/system directory. The content of the file is as follows:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=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 docker
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
ExecReload=/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=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
 
[Install]
WantedBy=multi-user.target

Add executable permissions to docker.service:

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

Reload the service configuration file:

systemctl daemon-reload

Restart Docker:

systemctl restart docker

Enable automatic startup:

systemctl enable docker

Check the docker status:

systemctl status docker 

This is the end of this article about CentOS 8.4 offline installation of Docker. For more information about CentOS offline installation of Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed steps to install Docker on CentOS7
  • How to install Docker on CentOS
  • Install Docker on CentOS 7
  • Detailed tutorial on installing Docker on CentOS 8
  • Detailed tutorial on installing Docker on CentOS 8.4
  • The most detailed method to install docker on CentOS 8
  • Install Docker on Centos7 (2020 latest version available, just copy and paste)
  • How to install Docker using scripts under Linux Centos
  • Detailed explanation of configuring Docker's yum source and installing it in CentOS7
  • Detailed tutorial on installing Docker on CentOS 7.5
  • Install a specific version of Docker for CentOS

<<:  JavaScript operation elements teach you how to change the page content style

>>:  SQL ROW_NUMBER() and OVER() method case study

Recommend

How to reset the root password in CentOS7

There are various environmental and configuration...

Nginx configuration based on multiple domain names, ports, IP virtual hosts

1. Type introduction 1.1 Domain-based virtual hos...

Simple steps to configure Nginx reverse proxy with SSL

Preface A reverse proxy is a server that receives...

HTML iframe usage summary collection

Detailed Analysis of Iframe Usage <iframe frame...

Solution for installing opencv 3.2.0 in Ubuntu 18.04

Download opencv.zip Install the dependencies ahea...

W3C Tutorial (11): W3C DOM Activities

The Document Object Model (DOM) is a platform, a ...

Listen directive example analysis in nginx

Plot Review In the previous article, we analyzed ...

How to use async await elegantly in JS

Table of contents jQuery's $.ajax The beginni...

Summary of methods for finding and deleting duplicate data in MySQL tables

Sometimes we save a lot of duplicate data in the ...

Detailed explanation of key uniqueness of v-for in Vue

Table of contents 1. DOM Diff 2. Add key attribut...

Even a novice can understand the difference between typeof and instanceof in js

Table of contents 1. typeof 2. instanceof 3. Diff...

You Probably Don’t Need to Use Switch Statements in JavaScript

Table of contents No switch, no complex code bloc...