注意:这篇文章上次更新于725天前,文章内容可能已经过时。
This article was last updated725 days ago, the content may be outdated.
如何使用
issue 的标题是你要执行的 docker pull 命令, 内容不需要写。
几分钟后,在这个 issue 下会收到一个包含下载链接的评论。

点击这个链接即可下载镜像到本地。
执行 docker load < xxx.tar.gz 即可加载镜像。
How to Use
Click here to submit an issue to this repository.
The issue title is the docker pull command you want to run; no body content is needed.
A few minutes later, a comment containing a download link will appear under this issue.

Click the link to download the image locally.
Run docker load < xxx.tar.gz to load the image.
如何实现
issue 标题作为下载镜像的命令,Actions 获取到 issue 的标题后执行命令下载 Docker 镜像,然后上传到 Onedrive 网盘上。
上传工具使用 rclone,这样就可以避免自己写代码和 Onedrive API 交互。
直接 rclone copy 即可。
最后,使用 GitHub API 为 issue 发送一个评论,包含下载链接。
1 | name: Docker Pull |
整体实现非常简单,只需要几行代码。
再简单解释一下这里面可能会令人疑惑的两个地方:
rclone copy是如何上传到我的 Onedrive 的?
这里需要首先在本地配置好 rclone,然后将配置文件进行加密,上传到 GitHub 仓库中。
https://github.com/WANG-Guangxin/DockerPull/blob/master/config/rclone.conf
这里是我的 rclone 配置文件,里面包含了我 Onedrive 的配置信息。
RCLONE_CONFIG 环境变量用于指定 rclone 配置文件的路径。
RCLONE_CONFIG_PASS 环境变量用于指定 rclone 配置文件的密码。这个环境变量需要用 secrets 存储。
这两个环境变量在 Actions 的 yaml 中,当执行 rclone copy 时,会自动解密配置文件,然后上传。
https://e5.1881997.xyz 其实是我搭建的一个网盘列表程序,我用的是 OneManager-php
我曾经在这篇文章 中介绍过这个程序。
至于后面的路径,就是 issue 编号和镜像名,这样就可以保证每个 issue 的镜像都是唯一的。
只要保证上传和下载的路径一致,就可以了。
可能的扩展
- 只有 star 了这个仓库的人才能使用
下面是一个可能的方案,但还未经测试。
1 | - name: Check if user starred the repo |
- 删除过早的镜像
同样也是未经测试的代码。
1 |
|
最后
目前只有两个人使用过这个机器人,有一个人 fork 了这个仓库,但实际上仅仅 fork 这个仓库是无法使用的。
有兴趣的话可以参考这篇文章自己实现一个。
但实际上用我的就够了,希望使用的用户给个 star ⭐
How It Works
The issue title is used as the image-pulling command. After the Actions workflow gets the issue title, it executes the command to pull the Docker image, then uploads it to Onedrive.
The upload tool uses rclone, so we don’t need to write our own code to interact with the Onedrive API.
Just rclone copy.
Finally, use the GitHub API to post a comment on the issue with the download link.
1 | name: Docker Pull |
The overall implementation is very simple — just a few lines of code.
Let me briefly explain the two places that might be confusing:
- How does
rclone copyupload to my Onedrive?
You first configure rclone locally, then encrypt the config file and upload it to the GitHub repository.
https://github.com/WANG-Guangxin/DockerPull/blob/master/config/rclone.conf
This is my rclone config file, which contains my Onedrive configuration info.
The RCLONE_CONFIG environment variable specifies the path of the rclone config file.
The RCLONE_CONFIG_PASS environment variable specifies the password of the rclone config file. This environment variable needs to be stored in secrets.
These two environment variables are in the Actions yaml; when rclone copy runs, it automatically decrypts the config file and uploads.
https://e5.1881997.xyz is actually a network drive listing program I set up, using OneManager-php
I introduced this program in this article.
As for the path after it, it’s just the issue number and image name — this ensures each issue’s image is unique.
As long as the upload and download paths match, it works.
Possible Extensions
- Only people who starred this repo can use it
Here’s a possible approach, but not yet tested.
1 | - name: Check if user starred the repo |
- Delete old images
Also untested code.
1 |
|
Finally
So far only two people have used this bot, and one person forked the repo — but just forking the repo doesn’t make it usable.
If you’re interested, you can implement your own by referring to this article.
But honestly, just using mine is enough — if you do, please give a star ⭐


