docker快捷控制
bash
复制代码
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -aq)
docker restart $(docker ps -aq)
docker stop $(docker-compose ps -aq)
docker rm $(docker-compose ps -aq)
bash
复制代码
curl -sfL https://get.rainbond.com/install_docker | bash
bash
复制代码
## 安装
https://blog.csdn.net/wangyue23com/article/details/121332433
## 卸载:
https://blog.csdn.net/wangerrong/article/details/126750198
bash
复制代码
## 安装:
docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /home/portainer:/data portainer/portainer
## 卸载:
docker stop portainer && docker rm portainer
bash
复制代码
## 下载:
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
## 离线方式,移动
mv -f docker-compose-linux-x86_64 /usr/local/bin/docker-compose
## 授权
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
bash
复制代码
## 参考:
https://blog.csdn.net/weixin_42782429/article/details/131848057
find / -name docker.service
# ExecStart=/usr/local/bin/dockerd
ExecStart=/usr/local/bin/dockerd --tlsverify --tlscacert=/etc/docker/cert/ca.pem --tlscert=/etc/docker/cert/server-cert.pem --tlskey=/etc/docker/cert/server-key.pem -H tcp://0.0.0.0:2376 -H unix://var/run/docker.sock
systemctl daemon-reload && systemctl restart docker
## idea 使用 参考
https://blog.csdn.net/qq_43776514/article/details/124426918
bash
复制代码
## 参考:
https://zhuanlan.zhihu.com/p/542307872
https://codeleading.com/article/90346036597
https://www.cnblogs.com/astonc/p/17307333.html#3.%20%E5%AE%89%E8%A3%85%20Harbor%20%E7%A7%81%E6%9C%89%E4%BB%93%E5%BA%93
https://www.cnblogs.com/gqry/p/17073369.html
bash
复制代码
## 参考:
## 初始化集群
docker swarm init --advertise-addr 192.168.1.93
## 查看工作节点的 token
docker swarm join-token worker
## 查看管理节点的 token
docker swarm join-token manager
## 加入集群中
docker swarm join --token SWMTKN-1-0u9p5yc737gg9wcj9rf3km8dkvzhtsqh6a7r51ii57yi70qot2-6jw1z4iclamvg32iip9m9gafy 192.168.1.93:2377
docker info