This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# One time script to repush docker images from DockerHub to ghcr.io | ||
username="jellyfin" | ||
# Github package registry. You need to be logged in first | ||
target_repo="ghcr.io" | ||
img_file="image_list.txt" | ||
tag_file="tag_list.txt" | ||
rm -rf $img_file | ||
|
||
wget -q https://hub.docker.com/v2/repositories/$username/ -O - | jq -r '.results[] | . | .namespace + "/" + .name' >> $img_file | ||
|
||
while read -r line; do | ||
original_image="$line" | ||
new_image="$original_image" | ||
rm -rf $tag_file | ||
wget -q https://hub.docker.com/v1/repositories/$original_image/tags -O - | jq -r '.[] | .name' >> $tag_file | ||
|
||
while read -r line2; do | ||
tag="$line2" | ||
# docker image push and delete | ||
docker pull $original_image:$tag | ||
docker tag $original_image:$tag $target_repo/$new_image:$tag | ||
docker push $target_repo/$new_image:$tag | ||
done < "$tag_file" | ||
|
||
while read -r line3; do | ||
tag="$line3" | ||
docker image rm $original_image:$tag | ||
docker image rm $target_repo/$new_image:$tag | ||
done < "$tag_file" | ||
done < "$img_file" | ||
|
||
rm -rf $img_file |