1.下载
docker
Index of linux/static/stable/x86_64/
docker-compose
Overview of installing Docker Compose | Docker Docs
2.docker
/etc/systemd/system/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
[root@localhost opt]# tar -zxvf docker-23.0.6.tgz
docker/
docker/docker-proxy
docker/containerd-shim-runc-v2
docker/ctr
docker/docker
docker/docker-init
docker/runc
docker/dockerd
docker/containerd
[root@localhost opt]# ls
docker docker-23.0.6.tgz docker-compose-linux-x86_64 rh
[root@localhost opt]# cp docker/* /usr/bin/
[root@localhost opt]# cd /
[root@localhost /]# vi /etc/systemd/system/docker.service
[root@localhost /]# chmod +x /etc/systemd/system/docker.service
[root@localhost /]# systemctl daemon-reload
[root@localhost /]# systemctl start docker
[root@localhost /]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /etc/systemd/system/docker.service.
[root@localhost /]# docker -v
Docker version 23.0.6, build ef23cbc
3.docker-compose
[root@localhost opt]# mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
[root@localhost opt]# chmod +x /usr/local/bin/docker-compose
[root@localhost opt]# docker-compose -v
Docker Compose version v2.5.0
补充:
[root@sgrsfil1 zentao]# docker load -i hub.zentao.net_app_zentao.tar
63290f9c9e52: Loading layer [==================================================>] 84.03MB/84.03MB
f9320849a220: Loading layer [==================================================>] 10.75kB/10.75kB
a102eaa7724e: Loading layer [==================================================>] 11.73MB/11.73MB
fc41c82a9f0f: Loading layer [==================================================>] 86.37MB/86.37MB
9193f44c7c3a: Loading layer [==================================================>] 80.5MB/80.5MB
ed0cfb41d961: Loading layer [==================================================>] 2.673MB/2.673MB
c00e8d737e49: Loading layer [==================================================>] 10.3MB/10.3MB
a186fa70a0c6: Loading layer [==================================================>] 7.121MB/7.121MB
95e38b2ff244: Loading layer [==================================================>] 7.473MB/7.473MB
741389c4e3cd: Loading layer [==================================================>] 86.53kB/86.53kB
51dbcd5a2920: Loading layer [==================================================>] 191.7MB/191.7MB
e01df1569d06: Loading layer [==================================================>] 92.16kB/92.16kB
b317d2517248: Loading layer [==================================================>] 15.87kB/15.87kB
5f70bf18a086: Loading layer [==================================================>] 1.024kB/1.024kB
6c4327aabb41: Loading layer [==================================================>] 191.7MB/191.7MB
Loaded image ID: sha256:84e3d3998f9235f65363b0ee702d7b636bba90166b18c0daa15eca8e0f00906e
[root@sgrsfil1 zentao]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 84e3d3998f92 4 months ago 641MB
[root@sgrsfil1 zentao]# docker tag 84e3d3998f92 hub.zentao.net/app/zentao:18.5
[root@sgrsfil1 zentao]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hub.zentao.net/app/zentao 18.5 84e3d3998f92 4 months ago 641MB