We're using Google Cloud Platform with an autoscaled pool of VM behind a google's load-balancer.

When a new VM is created in the pool it starts from a template then executes a startup-script. The startup script is pulling multiple docker images and it takes some precious time.

I'd like to reduce this time. From what i saw on the internet some people prefer to boot from a snapshot but this wouldn't work in my case since the snapshot would give the same ip for all my VM.

Do you have any good practice on how to pull these docker images faster or before creating the new VM ?

1 Answer 1


To increase the start up time, you need to "bake" (install) more of what is in your start up script into the image.

Snapshotting is one method, but I would avoid manually creating instances and then taking snapshots.

A better approach is to automate the creation of these images. Hashicorp Packer is the most common tool used for doing this. You can find the GCP "builder" here

In your case for example, you could install Docker and pull the containers that you want to be running as part of the Packer build.

This build is saved in your GCP account as an image, and your autoscaling group can use this image as its base.

Once the instance comes up, the startup script just applies some basic configuration and tries to start the image which has already been cached.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.