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, 2022 in GCP by Rahul
• 3,380 points
786 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, 2022 by Korak
• 5,820 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,230 points
3,726 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
1,390 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,460 points
1,628 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,350 points
2,927 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,020 points
5,882 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,350 points
23,575 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, 2022 in GCP by Korak
• 5,820 points
4,107 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, 2022 in GCP by Korak
• 5,820 points
952 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP