exemONE image push용 shell 추가

This commit is contained in:
ByeonJungHun
2024-04-30 11:54:56 +09:00
parent 2213f51738
commit 1e61d362a3
5 changed files with 19 additions and 4 deletions

15
exem_img.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
images=$(docker images | grep -v REPOSITORY | sed 's/maxgauge\///g')
while IFS= read -r line; do # 위에서 출력한 결과를 한줄씩 읽어옴, IFS= 를 비워둠으로 공백이나 탭 같은 문자를 무시하고 전체 줄 읽음, read -r line 을 통해서 한 줄을 읽고 -r 옵션을 통해 역슬래시 무시
image=$(echo "$line" | awk '{print $1}')
tag=$(echo "$line" | awk '{print $2}')
if [ -n "$image" ] && [ -n "$tag" ]; then
new_image="harbor.elppa.xyz/exemone/$image:$tag"
docker tag "maxgauge/$image:$tag" "$new_image"
docker push "$new_image"
fi
done <<< "$images"