{"id":947,"date":"2025-02-24T22:38:25","date_gmt":"2025-02-24T22:38:25","guid":{"rendered":"http:\/\/vickistan.com\/?p=947"},"modified":"2025-11-10T21:09:38","modified_gmt":"2025-11-10T21:09:38","slug":"useful-docker-commands","status":"publish","type":"post","link":"https:\/\/vickistan.com\/?p=947","title":{"rendered":"Useful Docker Commands"},"content":{"rendered":"\n<p><b>To see memory and CPU usage for all containers:<\/b><br \/> <code>docker stats<\/code><br \/><br \/><strong> b. To see disk usage for all containers:<\/strong><br \/><code> docker ps -s<\/code><br \/><br \/><strong> c. To see memory usage for all containers:<\/strong><br \/><code> docker stats --no-stream --format \"{{.Name}}: {{.MemUsage}}\"<\/code><br \/><br \/><strong> d. To see which container has been hit by the OOM killer:<\/strong><br \/> <code>for each in $(docker ps --format \"{{.Names}}\"); do if docker inspect --format '{{.State.OOMKilled}}' $each | grep -q 'true'; then echo \"$each is OOMKilled\"; fi; done<\/code><br \/><br \/><strong>e. To copy a new nginx.conf into the nginx container:<\/strong><br \/><strong>Backup:<\/strong><br \/><code>docker cp ollama_nginx:\/etc\/nginx\/nginx.conf .\/nginx.conf.bak<\/code><br \/><strong>Copy local file into ollama_nginx container:<\/strong><br \/><code>docker cp \/home\/vicki\/Zuar\/AI_Ollama_Server\/nginx.conf ollama_nginx:\/etc\/nginx\/nginx.conf<\/code><br \/><strong>Check nginx.conf:<\/strong><br \/><code>docker exec -it nginx nginx -t<\/code><br \/><strong>Reload nginx config:<\/strong><br \/><code>docker exec -it nginx nginx -s reload<\/code><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To see memory and CPU usage for all containers: docker stats b. To see disk usage for all containers: docker ps -s c. To see memory usage for all containers: docker stats &#8211;no-stream &#8211;format &#8220;{{.Name}}: {{.MemUsage}}&#8221; d. To see which &hellip; <a href=\"https:\/\/vickistan.com\/?p=947\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-947","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=947"}],"version-history":[{"count":4,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/947\/revisions"}],"predecessor-version":[{"id":983,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/947\/revisions\/983"}],"wp:attachment":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}