Skip to content

Latest commit

 

History

History
68 lines (61 loc) · 2.32 KB

README.md

File metadata and controls

68 lines (61 loc) · 2.32 KB

docker

General docker informations and commands

Tonton Jo

Join the community:

Youtube Discord Tonton Jo

Support my work, give a thanks and help the youtube channel:

Ko-Fi Infomaniak Express VPN

Usefull Links:

Docker Hub
Linuxserver
Get docker

Related video tutorials

Watchtower - update containers automatically
Portainer - A docker web GUI
All my docker tutorials

Install docker script (run as root or sudo):

wget -qO- https://get.docker.com/ | sh

Usefull commands:

Get docker general infos (docker root)

docker info

Get infos about all containers

docker stats --all

Get into a container

docker exec -it $containername bash

Execute ping from a container directly

docker exec $containername ping 8.8.8.8

Start a stopped container

docker start $containername

Stop a started container

docker stop $containername

Remove a stopped container

docker rm $containername

Update a container

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once $containername

Statistics:

Total RAM USED:

source: https://stackoverflow.com/questions/47818470/compute-the-total-memory-used-by-docker-containers-in-bash

docker stats --no-stream --format 'table {{.MemUsage}}' | sed 's/\.\([0-9]*\)GiB/\1MiB/g' | sed 's/[A-Za-z]*//g' | awk '{sum += $1} END {print sum "MB"}'