gpt4 book ai didi

linux - 运行 “docker system prune”之后,Docker镜像不再持久/消失。如何使它们再次持久?

转载 作者:行者123 更新时间:2023-12-02 19:51:56 34 4
gpt4 key购买 nike

我实验室中的某个人运行了“docker system prune”命令,因为他需要更多空间来下载大型数据集。但是,运行它后,大约一分钟后,没有使用的新图像消失。必须有一个使用该图像的容器来使其持久化。我们想重启docker守护进程,但是由于重要的容器正在运行(例如训练深度神经网络),我们现在无法启动。如何使docker镜像再次持久化?我们不确定该同事是否执行过其他可能导致这种情况的命令。如果相关,我们将使用docker 18.09.6。

最佳答案

docker system prune的docker文档中-

Remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes.

$ docker system prune

WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all build cache

如果添加了-a选项,则-a会删除所有未使用的图像,而不仅仅是悬空的图像。因此,如果要保留这些图像,则应避免使用-a选项。看起来确实使用了“-a”来删除未使用的图像。

关于linux - 运行 “docker system prune”之后,Docker镜像不再持久/消失。如何使它们再次持久?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60115190/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com