We are trying to enable a custom cloud config in order to get past the Docker Hub limits. We use this cloud config (based off of the example given in the autoscaler docs). The only real difference being that it uses AWS linux extras to setup docker and the registry mirror is set as part of the daemon.json
:
#cloud-config
package_update: false
package_upgrade: false
packages:
- docker
bootcmd:
- amazon-linux-extras enable docker
write_files:
- path: /etc/systemd/system/docker.service.d/override.conf
content: |
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd
- path: /etc/default/docker
content: |
DOCKER_OPTS=""
- path: /etc/docker/daemon.json
content: |
{
"hosts": [ "0.0.0.0:2376", "unix:///var/run/docker.sock" ],
"tls": true,
"tlsverify": true,
"tlscacert": "/etc/docker/ca.pem",
"tlscert": "/etc/docker/server-cert.pem",
"tlskey": "/etc/docker/server-key.pem",
"registry-mirrors": ["https://internal.docker.corp.net"],
}
- path: /etc/docker/ca.pem
encoding: b64
content: {{ .CACert | base64 }}
- path: /etc/docker/server-cert.pem
encoding: b64
content: {{ .TLSCert | base64 }}
- path: /etc/docker/server-key.pem
encoding: b64
content: {{ .TLSKey | base64 }}
runcmd:
- [ systemctl, daemon-reload ]
- [ systemctl, restart, docker ]
We then built our own autoscaler image based off of the Drone one:
FROM drone/autoscaler
COPY init.yml /config/
And then in our ECS task definition we set the env var to point towards the cloud config file:
- name: DRONE_AMAZON_USERDATA_FILE
value: /config/init.yml
However when the autoscaler starts it exits with this error:
drone-runner-docker: error: required key DRONE_RPC_HOST missing value, try --help
I can’t tell what the issue is here. The deployment works perfectly before we set the env var. We set the autoscaler env var DRONE_SERVER_HOST
and as soon as I comment out DRONE_AMAZON_USERDATA_FILE
the autoscaler comes up like normal.
I found this old thread about a envconfig
printing the wrong env var ([Documentation] Potential Documentation Error) but I was wondering if there was insight as to what is going on here.