Search code examples
dockergoogle-container-os

COS: How do I restart a container that has a new image?


Im using the Google Container OS on Compute Engine, and Im using the web UI to start a single container.

How do I restart the container with the same env and flags when I have pushed a new image?

I can SSH into the machine and pull the new image, but when I docker restart it uses the old image.

If I just re-run the new image I am missing the env and flags.

How do I run the new image with the env and flags provided in the web console without a reboot?

Thanks


Solution

  • The Google Container OS leverages an open-source bootstrap component called Konlet. This can be read about here. If you desire to restart/reload your container, here is a recipe:

    1. Login to the Linux GCE instance using SSH
    2. Stop your docker container
    3. Delete your docker container instance
    4. Run sudo systemctl start konlet-startup

    The service (konlet-startup) will do the job of creating a new Docker container instance using the metadata (configuration) that you have defined.