Proposal: add dockerhub configuration parameters to the runners

Problem dockerhub recently implemented rate-limiting that is causing pipeline failures when pulling images from dockerhub without authentication.

It is possible to configure global credentials and mirrors, both for the runner and docker plugins, however, the approach is not well documented and could probably be improved. The goal of this proposal is to formalize these configuration options, to provide explicit configuration parameters that are intuitive and easy to use, and to ensure the configuration parameters work well with the autoscaler.


The following configuration parameters can be used to provide a dockerhub username and password for pulling pipeline step images from dockerhub. This provides is a simpler alternative to mounting a docker config.json file into the runner. Please note this will not replace mounting and reading credentials from the config.json file.

DRONE_DOCKERHUB_USERNAME
DRONE_DOCKERHUB_PASSWORD

The following configuration parameter (defaults to false) can be used to inject the above dockerhub credentials into plugin steps that build and publish docker images, such as plugins/docker. Please let me know if you have ideas for an intuitive name that is not a full sentence long :grinning_face_with_smiling_eyes: .

DRONE_DOCKERHUB_PLUGINS=false

The following configuration parameter can be used to globally inject a registry mirrors into plugins that build and publish docker images, such as plugins/docker. This is possible today by setting global environment variables, however, the below variables will provide a more explicit option since this is going to be a very common use case going forward.

DRONE_DOCKER_MIRROR

Note that the mirror parameter is only specified for plugins because they use docker-in-docker. The runner uses the host machine docker socket to pull pipeline step images, which means you need to configure registry mirrors with the host machine docker socket.

Is it possible to have the DRONE_DOCKER_MIRROR setting also work for pulling pipeline step images?