docker-compose down
时间: 2023-09-10 14:13:19 浏览: 75
docker-compose
The `docker-compose down` command is used to stop and remove containers, networks, and volumes that were created by `docker-compose up`. This command will remove all the resources that were created by `docker-compose up` command in the reverse order in which they were created.
Note that this command does not remove images or other resources that were not created by `docker-compose up` command. To remove those resources, you can use the appropriate `docker` commands.
Usage:
```
docker-compose down [options]
```
Options:
- `-v, --volumes`: Remove named volumes declared in the `volumes` section of the `docker-compose.yml` file.
- `--rmi <all|local>`: Remove images. `all` removes all images used by any service. `local` removes only images that don't have a custom tag set by the `image` field in the `docker-compose.yml` file.
- `--remove-orphans`: Remove containers for services not defined in the `docker-compose.yml` file.
- `-t, --timeout <seconds>`: Specify a shutdown timeout in seconds (default: 10).
Example:
```
$ docker-compose down --volumes --remove-orphans
```
阅读全文