[docker+machine] pre_run script on the machine

My specific problem:

Currently, I don't see a way to attach a specific EBS (by id) to the created machine. I am aware, it doesn't allow to run many runners in parallel, however in some scenarios like mine, it's desired.

It's true that Docker's amazonec2 driver provides userdata parameter which may contain a script executed at instance startup. However, there is no synchronisation between the userdata script and commands coming from the gitlab-runner (aka docker-machine) provisioning (e.g. installing docker) the machine and running the docker image immadietely afterwards.

Generic solution:

I think the generic solution (not focussing only on my problem), would be to allow specification of a script in runners.machine which docker+machine executor would call on the just created machine, before the docker image is executed.

In my case, it would allow me to call docker plugin install rexray/ebs and attach the EBS through volume in runners.docker configuration.

Edited by Adrian Fiergolski