Replies: 1 comment
-
I hade the same issue. I just wrote the following script for our needs. #!/bin/sh
set -eu
if ! [ "$1" ]; then
echo "usage: $0 /path/to/overlay/.../diff/file/in/layer"
exit 1
fi
if ! [ -e "$1" ]; then
echo "The path doesn't exist on disk: $1"
exit 1
fi
prefix=$(echo "$1" | sed -E 's,^(.*/overlay/[0-9a-f]{64})/.*$,\1,')
if ! [ "$prefix" ]; then
echo "The path doesn't contain overlay pattern: $1"
fi
if command -v podman >/dev/null; then
cli=podman
elif command -v docker >/dev/null; then
cli=docker
else
echo "No container tool found, expected podman or docker"
exit 1
fi
$cli image ls --format='{{.Repository}}:{{.Tag}}' | while read -r image; do
if $cli image inspect --format '{{json .GraphDriver.Data}}' "$image" | grep -qsF "$prefix"; then
echo "$image"
fi
done It assumes all images are tagged. I don't fix that now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was grepping for some files and got hits in
.local/share/containers/storage/overlay/74bfb1e9ed2b863f77535942c6d4f5f94131a5610d1ebbb1dee93c40c99c8a5a/diff/usr/share/
which ispodman
image cache. How to determine to which image it belongs? The hash74bfb1e9ed2b
doesn't match any, and container list is empty.Beta Was this translation helpful? Give feedback.
All reactions