docker上传或拉取镜像时报错误:unauthorized: unauthorized to access repository
时间:2025-06-24 12:23:54 来源:新华社
【字体:  

docker上传或拉取镜像时报错了#xff1a;
ERROR: unauthorized: unauthorized to access repository: 镜像名称 action: pull。
在这里插入图片描述

原因分析。

指定镜像仓库,但没有做镜像仓库认证链接。

解决方式。

或上传之前󿀌只需登录镜像仓库即可。

docker。login 仓库名称。 -u。password#xf1a;#输入密码。

在这里插入图片描述

注意:

一、登录仓库docker login : 登录到Docker镜像仓库,如果没有指定镜像仓库地址󿀌默认为官方仓库 Docker Hub复制代码语法: docker login [OPTIONS] [SERVER]docker login -u 用户名 -p 密码 仓库名称# 进入私人仓库[root@wangzy ~]# docker login --username=你的用户名 registry.cn-hangzhou.aliyuncs.comPassword: WARNING! Your password will be stored unencrypted in /root/.docker/config.json.Configure a credential helper to remove this warning. Seehttps://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded。
二、退出仓库docker logout : 登录Docker镜像仓库,未指定镜像仓库地址,默认为官方仓库 Docker Hub复制代码语法: docker logout [SERVER]# 默认退出官方仓库[root@xxx~]# docker logout Removing login credentials for https://index.docker.io/v1/# 退出私人仓库[root@xxx ~]# docker logout registry.cn-hangzhou.aliyuncs.comRemoving login credentials for registry.cn-hangzhou.aliyuncs.com。

[责任编辑:百度一下]
检察日报数字报 | 正义网 |
Copyrights©最高人民检察院 All Rights Reserved.