From 495b6e78dafbfafef7a84ecc6b33dabac94a8c16 Mon Sep 17 00:00:00 2001 From: Paul Johnston Date: Sat, 21 Mar 2026 18:29:58 -0600 Subject: [PATCH] Update readme with extract command --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 0b955be..eb59ef7 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ USAGE: COMMANDS: inspect print info about the layers of an image ls ls prints the files of a layer + extract extract files from an image and print to stdout help, h Shows a list of commands or help for one command GLOBAL OPTIONS: @@ -89,6 +90,16 @@ Mode Size Name -rwxrwxr-x 4.6 kB docker-entrypoint.d/30-tune-worker-processes.sh ``` +Extract files from an image: + +```sh +layer extract image.tar etc/nginx/nginx.conf # print to stdout +layer extract image.tar etc/nginx/nginx.conf --output_dir /tmp # write to /tmp/etc/nginx/nginx.conf +layer extract image.tar file1 file2 file3 # multiple files +``` + +Extract uses the topmost layer containing each file, matching container runtime behavior. + --- - See also https://github.com/wagoodman/dive.