Docker image for mounting Linux FS to do various tasks.
The original intention of this image is to be able to modify the contents of the Raspbian SD image to add/remove components.
docker build -t sabjorn/linuxfsmount .
docker run -it --rm -e IMG_NAME=/fs/[img name] -v [host img location]:/fs --privileged sabjorn/linuxfsmount bash
optionally, adding -e ENTER_CHROOT=1 will automatically place docker container into mounted image.
Images mount autmatically with entrypoint.sh as long as IMG_NAME is set properly.
NOTE: It would be best to make a copy of the filesystem since this container will operate directly on the filesystem. Any modificaitons in /mnt will propogate to the .img filesystem file.
After mounting the image, you can chroot into the filesystem.
chroot will work inside this container if the filesystem is of the same architecture. For disparate architectures, take a look at: multiarch/qemu-user-static which allows for QEMU architecture translation within a Docker image. The qemu-static binary must be present (or accessable) within the filesystem when chrooting into it.
In Docker for Mac, QEMU support is already present and so chrooting into the mounted filesystem should work with any architecture.