OK, I've experimented a lot getting this going with the
docker+machine executor (specifically with the
amazonec2 driver, which I suspect is quite common for people looking at this thread!), it may also be helpful to others when debugging what's going on for them.
docker+machine is interesting because it has several relevant contexts (i.e. a file system and environment variables), which I shall refer to as:
- "runner": what is running the
gitlab-runnerbinary - in my case this is an ECS-managed docker container for the
gitlab/gitlab-runnerimage on docker hub, but it could the
systemdservice configuration if you're running directly on the machine.
- "job host": the docker-machine created machine (e.g. EC2 instance) that runs the docker daemon
- "job container": the docker container for the image specified in the project
.gitlab-ci.yaml(or the default in config.toml)