#layer #docker-image #extract #folder #cli-tool #overlay #local

app dext

A CLI tool to extract and unpack the layers of a docker image

3 releases

0.1.3 Nov 2, 2022
0.1.1 Nov 1, 2022
0.1.0 Nov 1, 2022

#36 in #overlay

GPL-3.0 license

25KB
183 lines

dext

A CLI tool to extract the layers of a local docker image and overlay the contents of them into a specified folder.

Extracts a docker image's layers to a specified location.

USAGE:
    dext [FLAGS] [OPTIONS] <image-name> <out-path>

FLAGS:
    -h, --help          Prints help information
    -e, --entrypoint    Write entrypoint?

OPTIONS:
    -f, --entry-file <entrypoint>    Entrypoint file name, relative to out_path [default: entrypoint.sh]
    -v, --version <image-version>    Docker image version [default: latest]

ARGS:
    <image-name>    Docker image name
    <out-path>      Output folder

Installation

$ cargo install dext

Usage

To write out the contents of the rust image:

$ docker pull rust

...

$ mkdir rust_image
$ dext rust rust_image

To write the contents of an image (image), including a script to invoke it:

$ mkdir my_image
$ dext -e image my_image

This will create the file my_image/entrypoint.sh that when invoked with my_image as root (e.g. in a VM or chroot environment) will invoke the image entrypoint.

Logging

Debug logging can be enabled with the RUST_LOG environment variable.

$ RUST_LOG=dext=debug dext ...

Dependencies

~16–30MB
~477K SLoC