A useful container debug utility built with rust. It enables user to quickly build rootfs from docker image and install any familiar tools like htop
& use it in container namespace.
- Use any rootfs: Choose your favourite debug distro, default to debian. By default it'll persist any modification made to the rootfs and let you reuse the same rootfs across multiple session/containers.
- Debug in container namespace: After execution you'll enter all container namespace except
mount
which is located at/mnt/container
to avoid polluting rootfs path
Download binary
$ wget https://github.com/LeeTeng2001/rust-docker-overlay/releases/download/v1.0/rust-ns-overlay-linux-x86_64-gnu.tar.gz
$ tar xvf rust-ns-overlay-linux-x86_64-gnu.tar.gz
$ ./rust-ns-overlay --version
Run a test container & enter target container with a cloned copy of viewed namespace
$ docker run --rm --name test-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
$ sudo ./rust-ns-overlay <container_id>
$ sudo ./rust-ns-overlay <container_id> --image ubuntu:latest