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

时间:2019-11-11 07:32:24

标签: docker docker-compose dockerfile

我有.net,sql数据库,kafka docker映像,并且我使用了docker compose yml文件来一起运行它们。

我注意到上下命令不会创建新的环境。

docker compose docker-compose -f dc-all-sql.yml down

然后:

docker-compose -f dc-all-sql.yml up

我仅通过使用docker桌面的“ rest factory setting”选项来拥有新鲜的环境。

我对这些命令的理解不正确吗?

基本上,我想拥有一个全新的环境,当我启动系统时,下载了新的docker映像。

1 个答案:

答案 0 :(得分:1)

  

默认情况下,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.

请参阅this