tar -xvf docker-xxx-xxx.tar
cp docker/* /usr/bin/
vi /etc/systemd/system/docker.service
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
systemctl enable docker.service
systemctl start docker
systemctl stop docker
systemctl restart docker
systemctl status docker
[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
LimitCORE=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
docker pull 镜像名称
docker load -i 镜像文件
docker run -d --name 容器名称 --restart=always --net=host -v 宿主目录:容器目录 镜像名称
docker run -d --name 容器名称 --restart=always --net=bridge -p 宿主端口:容器端口 -v 宿主目录:容器目录 镜像名称
docker ps
docker save 镜像名称:镜像标签 -o 镜像文件
docker rm 容器编号
docker network create --driver macvlan --subnet=192.168.0.0/24 --gateway=192.168.0.1 --ipv6 --subnet=fd00::/64 --gateway=fd00::1 -o parent=br-lan macvlan
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
apk update
apk add docker-cli
apk add busybox-extras