A small generalization for quenv (the script).

I seem to have talked even too much about quenv (quenv - quick environment and An update to quenv), but after A cheap trick to manipulate PERL5LIB I got the idea to make the wrapper script slightly more general.

Here it is in its current form:

${DOCKER_COMMAND:-"docker"} run --rm -itv "$PWD:/mnt" -e ENV='/mnt/.ashrc' \
   "$(basename "$0"):active" "$@"

The news are that the image name is no more hardwired but deduced from the name of the executable. This is an old trick to have a polyform executable do stuff depending on its name (much like busybox does).

In this way, I can:

  • tag a Docker image with <name>:active
  • create a symbolic link to the quenv wrapper

and enjoy the image as a command line item (provided that it has the machinery to work like this, see Command-line Docker Applications - A way forward for more on this topic).