Skip to content

Instantly share code, notes, and snippets.

@lukaszlach
Last active September 2, 2020 18:47
Show Gist options
  • Save lukaszlach/cef6113068c1bfb8d9435fe5659a7285 to your computer and use it in GitHub Desktop.
Save lukaszlach/cef6113068c1bfb8d9435fe5659a7285 to your computer and use it in GitHub Desktop.

Docker Webinar

Łukasz Lach, Docker Captain | 2020

https://lach.dev/ | https://github.com/lukaszlach/

Docker Workshop | http://dockerworkshop.pl/

Challenge

Run nginx web server

docker run -d --name nginx nginx

Solution 1

Just install it

docker exec -it nginx bash
apt-get update
apt-get install -y curl
curl

Solution 2

Container PID mode

docker run --pid container:nginx busybox pstree -p

https://hidden.lach.dev/

Run a container with required tools in `pid` and `net` container modes

docker run \
  --net container:nginx \
  --pid container:nginx \
  nicolaka/netshoot curl localhost

Solution 3

Run a `cmd.cat` container in `pid` and `net` container modes

docker run \
  --net container:nginx \
  --pid container:nginx \
  cmd.cat/curl/htop/tcpdump curl localhost

Container filesystem

docker run \
  --pid container:nginx \
  cmd.cat/find/rsync ls -lach /proc/1/root/
docker run -it \
  --pid container:nginx \
  cmd.cat/vim \ 
  vim /proc/1/root/etc/nginx/nginx.conf

Run local `Commando`

https://github.com/lukaszlach/commando

git clone \
  https://github.com/lukaszlach/commando.git
cd commando
docker-compose up -d
docker run -it \
  localhost:5050/htop/strace/tcpdump

login: docker

Solution 4

Use the `cntr` tool

https://github.com/Mic92/cntr

sudo cntr attach nginx

Solution 5

Run Kali Linux Desktop

https://github.com/lukaszlach/kali-desktop

docker run -d --cap-add NET_ADMIN --net container:nginx lukaszlach/kali-desktop:xfce-top10
docker run -d -p 6080:6080 -e LISTEN=:6080 -e TALK=nginx:6080 tecnativa/tcp-proxy

http://localhost:6080/vnc_auto.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment