Google Cloud VM Image to docker image

后端 未结 2 1486
暖寄归人
暖寄归人 2021-01-28 15:39

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 d
相关标签:
2条回答
  • 2021-01-28 15:56

    No, this is not possible without a tool to extract your application out of the virtual machine image and recreate in a container. To the best of my knowledge, there is no general-purpose tool that exists.

    There is a big difference between a container image and a virtual machine image. Container images do not have an operating system, virtual machine images are a complete operating system and device data. The two conceptually are similar, but extremely different in how they are implemented at the software and hardware level.

    0 讨论(0)
  • 2021-01-28 15:58

    If you know all the installed things on your VM (and all the commands), do the same thing in a Dokerfile. 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, it's 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. It's more "complex" but there is tons of example on internet!

    0 讨论(0)
提交回复
热议问题