linux-centos install offline docker, docker-composer

After the system is installed, the virtual machine can access the downlink address direct download
https://download.docker.com/linux/static/stable/x86_64/

After downloading
tar -xvf docker-18.06.3-ce.tgz (just unzip the downloaded file)
Copy the file to extract the good / usr / bin directory

cp docker / * / usr / bin
will be registered as a docker-Service
Vim /etc/systemd/system/docker.service
the following configurations applied and saved docker.service

[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

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

Start
chmod + x /etc/systemd/system/docker.service # Adding file permissions and start Docker
systemctl daemon-heavy-duty unit # reload the configuration file
systemctl start docker # start Docker
systemctl enable docker.service # Set the boot from Kai

Verify
systemctl status docker # View Docker state
Here Insert Picture Description

docker -v # View Docker version
Here Insert Picture Description
installed docker-compose

In the virtual machine can use git to download
https://github.com/docker/compose/releases/
can also use Baidu cloud disk download

Download the file directly to the / usr / local / bin directory, or can be copied to this directory

sudo chmod + x / usr / local / bin / docker-compose (docker-compose your downloaded file)

sudo ln -s / usr / local / bin / docker-compose / usr / bin / docker-compose
Then you can test to see if the installation was successful

docker-compose --version (you download the docker-compose the file name)

docker docker-compose it and installed a

Published 19 original articles · won praise 0 · Views 3254

Guess you like

Origin blog.csdn.net/Betteryun/article/details/104020877