-
Couldn't load subscription status.
- Fork 13
Restoring snapshots
Ettore Di Giacinto edited this page Oct 11, 2022
·
1 revision
Here are listed some notes on repositories maintenance.
- Identify the snapshot image, e.g.
20211214180315-repository.yamlin a image repository, e.g. https://quay.io/repository/kairos/packages?tab=tags. - Run the script below, note it depends on
luetinstalled locally, and docker daemon working as well. For instance, to create an image repository from a snapshot run:./script.sh $IMAGE $TAGwhere $IMAGE is the repository image ( example,quay.io/kairos/packages) and$TAGthe corresponding snapshot tag (example,20211214180315-repository.yaml)
#!/bin/bash
REPO=$1
TAG=$2
if [ -z "$REPO" ]; then
echo "Missing repo. Usage $0 <repo> <snapshot_tag>"
exit 1
fi
if [ -z "$TAG" ]; then
echo "Missing snapshot tag. Usage $0 <repo> <snapshot_tag>"
exit 1
fi
rm -rf repopack src.tar
luet util unpack $REPO:$TAG repopack
mkdir newindex
mv repopack/*.yaml newindex/repository.yaml
tar -cvf src.tar -C newindex/ .
luet util pack $REPO:repository.yaml src.tar output.tar
docker load -i output.tar
echo "Now you can push $REPO:repository.yaml"