Skip to content

推送 docker 镜像到 github

获取 PAT

image.png

image.png

image.png

image.png

image.png

这样就拿到 PAT 了,后续会用到。

使用 PAT 登录

注意替换命令中<PAT><github-username>部分的内容!!!

bash
echo <PAT> | docker login ghcr.io -u <github-username> --password-stdin

要推送到 github 的 docker 镜像命名规则:

bash
ghcr.io/<github-username>/<image-name>:<tag>

如:ghcr.io/xclhove/github-proxy:latest

推送镜像

bash
echo <PAT> | docker push ghcr.io/<github-username>/<image-name>:<tag>

最近更新:10/11/2024, 5:00:36 AM

原文链接:推送 docker 镜像到 github

|下一篇:springboot值为null的属性不返回