Docker basics and Images

This chapter will cover some basic commands of docker. It will also show you some examaples where you can find and install docker images to train and sharp your security skills :)

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

Check docker service:

sudo service docker status

Docker service status

Download and run Docker Image

sudo docker pull hello-world

sudo docker run hello-world

Docker Installation is working :)

List and remove Docker Images

sudo docker images

sudo docker ps -a

List docker images

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

Remove specific docker image

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

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

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

docker login

docker login from zsh

3. Docker Images for Security training

Last updated

Was this helpful?