镜像获取
直接下载
|
0 1 2 |
docker pull ghcr.io/project-zot/zot:v2.1.14 |
百度云
上传过程记录
|
0 1 2 3 |
docker load -i zot-v2.1.14.tar.gz docker load -i zot-v2.1.14-qunhui.tar.gz docker image ls |
从百度云下载
百度云总文件夹: https://pan.baidu.com/s/5U9ZYswxhKohgcmqKvdopPg
通用镜像: https://pan.baidu.com/s/1xYEncWT2WIVNL23bPGA8rw?pwd=py3z
群晖镜像: https://pan.baidu.com/s/1JuQqTgrf9fE46rHpTiWAuw?pwd=hmm2
|
0 1 2 3 |
docker load -i zot-v2.1.14.tar.gz docker load -i zot-v2.1.14-qunhui.tar.gz docker image ls |
准备相关文件夹和配置文件
|
0 1 2 3 4 5 6 7 8 |
BASE_DIR=/volume1/docker/zot mkdir -p $BASE_DIR/etc mkdir -p $BASE_DIR/data mkdir -p $BASE_DIR/var/log touch $BASE_DIR/etc/config.json touch $BASE_DIR/etc/htpasswd touch $BASE_DIR/var/log/zot.log touch $BASE_DIR/var/log/zot-audit.log |
密码文件$BASE_DIR/etc/htpasswd随便找个服务器生成
|
0 1 2 3 |
apt install apache2-utils htpasswd -bnB hyl hyltest > $BASE_DIR/etc/htpasswd echo 'hyl:$2y$05$0IClVO/Yg0LBeWenhf.EzuNK/23oTjBeViAIbjE6SlPi07Dz21LOW' |
配置文件$BASE_DIR/etc/config.json内容如下
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
{ "distSpecVersion": "1.0.1", "storage": { "dedupe": true, "gc": true, "gcDelay": "1h", "gcInterval": "6h", "rootDirectory": "/data/zot" }, "http": { "address": "0.0.0.0", "externalUrl": "http://registry.hylstudio.local", "port": "80", "compat": [ "docker2s2" ], "auth": { "htpasswd": { "path": "/etc/zot/htpasswd" } }, "accessControl": { "adminPolicy": { "users": [ "hyl" ], "actions": [ "read", "create", "update", "delete" ] }, "repositories": { "**": { "anonymousPolicy": [ "read", "create", "update" ] } } } }, "log": { "level": "debug", "output": "/var/log/zot/zot.log", "audit": "/var/log/zot/zot-audit.log" }, "extensions": { "ui": { "enable": true }, "search": { "enable": true, "cve": { "updateInterval": "24h" } }, "sync": { "enable": true, "registries": [ { "content": [ { "destination": "/quay.io", "prefix": "**" } ], "onDemand": true, "tlsVerify": true, "urls": [ "https://quay.io" ] }, { "content": [ { "destination": "/xpkg.upbound.io", "prefix": "**" } ], "onDemand": true, "tlsVerify": true, "urls": [ "https://xpkg.upbound.io" ] }, { "content": [ { "prefix": "**" } ], "onDemand": true, "tlsVerify": true, "urls": [ "https://registry-1.docker.io" ] }, { "content": { "destination": "/registry.k8s.io", "prefix": "**" }, "onDemand": true, "tlsVerify": true, "urls": [ "https://registry.k8s.io" ] }, { "content": { "destination": "/gcr.io", "prefix": "**" }, "onDemand": true, "tlsVerify": true, "urls": [ "https://gcr.io" ] }, { "content": { "destination": "/ghcr.io", "prefix": "**" }, "onDemand": true, "tlsVerify": true, "urls": [ "https://ghcr.io" ] }, { "content": { "destination": "/registry.gitlab.com", "prefix": "**" }, "onDemand": true, "tlsVerify": true, "urls": [ "https://registry.gitlab.com" ] } ] } } } |
启动服务
通用镜像
|
0 1 2 3 4 5 6 7 8 9 |
docker rm -f zot docker run -d --name zot \ -p 8080:80 \ -v $BASE_DIR/etc/htpasswd:/etc/zot/htpasswd \ -v $BASE_DIR/etc/config.json:/etc/zot/config.json \ -v $BASE_DIR/var/log/zot.log:/var/log/zot/zot.log \ -v $BASE_DIR/var/log/zot-audit.log:/var/log/zot/zot-audit.log \ -v $BASE_DIR/data:/data/zot \ ghcr.io/project-zot/zot:v2.1.14 |
访问
|
0 1 2 |
http://192.168.0.3:8080 |
群晖镜像
制作过程记录
群晖Container Manager需要镜像主动声明EXPOSE端口才能勾选web stationd配置,手动修改镜像如下
|
0 1 2 |
FROM ghcr.io/project-zot/zot:v2.1.14 EXPOSE 80 |
打包到本地文件上传到百度云
|
0 1 2 3 4 |
docker tag -t registry.hylstudio.local/ghcr.io/project-zot/zot:v2.1.14-expose . docker push registry.hylstudio.local/ghcr.io/project-zot/zot:v2.1.14-expose docker tag registry.hylstudio.local/ghcr.io/project-zot/zot:v2.1.14-expose ghcr.io/project-zot/zot:v2.1.14-expose docker save -o zot-v2.1.14-qunhui.tar.gz ghcr.io/project-zot/zot:v2.1.14-expose |
启动命令
|
0 1 2 3 4 5 6 7 |
docker run -d --name zot \ -v $BASE_DIR/etc/htpasswd:/etc/zot/htpasswd \ -v $BASE_DIR/etc/config.json:/etc/zot/config.json \ -v $BASE_DIR/var/log/zot.log:/var/log/zot/zot.log \ -v $BASE_DIR/var/log/zot-audit.log:/var/log/zot/zot-audit.log \ -v $BASE_DIR/data:/data/zot \ ghcr.io/project-zot/zot:v2.1.14-expose |
手动启动一次后,通过群晖网页修改后续配置暴露即可
访问
|
0 1 2 |
http://registry.hylstudio.local |
参考文档
https://github.com/project-zot/zot
https://zotregistry.dev/v2.1.14/install-guides/install-guide-linux/#about-binary-images
https://zotregistry.dev/v2.1.14/articles/mirroring/#mirroring-modes
https://zotregistry.dev/v2.1.14/general/releases/?h=docker#getting-container-images