Search code examples
dockergcloud

It seems my gCloud VM instance erased my running docker image/container


everyone. Yesterday i set a completely functional odoo image inside a gCloud VM instance. I pulled a custom image i did to this matter and had in docker hub. Once i download it i deployed it and got my odoo container up and running just fine. However, i'm just entering right now to realize that suddenly docker image i pulled and container i created are not there anymore, just gone. It seems gCloud somehow erased it; this doesn't make any sense, that's basically why i'm asking!

P.S: I'm far from being a gCloud expert, still getting used to this tech.

Any ideas? Thank you in advance.


Solution

  • I assume:

    • you configured the container manually
    • you're using a preemptible instance

    If both of those are true, when the instance was reset after 24 hours (rebooted), your manual changes weren't reapplied.

    Reviewing this doc is probably a good next step for you.

    If you configure the instance to start your container, if the instance is restarted (as long as the container image continues to be available to be pulled), the instance will also restart your container.

    For convenience, you can do both (use preemptible and run containers) when you create instances using the console. Check "Deploy a container image to this VM instance" and and, under "Management", set "Preemptibility" to "on".

    https://console.cloud.google.com/compute/instancesAdd

    You may also use gcloud compute instances create-with-container.