Skip to content

Commit

Permalink
tag image to latest and load from tar
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Dec 11, 2023
1 parent 758c0ca commit 432d2e3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/load_containers_cache
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ then
fi

# build container cache directory
cache=/var/lib/cache/containers/$ct_name
cache=/var/lib/cache/containers/${ct_name}.tar

if [ -d "$cache" ]
if [ -f "$cache" ]
then
echo "loading $cache"

# Podman loads directory as cache and put it in localhost/... repository
podman load -i "$cache"
podman load < "$cache"

echo "Image : $image"

Expand All @@ -36,6 +36,10 @@ then
# tag it SHA with the full qualified image name to be used in the container
podman image tag "$sha" "$image"

# tag image to :latest
image_name=$(echo "$image" | cut -d ':' -f 1)
podman image tag "$sha" "$image_name":latest

# Remove the cache
rm -rf "$cache"
fi

0 comments on commit 432d2e3

Please sign in to comment.