A small Bash script to extract the complete filesystem from an OCI/Docker image layout.
Useful when you want to inspect image contents without running the container.
-
Save a Docker image to a tarball:
docker save IMAGE_NAME -o image.tar
-
Extract the image tarball:
mkdir image_contents tar -xf image.tar -C image_contents
-
Run the extractor:
./docker-image-extractor.sh /path/to/image_contents /path/to/output
π Example
docker pull alpine:latest
docker save alpine:latest -o alpine.tar
mkdir alpine_contents
tar -xf alpine.tar -C alpine_contents
./docker-image-extractor.sh alpine_contents alpine_rootfsNow you can inspect the full Alpine filesystem inside ./alpine_rootfs.