From 6ff5b3d78c749c7807346834205059360fde9beb Mon Sep 17 00:00:00 2001 From: MvS Date: Sat, 2 Nov 2019 15:23:56 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Add=20docker=20best=20practices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker_best_practices.md | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docker_best_practices.md diff --git a/docker_best_practices.md b/docker_best_practices.md new file mode 100644 index 0000000..7738569 --- /dev/null +++ b/docker_best_practices.md @@ -0,0 +1,41 @@ +# Docker Best Practices + +## Installation in macOS + +``` +brew cask install docker +``` + +### Shared Folders + +Removing some of the default shared folders can decrease CPU usage (e.g. remove `/Volumes` and `/private`). + +Check storage with: + +``` +$ docker info |grep Storage +``` + +### Performance + +In case of performance problems you can run: + +``` +docker run --rm=true -it --privileged --pid=host \ + /usr/bin/top +``` + +### Cleaning Up + +See disk space: + +``` +docker system df +``` + + +Remove stopped containers, dangling images, the build cache, and unused networks: + +``` +docker system prune +```