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这个网页目前是用不了的!

相关推荐
子兮曰5 小时前
OpenClaw架构揭秘:178k stars的个人AI助手如何用Gateway模式统一控制12+通讯频道
前端·javascript·github
旅之灵夫6 小时前
【GitHub项目推荐--Remotion:使用React编程化创建视频】⭐⭐⭐
github
engchina6 小时前
WSL Ubuntu で Kubernetes v1.34.2 + Docker 環境を構築する
ubuntu·docker·kubernetes
oMcLin10 小时前
2025年必备的Docker命令指南与实战示例
docker·容器·eureka
AtoposのCX33010 小时前
Docker运行hello-world镜像失败或超时
运维·docker
sun cat10 小时前
Docker详细介绍(6)
docker·容器·docker-compose
玄同76512 小时前
Git常用命令指南
大数据·git·elasticsearch·gitee·github·团队开发·远程工作
吠品13 小时前
命令行揭示SSL证书真相
https·github·ssl
、BeYourself13 小时前
解决git@github.com: Permission denied (publickey)
github
小Pawn爷14 小时前
4.镜像仓库
docker