You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker推送私有仓库报错denied: requested access to the resource is denied求解

报错原因
  • Docker 默认推送镜像的目标仓库为公共镜像仓库Docker Hub(docker.io),从你返回的报错日志The push refers to repository [docker.io/library/custom-image]可以明确看出,当前推送请求是发往Docker Hub,而非你登录的some-registry.io私有仓库,因此会因无Docker Hub对应仓库的写入权限被拒绝。
  • 你提到已经为镜像打标签,但实际使用的标签未携带私有仓库地址前缀,不符合私有仓库的镜像推送规则。
解决方案
  1. 为本地镜像重新打上带私有仓库地址前缀的标签,执行命令:
docker tag user/custom-image:1 some-registry.io/user/custom-image:1

可根据实际情况替换命令中的私有仓库地址、用户名、镜像名及标签参数。
2. 使用携带私有仓库前缀的完整镜像名执行推送:

docker push some-registry.io/user/custom-image:1
补充说明

如果重新打标签推送后仍有异常,可先执行docker logout some-registry.io清除本地缓存的登录凭证,再重新登录私有仓库后尝试推送。另外之前登录时使用--password明文传参存在安全风险,建议改用更安全的--password-stdin方式登录,示例命令:

echo "yourPassword" | docker login some-registry.io -u username@corp.company.com --password-stdin

内容的提问来源于stack exchange,提问作者user17182058

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.29 10:57:05