Docker主机重新启动时会发生什么? [英] What happens when the docker host restarts?
问题描述
关闭并重新启动Docker主机时会发生什么?
What happens when the docker host is shut down and restarted?
- 正在运行的映像会重新启动吗?
- 对这些映像所做的更改是否会保留,还是会生成该映像的新实例并丢失更改?
- docker是否有任何配置选项,例如在启动时自动执行的图像列表以及运行图像的选项?哪里?如果没有,我想只能使用docker命令行来更改docker状态。该状态存储在哪里(我想在
/ var
中的某个位置)。
- will the images that were running be restarted?
- will the changes that were made to those images persist, or will a new instance of the image be spawned and changes be lost?
- does docker have any configuration option, such as the list of images to be automatically executed at startup and the options to run the images? Where? If not, I suppose only the docker command line can be used to alter docker state. Where is that state stored (I suppose somewhere in
/var
). This could be useful to backup the docker state.
推荐答案
正在运行的映像是否将重新启动?
will the images that were running be restarted?
如果通过,守护进程重新启动时,Docker将重新启动容器。 -r = True
到启动选项。在Ubuntu上,您可以通过修改 / etc / default / docker
DOCKER_OPTS =-r = true 永久完成此操作>。
Docker will restart containers when the daemon restarts if you pass -r=True
to the startup options. On Ubuntu, you can accomplish this permanently by modifying DOCKER_OPTS="-r=true"
in /etc/default/docker
.
对这些图像所做的更改是否会保留,还是会产生该图像的新实例并丢失更改?
will the changes that were made to those images persist, or will a new instance of the image be spawned and changes be lost?
容器将被停止。在容器下次启动时,对容器的任何修改仍将存在,如果如上所述提供 -r = true
,则在docker守护程序启动时将自动发生。
Containers will be stopped. Any modifications to the container will still be present when the container next starts, which will happen automatically when the docker daemon starts if -r=true
is provided as mentioned above.
主机系统上存储的docker配置在哪里?
where is the docker configuration stored on the host system?
本身没有配置文件。您可以在 / etc / default / docker
中调整upstart / init选项。
There is no configuration file per se. You can tune the upstart/init options in /etc/default/docker
.
这篇关于Docker主机重新启动时会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!