> For the complete documentation index, see [llms.txt](https://knowledge.tracelog.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.tracelog.in/container/docker/add-or-copy-in-dockerfile/clean-data-of-docker-completely.md).

# Clean data of docker completely

### Goal

Getting low on space, `/var/lib/docker/aufs` takes a lot of space. Need to remove all of them

```
root@CI:/var/lib/docker/aufs# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            992M     0  992M   0% /dev
tmpfs           200M  3.2M  197M   2% /run
/dev/xvda1       20G   19G  708M  97% /
tmpfs          1000M     0 1000M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs          1000M     0 1000M   0% /sys/fs/cgroup
tmpfs           200M     0  200M   0% /run/user/112
tmpfs           200M     0  200M   0% /run/user/1000

root@CI:/var/lib/docker# du -shc *
16G    aufs
4.0K    containers
332K    image
60K    network
20K    plugins
4.0K    swarm
4.0K    tmp
4.0K    trust
60K    volumes
16G    total
```

### Solution

```
docker rm $(docker ps -a -q)
docker rmi --force $(docker images -q)
docker system prune --force
systemctl stop docker
rm -rf /var/lib/docker/aufs
apt-get autoclean
apt-get autoremove
systemctl start docker
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://knowledge.tracelog.in/container/docker/add-or-copy-in-dockerfile/clean-data-of-docker-completely.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
