docker

安装docker-compose

sudo apt update
sudo apt upgrade
sudo apt install docker.io
sudo apt install docker-compose

创建docker组

sudo groupadd docker
sudo usermod -aG docker $username

docker常用systemctl命令

sudo systemctl enable docker
sudo systemctl start docker
sudo systemctl status docker

查看docker信息

sudo docker info

docker换源

sudo nano /etc/docker/daemon.json
# 添加一下内容;
{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "registry-mirrors": [
    "https://docker.1panel.live/"
  ]
}
jq | /etc/docker/daemon.json # 检查json格式
sudo systemctl daemon-reload && sudo systemctl restart docker #重新加载json文件和重启docker