TL;DR

Sometimes I need a quick pristine environment to use some tool I don’t want to install on some files in a directory. Here’s how quenv comes to help.

Remember the suggestion to Try with Docker? I do follow that! Especially when there is a tool I don’t want around permanently, but in that precise moment would be sooo useful…

So it struck me to create quenv:

so it basically allows us to do this:

docker run --rm -it -v "$PWD:/mnt" registry.gitlab.com/polettix/quenv "$@"

Let’s see it in action:

The working directory inside the container is /mnt, which is also the home of the internal user, whose id and group-id are set at the beginning to reflect those of the caller in the host. This makes it easy to bind-mount the current working directory over it (-v "$PWD:/mnt") and forget about permissions and ownership when exiting the container.

Have fun!