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

Overview of time configuration under Linux system

1. Time types are divided into: 1. Network time (...

JavaScript setTimeout and setTimeinterval use cases explained

Both methods can be used to execute a piece of ja...

Example of how nginx implements dynamic and static separation

Table of contents Deploy nginx on server1 Deploy ...

Solution to the problem that Docker container cannot be stopped or killed

Docker version 1.13.1 Problem Process A MySQL con...

How to recover files accidentally deleted by rm in Linux environment

Table of contents Preface Is there any hope after...

Getting Started with MySQL - Concepts

1. What is it? MySQL is the most popular relation...

How to forget the root password in Mysql8.0.13 under Windows 10 system

1. First stop the mysql service As an administrat...

5 Ways to Send Emails in Linux Command Line (Recommended)

When you need to create an email in a shell scrip...

Upgrading Windows Server 2008R2 File Server to Windows Server 2016

The user organization has two Windows Server 2008...

Analysis of two usages of the a tag in HTML post request

Two examples of the use of the a tag in HTML post...

CSS3+Bezier curve to achieve scalable input search box effect

Without further ado, here are the renderings. The...

Some summary of MySQL's fuzzy query like

1. Common usage: (1) Use with % % represents a wi...

Layui implements sample code for multi-condition query

I recently made a file system and found that ther...