Reuse containers with `docker-compose`

谁说胖子不能爱 提交于 2019-12-01 17:01:13
dnephin

Compose will always reuse containers as long as their config hasn't changed.

If you have any state in a container, you need to put that state into a volume. Containers should be ephemeral, you should be able to destroy them and recreate them at any time without losing anything.

If you need to initialize something I would do it in the Dockerfile, so that it's preserved in the image.

FYI: The -g flag is deprecated since v17.05.0 and replaced by --data-root flag...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!