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
#!/bin/bash | |
set -e | |
# Simple script to remove dangling images from GHCR. | |
# You need to have installed gh cli and jq for this script to work properly | |
# You need to be logged to 'gh' first | |
container="debian/buildd" | |
temp_file="ghcr_prune.ids" | |
rm -rf $temp_file |
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
#!/bin/bash | |
set -e | |
# Simple script that pushes missing/outdated tags from an image in DockerHub to GHCR, skipping up-to-date tags. | |
# You need to be logged in using 'docker login' first: https://docs.github.com/es/packages/working-with-a-github-packages-registry/working-with-the-container-registry | |
# You also need jq and wget installed in your system for this script to work | |
target_repo="ghcr.io" | |
tag_file="tag_list.txt" | |
# Replace this with the name of your image |
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
#!/bin/bash | |
# Simple script to repush docker images from one repository to another | |
username="ferferga" | |
# 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 |