Is there a way to disable docker-machine from deleting docker images when creating host instances?
My team is using Gitlab's gitlab-runner autoscaling with docker-machine for CI on AWS. We're emulating gitlab.com's functionality where each build gets a fresh EC2 instance with docker running.
To help speed up builds I've created a custom AMI where common docker images are pulled locally. Docker-machine uses this AMI to create EC2 instances. Unfortunately the docker-machine create startup deletes all local images on the AMI.
I'm not aware of a way to customize Docker Machine's provisioners directly. In short, Docker Machine has provisioners for each OS type that controls what it does to set up Docker. You can see the different provisioners in /libmachine/provision in the repo.
You might be able to get what you want if you base your custom AMI on something like CoreOS. Its provisioner just uses the Docker that's pre-installed, so I think it should leave your pre-pulled images alone.