1.在将镜像推送到搭建的本地镜像仓库时,报错如下
只有部分镜像会产生此现象,推送其他镜像正常
FATA[0000] failed commit on ref "manifest-sha256:58a42dafdb79a0b5693e558eb4c74794e63408715d859ca3d74090daba9bbbd1": unexpected status from PUT request to https://192.168.2.190:5000/v2/xxx/manifests/sha256:58a42dafdb79a0b5693e558eb4c74794e63408715d859ca3d74090daba9bbbd1: 400 Bad Request
2.在排查仓库联通性、代理可用性、镜像完整性后考虑registry版本问题
查看当前registry版本
[root@test1 ~]# /usr/bin/registry --version
/usr/bin/registry github.com/docker/distribution v2.6.2+unknown
3.尝试升级版本
[root@test1 ~]# systemctl stop docker-distribution
[root@test1 ~]# cp back/registry /usr/bin/
cp: overwrite ‘/usr/bin/registry’? y
[root@test1 ~]# /usr/bin/registry --version
/usr/bin/registry github.com/docker/distribution 2.8.3
[root@test1 ~]# systemctl start docker-distribution
4.验证,解决
[root@test1 ~]# nerdctl push 192.168.2.190:5000/xxx/xxx:xx
INFO[0000] pushing as a reduced-platform image (application/vnd.docker.distribution.manifest.list.v2+json, sha256:6516ca99e4bece798b50ca6b3db3365d1daece0f52ed6e3ad8d151cb55ad643f)
INFO[0000] host will try HTTPS first since it is configured for HTTP with a TLS configuration, consider changing host to HTTPS or removing unused TLS configuration host="192.168.2.190:5000"
index-sha256:6516ca99e4bece798b50ca6b3db3365d1daece0f52ed6e3ad8d151cb55ad643f: done |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:58a42dafdb79a0b5693e558eb4c74794e63408715d859ca3d74090daba9bbbd1: done |++++++++++++++++++++++++++++++++++++++|
config-sha256:1ff56c33960b4bbe92c69770afdaeacc0f158009e5b2e59082b81c7a8ee0f6dd: done |++++++++++++++++++++++++++++++++++++++|
elapsed: 0.1 s total: 3.4 Ki (33.6 KiB/s)
5.registry二进制文件,可到github搜索项目下载
含arm和amd架构,版本:2.8.3
链接:https://pan.baidu.com/s/1kUmQihjN-Js6CmhMfyegvw
提取码:x2sa