gpt4 book ai didi

docker compose 命令 down 和 up 不会创建新的图像和容器

转载 作者:行者123 更新时间:2023-12-02 19:22:17 26 4
gpt4 key购买 nike

我有 .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 图像。

最佳答案

By default, the only things removed by down are:

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 一起使用:

Options:

--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.

this

关于docker compose 命令 down 和 up 不会创建新的图像和容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58797189/

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