docker - docker compose 命令 down 和 up 不会创建新的图像和容器
问题描述
我有 .net、sql 数据库、kafka docker 图像,我使用 docker compose yml 文件将它们一起运行。
我注意到命令 down 和 up 不会创造新的环境。
docker compose docker-compose -f dc-all-sql.yml down
然后:
docker-compose -f dc-all-sql.yml up
我只使用 docker desktop 'rest factory setting' 选项设法拥有新鲜的环境。
我对这些命令的理解是错误的吗?
基本上我想要一个新鲜的环境,当我启动系统时,下载了新的 docker 图像。
解决方案
默认情况下,唯一删除的内容
down
是:Containers for services defined in the Compose file Networks defined in the networks section of the Compose file The default network, if one is used
所以图像不会被删除,你可以使用它down
:
选项:
--rmi type Remove images. Type must be one of: 'all': Remove all images used by any service. 'local': Remove only images that don't have a custom tag set by the `image` field.
看到这个
推荐阅读
- string - 搜索字符串并删除其他所有内容并使用 Powershell 粘贴到新文件
- flutter - 设置 Getter 值,但仍然调用 Null Flutter
- rust - 使用自旋锁和lazy_static!在静态结构上
- python - 如何从不重复的列表中获取随机数?
- github - 检查套件完成后如何触发 Github Workflow?
- azure - ARM 模板更新覆盖 Azure 函数中的某些内容导致错误“函数运行时无法启动”
- c++ - 使用相同的着色器但没有相同的纹理或颜色绘制多个 VAO 的最佳方法是什么
- django - 如何在 ModelBackEnd 中检查 Django 中的非活动用户
- php - 如何将此json转换为数组。我想将我的视图的数据 [x] 显示为表格
- clang-format - 如何使用 clang-format 在 Kdevelop 中设置代码格式?