# 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="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FO9lRwKvJpDbN6yBw3BKc%2Fimage.png?alt=media&#x26;token=e9fd07ef-2217-4012-8948-6cc2525f8d38" 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="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2F0Uu6QkihGBucR4FYQzqj%2Fimage.png?alt=media&#x26;token=6350f902-8000-43a6-a6c5-e05145c2b4dc" alt=""><figcaption></figcaption></figure>

now we can remove the image completly.

```
docker rmi <Repository>
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FVaP7FauXOfzMjYZDuT9g%2Fimage.png?alt=media&#x26;token=61d2d608-9ba6-42c1-9d84-c6b4954bca22" alt=""><figcaption></figcaption></figure>

and now the complete Image is Deleted
