# Docker Command

1. **Stop all running containers**: This is important because you can't remove an image of a container that is still running.

   ```bash
   bashCopy codesudo docker stop $(sudo docker ps -aq)
   ```
2. **Remove all containers**: Once all containers are stopped, you can remove them.

   ```bash
   bashCopy codesudo docker rm $(sudo docker ps -aq)
   ```
3. **Remove all Docker images**: This will remove all images, including unused and dangling images.

   ```bash
   bashCopy codesudo docker rmi $(sudo docker images -q)
   ```
4. **Remove all volumes**: Volumes are used for persisting data of Docker containers. To remove them, use:

   ```bash
   bashCopy codesudo docker volume rm $(sudo docker volume ls -q)
   ```
5. **Remove all dangling volumes**: These are volumes that are no longer used by any containers.

   ```bash
   bashCopy codesudo docker volume prune
   ```
6. **(Optional) Remove all networks**: If you also want to remove all networks, you can use:

   ```bash
   bashCopy codesudo docker network prune
   ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devanshus-organization.gitbook.io/qubic-docs/new-hosting-script/docker-command.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
