Docker CLI (docker)

Docker Compose CLI (docker-compose)

Docker System managen

docker system info    # docker info = alias?
docker system df

Docker Netzwerke managen

Alle Docker Netzwerke auflisten

docker network ls

Get IP for Docker Container

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id

Get IPs of all containers in your docker-compose

Im Verzeichnis der docker-compose.yml ausführen:
for s in `docker-compose ps -q`; do echo ip of `docker inspect -f "{{.Name}}" $s` is `docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $s`; done

Alle ungenutzten Docker Netzwerke entfernen

docker network prune

Find Docker container with PID

docker ps -q | xargs -I % -n 1 sh -c 'docker inspect --format '{{.Name}}' %; docker top %' | grep -B 5 "<PID>"

Docker Compose

clean up the data of a particular docker-compose stack

docker-compose down -v --rmi all --remove-orphans