> For the complete documentation index, see [llms.txt](https://notes.programmersecurity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.programmersecurity.com/docker-commands-pentesting/docker-for-pentesting.md).

# Docker For Pentesting

## Docker Commands

### List Docker Images

```python
docker images
```

### Remove Docker Images

For Removing Docker Images, we first Need to see that if there are some containers which are using that image, IF YES, then we need to remove those containers first

```python
docker ps -a # This list all containers
```

<figure><img src="/files/iFHkPn8KouAVmlYEMU0O" alt=""><figcaption></figcaption></figure>

now i will remove these containers then you can remove the Image of MCP File System

```
docker rm <container ID>
```

<figure><img src="/files/N5hWRPNn5KkgUyYLgxmr" alt=""><figcaption></figcaption></figure>

now we can remove the image completly.

```
docker rmi <Repository>
```

<figure><img src="/files/bFHgWvXKMBlITGPxU8fo" alt=""><figcaption></figcaption></figure>

and now the complete Image is Deleted
