Google Cloud VM Image to docker image

0 votes

I have a Google Cloud VM that installed with my application. The installation step is completed and I:

  1. Turned off the VM instance.
  2. Exported the disk to disk image called MY_CUSTOM_IMAGE_1

My wish now is to use MY_CUSTOM_IMAGE_1 as the starting image of my docker image build. For building the images I'm using Google Cloud Build.

My docker file should look like this:

Mar 19 in GCP by Rahul
• 2,740 points
32 views

1 answer to this question.

0 votes
If you know all the installed things on your VM (and all the commands)  do the same thing in a Docker file. Use as base image. the same OS version as your current VM. Perform some tests and it should be quickly equivalent.

If you have statefull files in your VM application, its a little bit more complex. You have to mount a disk in your container and to update your application's configuration to write in the correct mounted folder. You will find examples on the internet.
answered Mar 20 by Korak
• 4,460 points

Related Questions In GCP

0 votes
1 answer

Create a custom image of windows VM on Google Cloud.

Before you create the image, run GCESysprep ...READ MORE

answered Sep 24, 2019 in GCP by Sirajul
• 59,170 points
2,236 views
0 votes
1 answer
0 votes
1 answer

How to access vm instance of Google cloud from laptop's browser?

Hey @Amitabh, you could make use of ...READ MORE

answered Jul 17, 2020 in GCP by Kim
484 views
0 votes
1 answer

How to pull docker image to GCP Cloud?

Hi@akhtar, You can use gcloud docker command to ...READ MORE

answered Nov 10, 2020 in GCP by MD
• 95,340 points
398 views
0 votes
1 answer

How to delete a project from Google Cloud Console

First of all, select the project you ...READ MORE

answered Apr 18, 2018 in GCP by kurt_cobain
• 9,390 points
1,811 views
0 votes
2 answers

How to transfer google cloud project ownership?

Go to IAM and Admin Then Select IAM Click Add Provide another user's ...READ MORE

answered Aug 20, 2018 in GCP by Priyaj
• 58,060 points
4,289 views
+2 votes
2 answers

How to download multiple files in Google Cloud Storage?

You can achieve this through the gsutil ...READ MORE

answered May 9, 2018 in GCP by kurt_cobain
• 9,390 points
18,861 views
0 votes
1 answer

Google cloud: How to list all service-accounts from all Projects in GCP

Your code sample suggests you want the ...READ MORE

answered Mar 14 in GCP by Korak
• 4,460 points
226 views
0 votes
1 answer

Google Cloud VPN - Egress from GCP to on-premise pricing clarification

IPSec traffic are charged as if the ...READ MORE

answered Mar 20 in GCP by Korak
• 4,460 points
37 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP