Drone

DRONE_DOCKER_CONFIG with Autoscaler and custom cloud-init

I’m attempting to combine https://autoscale.drone.io/configure/cloud-init/ with “option 2” from How to pull private images with 1.0. I have cloud-init and the autoscaler working to inject a .docker/config.json file into agent containers, but it doesn’t look like the autoscaler currently has a method of setting the necessary DRONE_DOCKER_CONFIG env var on the agents it starts.

Am I overlooking something?

you can pass additional environment variables to the agent using one of the following autoscaler configuration variables:

https://autoscale.drone.io/reference/drone-agent-environ/
https://autoscale.drone.io/reference/drone-agent-env-file/

for example:

DRONE_AGENT_ENVIRON=DRONE_DOCKER_CONFIG=/path/to/.docker/config.json

also remember the docker config file exists on the host machine, and is not available to the autoscaler unless mounted as a volume.