Mercurial in docker
Sometimes you are in an environment where mercurial isn't installed, or has a
out-of-date version (i.e. CentOS). This image brings mercurial to your local
repository, lets you commit changes and runs a hg server on port 8000 so that
the repository can be cloned or pulled from.
The intended use is to map a directory on the host machine onto /repo inside the
container, and let the user work from the command line to add files to source
Inside the container, the user is root, so creating files while inside the
container may have unintended consequences. And perhaps root doesn't
have write permission inside that directory, so you'd want to set a
different userid in the docker run command, something like
-u $(id -u)
You may wish to define an alias to make it easy to run this mercurial container
on your current directory, as
alias runhg='docker run -i -t --rm -p 8000:8000 -e HGUSER=$(whoami) -v $(pwd):/repo hg'