Go to the directory with the image you want to work with. Run a Docker container with that directory mounted:
docker run -it --privileged -v /dev:/dev -v (pwd):/tmp --workdir /tmp ubuntu bash
(replace (pwd)
with "$PWD"
if using bash instead of fish)
See this thread for an explanation of why --privileged
and -v /dev:/dev
are required. The need for the latter can be avoided with this alrternative workaround.
In the container, assuming that $IMAGE_FILE
is the name of your image file: