exemONE image push용 shell 추가
This commit is contained in:
15
exem_img.sh
Executable file
15
exem_img.sh
Executable 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"
|
||||
Reference in New Issue
Block a user