Rewrite command logic for Docker env

Note that this also depends on changes in the gitignored conf.py module