tech-shrimp / docker_image_pusher Goto Github PK
View Code? Open in Web Editor NEW使用Github Action将国外的Docker镜像转存到阿里云私有仓库,供国内服务器使用,免费易用
License: Apache License 2.0
使用Github Action将国外的Docker镜像转存到阿里云私有仓库,供国内服务器使用,免费易用
License: Apache License 2.0
想添加一个每天或者每周0点定时执行,怎么添加代码
Docker 官方有登录插件: https://github.com/marketplace/actions/docker-login
具体使用方法已经提交 PR 了,见 #12
dockerhub好像对匿名(就是没登录)的用户有一定的拉取限制(比如拉取速度),还要不要加一个对dockerhub的登陆,
如题,拉取多个镜像时,当某个镜像输入有误、或者Tag不对时,任务即报错、终止
可否更改为只终止拉取当前出错的镜像、继续拉取剩余的镜像?
是否考虑增加一个特殊的前缀,拼接在镜像前面,用于判断,此次只推这个镜像,而不是每次都是全量推。
类似:curnew/$namespec/$image
name_space=$(echo "$image" | awk -F'/' '{if (NF>1) print $1}'| awk '{print $1}')
echo "name_space: $name_space"
# 如果镜像名称以curnew开头,则命名空间取第二个字符
if [[ "${image}" == curnew/* ]]; then
name_space=$(echo "$image" | awk -F'/' '{if (NF>1) print $2}')
fi
if [[ "${line}" == curenew/* ]]; then
# 去掉镜像名称前的curenew/
image=${line#*curenew/}
echo "image $image"
line=${line#*curenew/}
echo "最终镜像为 image $line"
else
continue
fi
docker pull $line
如果要同时拉取不同版本的镜像,如何避免镜像仓库被后者覆盖的情况。
信息如下:
Run docker/login-action@v3
with:
registry: ***
username: ***
password: ***
ecr: auto
logout: true
env:
ALIYUN_REGISTRY: ***
ALIYUN_NAME_SPACE: ***
Logging into ***...
Error: Error response from daemon: Get "https://***/v[2](https://github.com/eyea/docker_image_pusher/actions/runs/9495396972/job/26167547809#step:3:2)/": unauthorized: authentication required
本地登录成功
➜ ~ sudo docker login [email protected] registry.cn-somewhere.aliyuncs.com
Password:
Login Succeeded
daprio/dashboard
#linode/dashboard:v2.7.0
例如,我要是只写 第一个 那么在阿里云上面就只会显示 dashboard
我要是两个都写上 才会区分仓库 如
daprio_dashboard
linode_dashboard
希望 只有一个的时候也显示前缀
例如以下两条Docker镜像上传到阿里云后 只剩下一个,有什么方法能避免吗
joplin/server:latest
vaultwarden/server:latest
大佬,alist-tvbox怎么拉取啊?不会操作,求大佬指点
在echo中使用$image变量,虽然并没有什么大的问题,不会报错,但是并没有在其他地方显示的看到这个变量的定义呀
Run docker login -u $ALIYUN_REGISTRY_USER -p $ALIYUN_REGISTRY_PASSWORD $ALIYUN_REGISTRY
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get "https://***/v2/": unauthorized: authentication required
Error: Process completed with exit code 1.
真心感谢你项目分享呢!
我不完全确认以下的问题:
拉取镜像-xhofe/alist:latest后,再拉取xiaoyaliu/alist:latest,阿里云的仓库中就只有xiaoyaliu/alist的alist了;
是不是由于阿里云的仓库只有容器名导致的,就把xhofe/alist的镜像给替代了。
就是即使镜像不重名,也用命名空间作为前缀加在镜像名称前,这样好像更符合使用习惯。
【阿里云】容器镜像服务ACR加速器功能变更通知
您好,为进一步规范镜像加速器工具的使用,容器镜像服务ACR计划于2024年07月02日对镜像加速器功能进行相应的调整。
具体变更内容如下:
1、调整镜像加速器功能的受众范围,仅限阿里云用户在具备公网访问能力的相关阿里云云产品资源上使用该能力。
2、仅支持通过镜像加速器拉取一定限定范围内的容器镜像。
*请及时关注本次产品变更内容,以免影响您的后续使用。如您有任何问题,可随时通过工单或者服务热线与我们联系。
发现总是最后一个镜像不能正常推送,建议修改一下循环读取的条件为:
while IFS= read -r line || [ -n "$line" ]; do
确保最后一行能正确读取
例如镜像名称
daprio/dashboard:0.14.0
推送到阿里云 显示的是 dashboard,这样不好,我想自定义一下 可否做到?
例如
docker.io/daprio/dashboard:0.14.0 --name daprio-dashboard:0.14
发现latest存在多个架构的镜像时只能拉取到x64的,其他arm架构镜像拉取不到,push后阿里云只存在单一的x64镜像,而不是能拥有多个架构镜像的latest清单,这个有办法改变吗
拉取多架构时把linux_amd64_redis 和 linux_arm_v7_redis 这种加在前排的 变成 redis:latest_amd64 和 redis:latest_arm64 redis:latest_armv7 能不能变成这种形式 前面不变 前面改变的话会多出口来很多镜像 不能放在一起了
定时执行时每次都会强制拉取更新
能否检测阿里云的镜像和源镜像是否一致,不同才更新呢?
Pull
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: docker/setup-buildx-action@79abd3f, actions/checkout@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
-u 改成 --username
docker login --username $ALIYUN_REGISTRY_USER --password $ALIYUN_REGISTRY_PASSWORD $ALIYUN_REGISTRY
阿里云我的仓库是空的,拉取的镜像大小12G左右,一直报这个错
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.