dext

Crates.iodext
lib.rsdext
version0.1.3
sourcesrc
created_at2022-11-01 09:19:17.358801
updated_at2022-11-02 23:48:07.575236
descriptionA CLI tool to extract and unpack the layers of a docker image.
homepage
repositoryhttps://github.com/rthomas/docker_extract
max_upload_size
id702732
size74,238
Ryan Thomas (rthomas)

documentation

README

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 ...
Commit count: 13

cargo fmt