docker and docker-compose installation

Version:

docker20.10.7
docker-composev.2.16.0

install docker

Download the installation package corresponding to docker

Index of linux/static/stable/x86_64/

Take installing docker-20.10.7.tgz  as an example

tar zxf docker-20.10.7.tgz

sudo cp docker/* /usr/bin/

sudo dockerd &

touch  /usr/lib/systemd/system/docker.service

touch /etc/systemd/system/docker.service
cat > /etc/systemd/system/docker.service << EOF

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
 
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
 
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
#重载unit配置文件
systemctl start docker
#启动Docker
systemctl enable docker.service
#Set boot self-start
systemctl status docker
#View Docker status

docker -v
#View Docker version

#install docker-compose

wget https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64
cp docker-compose-linux-x86_64 /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Guess you like

Origin blog.csdn.net/qq_30381077/article/details/129121433