github codespaces推送镜像时unauthorized: access token has insufficient scopes 解决方法

最近有镜像构建的需求,于是就使用了github提供的这个codespace来构建docker镜像,但是在构建后进行镜像推送时提示 unauthorized: access token has insufficient scopes ,如下图

这个一看就知道是权限问题, 这里的access token has insufficient scopes是提示我们当前的访问令牌权限域不足。 github默认的docker镜像仓库是ghcr.io ,这个服务我没有开通, 我需要推送镜像到docker.io, 所以需要退出当前默认登录后重新登陆docker.io仓库。

bash 复制代码
docker logout
# 登录到docker.io仓库
docker login --username=tekintian  docker.io

注意,在codespaces里面使用docker login登录docker.io的时候必须要指定用户名,否则就会变成网页授权登录,而login.docker这个网页目前是用不了的!

相关推荐
兵bing31 分钟前
Docker Compose 进阶配置与最佳实践笔记
docker
是良辰44 分钟前
Docker Nginx HTTPS 自签证书部署完整操作文档
nginx·docker·https
瞬间&永恒~2 小时前
【Docker】(四)Namespace 详解
运维·docker·容器
阿里嘎多学长2 小时前
2026-08-04 GitHub 热点项目精选
开发语言·程序员·github·代码托管
就改了2 小时前
Docker安装并运行Redis
redis·docker·容器
yagami_gagami3 小时前
第四届黄河流域公安院校电子物证个人赛服务器取证
linux·服务器·网络·mysql·安全·docker·llama
MicrosoftReactor4 小时前
技术速递|GitHub Copilot App 入门指南:快速上手
ai·github·copilot·copilot app
小挪号底迪滴4 小时前
Docker 多阶段构建实战:让 Python 镜像更小、更快、更安全
python·安全·docker
风曦Kisaki4 小时前
Kubernetes(K8s)笔记Day07: StatefulSet 有状态控制器详解与使用案例
linux·docker·云原生·容器·kubernetes
张文君4 小时前
docker registry 删除镜像
运维·docker·容器