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

相关推荐
weixin_6681 小时前
GitHub 2026年AI项目热度分析报告-AI分析-分享
人工智能·github
苦逼IT运维2 小时前
从 0 到 1 理解 Kubernetes:一次“破坏式”学习实践(一)
linux·学习·docker·容器·kubernetes
萧曵 丶2 小时前
Docker 面试题
运维·docker·容器
MicrosoftReactor2 小时前
技术速递|GitHub Copilot CLI 斜杠命令速查表
github·copilot·cli
wu~9703 小时前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github
为什么不问问神奇的海螺呢丶3 小时前
n9e categraf docker 监控配置
运维·docker·容器
青树寒鸦3 小时前
wsl的docker备份mongo和迁移
运维·mongodb·docker·容器
m0_694845573 小时前
music-website 是什么?前后端分离音乐网站部署实战
linux·运维·服务器·云计算·github
独自破碎E3 小时前
已经 Push 到远程的提交,如何修改 Commit 信息?
开发语言·github
hopsky5 小时前
Docker Desktop 报 500
运维·docker·容器