modularize the docker envvar parsing