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

相关推荐
白猫不黑13 小时前
GitHub 30K Star 的 AI 渗透测试工具
web安全·网络安全·信息安全·渗透测试·github·ai渗透测试
炸膛坦客14 小时前
Git 和 GitHub:(十二)基于远程仓库的某一个分支的某一笔提交创建新分支
git·github
一点一木15 小时前
🚀 2026 年 7 月 GitHub 十大热门项目排行榜 🔥
人工智能·github
阿里嘎多学长15 小时前
2026-07-30 GitHub 热点项目精选
开发语言·程序员·github·代码托管
炸膛坦客15 小时前
Git 和 GitHub:(十三)改分支名
git·github
holidaypenguin15 小时前
前端 Docker 开发与生产部署指南
docker·容器
江湖有缘16 小时前
保姆级教程:使用Docker一键部署Hoodik轻量级安全云盘
安全·docker·容器
xia54204644618 小时前
Docker 远程 API(Remote API)未授权访问漏洞入侵过程
运维·docker·容器
X1A0RAN18 小时前
容器化部署 Jenkins 教程
运维·docker·jenkins
程序员允诺18 小时前
Ubuntu 安装 Docker CE 和 Docker Compose 最新教程(2026)
ubuntu·docker·eureka