Docker 快速配置文件

保存 /etc/docker/daemon.json

{
  "registry-mirrors": [
    "https://05f073ad3c0010ea0f4bc00b7105ec20.mirror.swr.myhuaweicloud.com/",
    "http://hub-mirror.c.163.com/"
  ],
  "dns": ["114.114.114.114", "223.5.5.5"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3",
    "labels": "production_status",
    "env": "os,customer"
  }
}

扩展的配置,配置 nvidia 的直连,需要 nvidia-container。

{
        "runtimes": {
                "nvidia": {
                        "path": "nvidia-container-runtime",
                        "runtimeArgs": []
                }
        },
        "default-runtime": "nvidia",
        "registry-mirrors": [
                "https://docker.mirrors.ustc.edu.cn"
        ],
        "dns": ["1.0.0.1", "223.5.5.5"],
        "log-driver": "json-file",
        "log-level": "error",
        "log-opts": {
                "cache-disabled": "false",
                "cache-max-file": "5",
                "cache-max-size": "20m",
                "cache-compress": "true",
                "env": "os,customer",
                "max-file": "5",
                "max-size": "10m"
        }
}

Docker Hub 的镜像