Some code deduplication
Add support of Debian-based distros' docker package

If `$use_upstream_package_source = false` we install the distro-provided
package
Merge branch 'use_distro_packages'