Skip to content

增加一个特殊前缀,用于每次只拉取当前更改的镜像 #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
destinymad opened this issue Jul 9, 2024 · 6 comments
Open

Comments

@destinymad
Copy link

是否考虑增加一个特殊的前缀,拼接在镜像前面,用于判断,此次只推这个镜像,而不是每次都是全量推。
类似: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

@destinymad
Copy link
Author

因为每次全量推实在是太慢了

@qbmiller
Copy link

每次根据git log 查看变化的,再操作不行吗

@destinymad
Copy link
Author

destinymad commented Jul 18, 2024 via email

@re0phimes
Copy link

全量确实太慢了

@Aas-ee
Copy link

Aas-ee commented Aug 19, 2024

把之前推过的都用#注释起来就行了啊

@LovelyQuantum
Copy link

其实可以先拉取阿里云上存的容器的信息,进行比对,如果重复就跳过,这样是最合理的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants