[Docker] 基础
删除未使用镜像:
Docker Hub镜像加速源
脚本换源:
1
| bash <(curl -sSL https://linuxmirrors.cn/docker.sh)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| 网易:https://hub-mirror.c.163.com
中科大镜像地址:https://mirrors.ustc.edu.cn/
中科大github地址:https://github.com/ustclug/mirrorrequest
Azure中国镜像地址:https://mirror.azure.cn/
Azure中国github地址:https://github.com/Azure/container-service-for-azure-china
DockerHub镜像仓库: https://hub.docker.com/
阿里云镜像仓库: https://cr.console.aliyun.com
Google镜像仓库: https://console.cloud.google.com/gcr/images/google-containers/GLOBAL
coreos镜像仓库: https://quay.io/repository/
RedHat镜像仓库: https://access.redhat.com/containers
|
阿里云镜像加速服务(每个账号前缀不同,有很大更新延迟):
1
| https://3r1yhp3y.mirror.aliyuncs.com
|
使用watchtower实现自动更新镜像和容器
docker-compose.yml部署
1 2 3 4 5 6 7 8
| version: '3.3' services: watchtower: container_name: watchtower restart: always environment: - TZ=Asia/Shanghai volumes: - '/var/run/docker.sock:/var/run/docker.sock' command: '--cleanup --interval 600' image: 'containrrr/watchtower:latest'
|