自建私有仓库,无法正确获取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
1CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2 31cbef3da2d5e 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 479335a516026 goharbor/harbor-jobservice:v2.0.2 "/harbor/entrypoint.…" 2 weeks ago Up 2 weeks (healthy) harbor-jobservice 56b63cbfaf18d goharbor/harbor-core:v2.0.2 "/harbor/entrypoint.…" 2 weeks ago Up 2 weeks (healthy) harbor-core 6afba1e8044fc goharbor/registry-photon:v2.0.2 "/home/harbor/entryp…" 2 weeks ago Up 2 weeks (healthy) 5000/tcp registry 7f46e8a12766e goharbor/harbor-db:v2.0.2 "/docker-entrypoint.…" 2 weeks ago Up 2 weeks (healthy) 5432/tcp harbor-db 886329b3976f5 goharbor/redis-photon:v2.0.2 "redis-server /etc/r…" 2 weeks ago Up 2 weeks (healthy) 6379/tcp redis 9c4474fba065f goharbor/harbor-registryctl:v2.0.2 "/home/harbor/start.…" 2 weeks ago Up 2 weeks (healthy) registryctl 10b7b7437cfbc1 goharbor/harbor-portal:v2.0.2 "nginx -g 'daemon of…" 2 weeks ago Up 2 weeks (healthy) 8080/tcp harbor-portal 116debb09577ad 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 12 13
[root@BTI-Test ~]#docker exec -it b7b7437cfbc1 /bin/bash
进入容器:
nginx [ /usr/share/nginx/html ]$ ls -l
1total 8216 2 3-rw-r--r-- 1 root root 149395 2020-07-28 09:43 3rdpartylicenses.txt 4-rw-r--r-- 1 root root 11347 2020-07-28 09:27 LICENSE 5-rw-r--r-- 1 root root 375069 2020-07-28 09:43 dark-theme.css 6-rw-r--r-- 1 root root 7455 2020-07-28 09:43 favicon.ico 7drwxr-xr-x 3 root root 18 2020-07-28 09:43 i18n 8drwxr-xr-x 2 root root 191 2020-07-28 09:43 images 9-rw-r--r-- 1 root root 856 2020-07-28 09:43 index.html 10-rw-r--r-- 1 root root 389660 2020-07-28 09:43 light-theme.css 11-rw-r--r-- 1 root root 5602989 2020-07-28 09:43 main.656e3dacf990c7f767fe.js 12-rw-r--r-- 1 root root 71509 2020-07-28 09:43 polyfills-es5.c04cfdffe6ecc730c69c.js 13-rw-r--r-- 1 root root 1440 2020-07-28 09:43 runtime.9ad22a88fcc70a015907.js 14-rw-r--r-- 1 root root 860407 2020-07-28 09:43 scripts.f4c015c4300c31a9a23c.js 15-rw-r--r-- 1 root root 203 2020-07-28 09:43 setting.json 16-rw-r--r-- 1 root root 532512 2020-07-28 09:43 styles.1405c69f42cb171461e4.css 17-rw-r--r-- 1 root root 153239 2020-07-28 09:34 swagger.json 18-rw-r--r-- 1 root root 175030 2020-07-28 09:27 swagger.yaml 19-rw-r--r-- 1 root root 29399 2020-07-28 09:34 swagger2.json 20-rw-r--r-- 1 root root 13548 2020-07-28 09:34 swagger3.json 21 22
[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)