Can I create an instance template for a Container based OS Image?

0 votes
I want to create an instance template such that when I use it, I should be able to launch a container when the OS starts. How do I configure this?
Sep 24 in GCP by Sam
• 2,100 points
20 views

1 answer to this question.

0 votes

You can specify a container image in an instance template. 

By default, Compute Engine also includes in the template a Container Optimised OS image with Docker installed. 

When you use the template to create a new instance, the container is launched automatically as the instance starts up.

  1. Go to the Instance Templates page.

  2. Click Create instance template.

  3. In the Container section, select the Deploy a container image to this VM instance checkbox.

  4. Specify the Container image to use.

    • For example, you can specify gcr.io/cloud-marketplace/google/nginx1:1.12 to select an NGINX 1.12 container image from Cloud Launcher.

    • If you use a container image from Docker Hub, always specify the full Docker image name. For example, specify the following image name to deploy an Apache container image: docker.io/httpd:2.4.

  5. Optionally, click Advanced container options

  6. Click Create.

answered Sep 24 by Sirajul
• 29,340 points

Related Questions In GCP

0 votes
1 answer

How do I create a preemptible virtual machine (VM) instance?

With gcloud compute, use the same instances create command that ...READ MORE

answered Sep 23 in GCP by Sirajul
• 29,340 points
16 views
0 votes
1 answer
0 votes
1 answer

Creating a SQL Server instance using Google Compute engine.

Google Compute Engine provides public images preconfigured with ...READ MORE

answered Sep 23 in GCP by Sirajul
• 29,340 points
18 views
0 votes
1 answer

How do i install gcloud compute?

The gcloud compute command-line tool enables you to easily ...READ MORE

answered Sep 23 in GCP by Sirajul
• 29,340 points
16 views
0 votes
1 answer
0 votes
1 answer

Can I create a load balancer with path based routing in GKE?

Yes, it's possible. Note that you simply will use the internal Load balancing (ILB) for ...READ MORE

answered 3 days ago in GCP by Sirajul
• 29,340 points
11 views