This ports all the work of !520 (merged) to the Dockerfiles, so that this can be applied to all versions.