> For the complete documentation index, see [llms.txt](https://cas-cyber.gitbook.io/cas-cybersecurity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cas-cyber.gitbook.io/cas-cybersecurity/docker-basics.md).

# Docker basics and Images

### 1. Docker Images

Check out: <https://hub.docker.com/>

### 2. Useful Docker commands

#### Docker Repository file:

> cat /etc/apt/sources.list.d/docker.list

![Docker Repository file](/files/-MhO6PtV8H0cgCYCXaEj)

#### Check docker service:

> sudo service docker status

![Docker service status](/files/-MhOAuBYdvRwJMX2r4Sd)

#### Download and run Docker Image

> sudo docker pull hello-world
>
> sudo docker run hello-world

![Docker Installation is working :)](/files/-MhOC6id5Q-jeU62NIeH)

#### List and remove Docker Images

> sudo docker images
>
> sudo docker ps -a

![List docker images](/files/-MhODZm5FXjbWIwTT1aH)

> sudo docker rmi -f opensecurity/mobile-security-framework-mobsf

![Remove specific docker image](/files/-MhOF2RK65HInmPtVuZu)

#### Interact with docker image

> sudo docker pull ubuntu
>
> sudo docker run --name customUbuntu -itd ubuntu /bin/bash
>
> sudo docker exec -it custumUbuntu /bin/bash

![bash inside docker container](/files/-MhOJ-IUzoW0bkc2wRGa)

Docker service manage  ip adresses:

First container get's the ip address 172.17.0.2

#### Portforwarding to docker container

> sudo docker create --name customUbuntu2 -p 8090:80 -p 88:443 -it ubuntu /bin/bash
>
> docker start customUbuntu2
>
> docker ps

![](/files/-MhOL9wSKyfU7KSbPsog)

If you have want to pull multiple docker images, it's usefull to register a free account on [https://hub.docker.com ](https://hub.docker.com)

> docker login

![docker login from zsh](/files/-MhOQQeo3lPBHzttgN9v)

### 3. Docker Images for Security training

* [Dawn Vulnerable Webapp](/cas-cybersecurity/docker-basics/damn-vulnerable-webapp.md)
* [bWAPP](/cas-cybersecurity/docker-basics/bwapp.md)
* [Juice Webshop](/cas-cybersecurity/docker-basics/juice-webshop.md)
* [Webgoat](/cas-cybersecurity/docker-basics/webgoat.md)
* [Metasploitable 2](/cas-cybersecurity/docker-basics/metasploitable-2.md)
* [Metasploitable 3](/cas-cybersecurity/docker-basics/metasploitable-3.md)
* [MISP Docker (old)](/cas-cybersecurity/docker-basics/misp-docker-old.md)
* [MISP Docker (new)](/cas-cybersecurity/docker-basics/misp-docker-new.md)


---

# 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://cas-cyber.gitbook.io/cas-cybersecurity/docker-basics.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.
