Disable Container Auto Launch on Google Container Optimized OS on GCP

149 Views Asked by At

According to Creating and configuring instances and my own testing, the Google Container Optimized OS launches the specified container on instance startup.

However, I'd like to execute my own startup script which would include running the container. Is there any way to prevent this default behaviour of automatically running the container on startup?

Specifiying a custom startup script for the instance doesn't seem to prevent the default behaviour.

1

There are 1 best solutions below

0
On BEST ANSWER

You can create a COS instance and either specify a cloud-init or a startup script.

Then use gcloud compute instances create (rather than gcloud compute instances create-with-container) and --metadata-from-file or --metadata=startup-script= respectively.