Docker Links
- How to set Java heap size (Xms/Xmx) inside Docker container?
- Volker: Testen docker sonarqube
- Getting Filesystem Mountpoints from running Docker container
Usually done with
$> docker inspect uumsonar_sonarqube_1 [ { "Id": "188e05a3885873121d5110336a264d2440873d9dd2f6293bfa8d41ee42149931", "Created": "2017-08-17T15:16:01.891731621Z", "Path": "./bin/run.sh", "Args": [ ...
Resulting in a quite verbose output with a lot of stuff that distracts you from the info you’re looking for. JQ to sthe rescue JQ is like *nix
grep
but for structured JSON dataThe Mountpoint lookup can be written like this:
$> docker inspect uumsonar_sonarqube_1 | jq '.[0] | .Mounts' [ { "Type": "bind", "Source": "/home/vbe/dev/uum_sonar/sonarqube", "Destination": "/opt/sonarqube/data", "Mode": "rw", "RW": true, "Propagation": "rprivate" } ]
Best Practices
- Favour VOlumes over bind mount
Monitor docker performance with useful names
docker stats
can be used to monitor docker containers.
The downside is it shows cryptic container ids instead of names
To make the output more usefull you can enhance the command: docker stats $(docker ps --format=)
Pretty neat. Thanks to omercnet for mentioning it here