<p>Is there any way to restart the host without loosing all changes that were made to the running container (if the changes were not made on a mounted volume) ?</p>
<p>I have <code>docker container commit</code> if I'm running pure docker but I wonder if there is a k8s-way to do it.</p>

CC BY-SA 4.0
2023-06-08T13:05:58.843Z
Checkout this post https://stackoverflow.com/questions/69111174/does-kubernetes-have-an-equivalent-to-docker-commit-save
Taimoor Mirza
CC BY-SA 4.0
2023-06-24T13:35:30.503Z
"save state of running container" - this is anti-pattern, make your images "immutable". From [docs](https://docs.docker.com/engine/reference/commandline/commit/): Generally, it is better to use Dockerfiles to manage your images in a documented and maintainable way. Good luck!
Kyslik
<docker><kubernetes>
How do you safe the state of a running container during reboot of the host?
Hoffmann
# How do you safe the state of a running container during reboot of the host?

(Asked by: username_0 on 2023-06-07)

Is there any way to restart the host without loosing all changes that were made to the running container (if the changes were not made on a mounted volume) ?

I have `docker container commit` if I'm running pure docker but I wonder if there is a k8s-way to do it.

**Tags:** docker, kubernetes

> **Comments:**
> **username_1**: Checkout this post https://stackoverflow.com/questions/69111174/does-kubernetes-have-an-equivalent-to-docker-commit-save  
> **username_2**: "save state of running container" - this is anti-pattern, make your images "immutable". From [docs](https://docs.docker.com/engine/reference/commandline/commit/): Generally, it is better to use Dockerfiles to manage your images in a documented and maintainable way. Good luck!  

---

## 0 answers

