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

相关推荐
wflynn24 分钟前
GitHub 今日推荐|rust-anything:录制真实输入输出,渐进式重写热点函数到 Rust
rust·开源·github·cli·claude-code·agent-skills
wflynn1 小时前
GitHub 日榜趋势速报 | 2026-11-17
开源·github
敢敢是只喵i15 小时前
OpenAPI 里有两个 quantity,审批规则到底在比哪个?
github
七分辣度16 小时前
GitHub/Git 常用命令及使用场景
git·github
dong_junshuai16 小时前
每天一个开源项目#160 LoopForge:把Agent交付拆成可退回的验收流程
github
Allen366818 小时前
给博客和秘书加上 HTTPS 之后的一点记录
github
laoyeye83119 小时前
手写 vLLM 分页 KV Cache(二):深入物理块分配、Block Table 与 Slot Mapping
github
AI开源软件19 小时前
Kubernetes 网络实战:打通 Pod、Service 与集群外任务调度器的双向调用
docker·nacos·kubernetes·xxl-job·calico·微服务部署·ruoyi office
Summer-Bright21 小时前
企业落地智能体,供应链签名还是空白:1862 个 MCP 服务器无认证裸奔
服务器·人工智能·github·mcp
一条Go21 小时前
Pod 终端与日志:为什么浏览器建连要先换一张 60 秒的票
后端·架构·github