自建私有仓库,无法正确获取docker pull 语句
docker pull fk.gcr.io/alpine/alpine@sha256:de78803598bc4c940fc4591d412bffe488205d5d953f94751c6308deeaaa7eb8
无法正确取得版本:
docker pull fk.gcr.io/alpine/alpine:3.10.4
先进入容器: [root@BTI-Test ~]#docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1cbef3da2d5e goharbor/nginx-photon:v2.0.2 "nginx -g 'daemon of…" 2 weeks ago Up 2 weeks (healthy) 0.0.0.0:80->8080/tcp nginx
79335a516026 goharbor/harbor-jobservice:v2.0.2 "/harbor/entrypoint.…" 2 weeks ago Up 2 weeks (healthy) harbor-jobservice
6b63cbfaf18d goharbor/harbor-core:v2.0.2 "/harbor/entrypoint.…" 2 weeks ago Up 2 weeks (healthy) harbor-core
afba1e8044fc goharbor/registry-photon:v2.0.2 "/home/harbor/entryp…" 2 weeks ago Up 2 weeks (healthy) 5000/tcp registry
f46e8a12766e goharbor/harbor-db:v2.0.2 "/docker-entrypoint.…" 2 weeks ago Up 2 weeks (healthy) 5432/tcp harbor-db
86329b3976f5 goharbor/redis-photon:v2.0.2 "redis-server /etc/r…" 2 weeks ago Up 2 weeks (healthy) 6379/tcp redis
c4474fba065f goharbor/harbor-registryctl:v2.0.2 "/home/harbor/start.…" 2 weeks ago Up 2 weeks (healthy) registryctl
b7b7437cfbc1 goharbor/harbor-portal:v2.0.2 "nginx -g 'daemon of…" 2 weeks ago Up 2 weeks (healthy) 8080/tcp harbor-portal
6debb09577ad goharbor/harbor-log:v2.0.2 "/bin/sh -c /usr/loc…" 2 weeks ago Up 2 weeks (healthy) 127.0.0.1:1514->10514/tcp harbor-log
[root@BTI-Test ~]#docker exec -it b7b7437cfbc1 /bin/bash
进入容器:
nginx [ /usr/share/nginx/html ]$ ls -l
total 8216
-rw-r--r-- 1 root root 149395 2020-07-28 09:43 3rdpartylicenses.txt
-rw-r--r-- 1 root root 11347 2020-07-28 09:27 LICENSE
-rw-r--r-- 1 root root 375069 2020-07-28 09:43 dark-theme.css
-rw-r--r-- 1 root root 7455 2020-07-28 09:43 favicon.ico
drwxr-xr-x 3 root root 18 2020-07-28 09:43 i18n
drwxr-xr-x 2 root root 191 2020-07-28 09:43 images
-rw-r--r-- 1 root root 856 2020-07-28 09:43 index.html
-rw-r--r-- 1 root root 389660 2020-07-28 09:43 light-theme.css
-rw-r--r-- 1 root root 5602989 2020-07-28 09:43 main.656e3dacf990c7f767fe.js
-rw-r--r-- 1 root root 71509 2020-07-28 09:43 polyfills-es5.c04cfdffe6ecc730c69c.js
-rw-r--r-- 1 root root 1440 2020-07-28 09:43 runtime.9ad22a88fcc70a015907.js
-rw-r--r-- 1 root root 860407 2020-07-28 09:43 scripts.f4c015c4300c31a9a23c.js
-rw-r--r-- 1 root root 203 2020-07-28 09:43 setting.json
-rw-r--r-- 1 root root 532512 2020-07-28 09:43 styles.1405c69f42cb171461e4.css
-rw-r--r-- 1 root root 153239 2020-07-28 09:34 swagger.json
-rw-r--r-- 1 root root 175030 2020-07-28 09:27 swagger.yaml
-rw-r--r-- 1 root root 29399 2020-07-28 09:34 swagger2.json
-rw-r--r-- 1 root root 13548 2020-07-28 09:34 swagger3.json
[root@BTI-Test ~]#find / -name main.656e3dacf990c7f767fe.js
/root/main.656e3dacf990c7f767fe.js /var/lib/docker/overlay2/9c38e4727b85294933d95fea58d38f1ed5c2bf6cbb96ba86b7d994355c0cfdaa/diff/usr/share/nginx/html/main.656e3dacf990c7f767fe.js /var/lib/docker/overlay2/d1af8b5eac055540aee7cfaaa642c84ab265caf33303f196452e12d5011a2cfd/merged/usr/share/nginx/html/main.656e3dacf990c7f767fe.js
做好备份
[root@BTI-Test ~]#cp /var/lib/docker/overlay2/d1af8b5eac055540aee7cfaaa642c84ab265caf33303f196452e12d5011a2cfd/merged/usr/share/nginx/html/main.656e3dacf990c7f767fe.js /var/lib/docker/overlay2/d1af8b5eac055540aee7cfaaa642c84ab265caf33303f196452e12d5011a2cfd/merged/usr/share/nginx/html/main.656e3dacf990c7f767fe.js.bak
[root@BTI-Test ~]#vi /var/lib/docker/overlay2/d1af8b5eac055540aee7cfaaa642c84ab265caf33303f196452e12d5011a2cfd/merged/usr/share/nginx/html/main.656e3dacf990c7f767fe.js
搜索字符
- artifactPullCommand
将下面字符
t.type === e.type && (e.pullCommand = t.pullCommand + " " + n.registryUrl + "/" + n.projectName + "/" + n.repoName + "@" + e.digest)
更改为:
t.type===e.type&&(e.pullCommand=t.pullCommand+" "+n.registryUrl+"/"+n.projectName+"/"+n.repoName+":"+e.tags[0].name)