From 3ded448fafd82a1ab1a783fb5f01a3b5d2170858 Mon Sep 17 00:00:00 2001 From: Allie Sadler Date: Tue, 5 Jul 2022 15:08:42 +0100 Subject: [PATCH 1/2] move disk utilization info --- _data/toc.yaml | 6 +-- desktop/faqs/linuxfaqs.md | 99 +++++++++++++++++++++++++++++++++++++++ desktop/faqs/macfaqs.md | 96 +++++++++++++++++++++++++++++++++++++ 3 files changed, 197 insertions(+), 4 deletions(-) create mode 100644 desktop/faqs/linuxfaqs.md diff --git a/_data/toc.yaml b/_data/toc.yaml index 7ed3ab899b..0b244a4b8d 100644 --- a/_data/toc.yaml +++ b/_data/toc.yaml @@ -1186,8 +1186,6 @@ manuals: title: Install Docker Desktop for Mac - path: /desktop/mac/ title: User manual - - path: /desktop/mac/space/ - title: Disk utilization - path: /desktop/mac/troubleshoot/ title: Logs and troubleshooting - path: /desktop/mac/apple-silicon/ @@ -1218,8 +1216,6 @@ manuals: title: Install on Arch - path: /desktop/linux/ title: User manual - - path: /desktop/linux/space/ - title: Disk utilization - path: /desktop/linux/troubleshoot/ title: Logs and troubleshooting - path: /desktop/dashboard/ @@ -1318,6 +1314,8 @@ manuals: title: Mac FAQs - path: /desktop/faqs/windowsfaqs/ title: Windows FAQs + - path: /desktop/faqs/linuxfaqs/ + title: Linux FAQs - path: /desktop/support/ title: Get support - path: /desktop/feedback/ diff --git a/desktop/faqs/linuxfaqs.md b/desktop/faqs/linuxfaqs.md new file mode 100644 index 0000000000..c7dd9a11e4 --- /dev/null +++ b/desktop/faqs/linuxfaqs.md @@ -0,0 +1,99 @@ +--- +description: Frequently asked questions +keywords: desktop, linux, faqs +title: Frequently asked questions for Linux +redirect_from: +- desktop/linux/space +--- +Docker Desktop stores Linux containers and images in a single, large "disk image" file in the Linux filesystem. This is different from Docker on Linux, which usually stores containers and images in the `/var/lib/docker` directory on the host's filesystem. + +## Where is the disk image file? + +To locate the disk image file, select the Docker icon and then +**Settings** > **Resources** > **Advanced**. + +![Disk preferences](images/menu/prefs-advanced.png){:width="750px"} + +The **Advanced** tab displays the location of the disk image. It also displays the maximum size of the disk image and the actual space the disk image is consuming. Note that other tools might display space usage of the file in terms of the maximum file size, and not the actual file size. + +## If the file is too large + +If the disk image file is too large, you can: + +- move it to a bigger drive, +- delete unnecessary containers and images, or +- reduce the maximum allowable size of the file. + +### Move the file to a bigger drive + +To move the disk image file to a different location: + +1. Select **Settings** > **Resources** > **Advanced**. + +2. In the **Disk image location** section, click **Browse** and choose a new location for the disk image. + +3. Click **Apply & Restart** for the changes to take effect. + +Do not move the file directly in Finder as this can cause Docker Desktop to lose track of the file. + +### Delete unnecessary containers and images + +Check whether you have any unnecessary containers and images. If your client and daemon API are running version 1.25 or later (use the `docker version` command on the client to check your client and daemon API versions), you can see the detailed space usage information by running: + +```console +$ docker system df -v +``` + +Alternatively, to list images, run: + +```console +$ docker image ls +``` + +and then, to list containers, run: + +```console +$ docker container ls -a +``` + +If there are lots of redundant objects, run the command: + +```console +$ docker system prune +``` + +This command removes all stopped containers, unused networks, dangling images, and build cache. + +It might take a few minutes to reclaim space on the host depending on the format of the disk image file: + +- If the file is named `Docker.raw`: space on the host should be reclaimed within a few seconds. +- If the file is named `Docker.qcow2`: space will be freed by a background process after a few minutes. + +Space is only freed when images are deleted. Space is not freed automatically when files are deleted inside running containers. To trigger a space reclamation at any point, run the command: + +```console +$ docker run --privileged --pid=host docker/desktop-reclaim-space +``` + +Note that many tools report the maximum file size, not the actual file size. +To query the actual size of the file on the host from a terminal, run: + +```console +$ cd ~/.docker/desktop/vms/0/data +$ ls -klsh Docker.raw +2333548 -rw-r--r--@ 1 username staff 64G Dec 13 17:42 Docker.raw +``` + +In this example, the actual size of the disk is `2333548` KB, whereas the maximum size of the disk is `64` GB. + +### Reduce the maximum size of the file + +To reduce the maximum size of the disk image file: + +1. Select the Docker icon and then select **Settings** > **Resources** > **Advanced**. + +2. The **Disk image size** section contains a slider that allows you to change the maximum size of the disk image. Adjust the slider to set a lower limit. + +3. Click **Apply & Restart**. + +When you reduce the maximum size, the current disk image file is deleted, and therefore, all containers and images will be lost. \ No newline at end of file diff --git a/desktop/faqs/macfaqs.md b/desktop/faqs/macfaqs.md index afc00dcb61..848e95207c 100644 --- a/desktop/faqs/macfaqs.md +++ b/desktop/faqs/macfaqs.md @@ -2,6 +2,8 @@ description: Frequently asked questions keywords: desktop, mac, faqs title: Frequently asked questions for Mac +redirect_from: +- desktop/mac/space --- ### What is Docker.app? @@ -24,3 +26,97 @@ HyperKit is thinner than VirtualBox and VMWare fusion, and the version included The privileged helper process `com.docker.vmnetd` is started by `launchd` and runs in the background. The process does not consume any resources unless Docker.app connects to it, so it's safe to ignore. + +Docker Desktop stores Linux containers and images in a single, large "disk image" file in the Mac filesystem. This is different from Docker on Linux, which usually stores containers and images in the `/var/lib/docker` directory. + +## Where is the disk image file? + +To locate the disk image file, select the Docker icon and then +**Preferences** > **Resources** > **Advanced**. + +![Disk preferences](images/menu/prefs-advanced.png){:width="750px"} + +The **Advanced** tab displays the location of the disk image. It also displays the maximum size of the disk image and the actual space the disk image is consuming. Note that other tools might display space usage of the file in terms of the maximum file size, and not the actual file size. + +## If the file is too big + +If the disk image file is too big, you can: + +- move it to a bigger drive, +- delete unnecessary containers and images, or +- reduce the maximum allowable size of the file. + +### Move the file to a bigger drive + +To move the disk image file to a different location: + +1. Select **Preferences** > **Resources** > **Advanced**. + +2. In the **Disk image location** section, click **Browse** and choose a new location for the disk image. + +3. Click **Apply & Restart** for the changes to take effect. + +Do not move the file directly in Finder as this can cause Docker Desktop to lose track of the file. + +### Delete unnecessary containers and images + +Check whether you have any unnecessary containers and images. If your client and daemon API are running version 1.25 or later (use the `docker version` command on the client to check your client and daemon API versions), you can see the detailed space usage information by running: + +```console +$ docker system df -v +``` + +Alternatively, to list images, run: + +```console +$ docker image ls +``` + +and then, to list containers, run: + +```console +$ docker container ls -a +``` + +If there are lots of redundant objects, run the command: + +```console +$ docker system prune +``` + +This command removes all stopped containers, unused networks, dangling images, and build cache. + +It might take a few minutes to reclaim space on the host depending on the format of the disk image file: + +- If the file is named `Docker.raw`: space on the host should be reclaimed within a few seconds. +- If the file is named `Docker.qcow2`: space will be freed by a background process after a few minutes. + +Space is only freed when images are deleted. Space is not freed automatically when files are deleted inside running containers. To trigger a space reclamation at any point, run the command: + +```console +$ docker run --privileged --pid=host docker/desktop-reclaim-space +``` + +Note that many tools report the maximum file size, not the actual file size. +To query the actual size of the file on the host from a terminal, run: + +```console +$ cd ~/Library/Containers/com.docker.docker/Data/vms/0/data +$ ls -klsh Docker.raw +2333548 -rw-r--r--@ 1 username staff 64G Dec 13 17:42 Docker.raw +``` + +In this example, the actual size of the disk is `2333548` KB, whereas the maximum size of the disk is `64` GB. + +### Reduce the maximum size of the file + +To reduce the maximum size of the disk image file: + +1. Select the Docker icon and then select **Preferences** > **Resources** > **Advanced**. + +2. The **Disk image size** section contains a slider that allows you to change the maximum size of the disk image. Adjust the slider to set a lower limit. + +3. Click **Apply & Restart**. + +When you reduce the maximum size, the current disk image file is deleted, and therefore, all containers and images will be lost. + From db66a143a4a1e06326fc6c61a82d7566c6526a76 Mon Sep 17 00:00:00 2001 From: Allie Sadler Date: Tue, 5 Jul 2022 15:46:04 +0100 Subject: [PATCH 2/2] fix broken links --- desktop/faqs/linuxfaqs.md | 29 ++++++++++++++--------------- desktop/faqs/macfaqs.md | 26 ++++++++++++-------------- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/desktop/faqs/linuxfaqs.md b/desktop/faqs/linuxfaqs.md index c7dd9a11e4..ec1737745e 100644 --- a/desktop/faqs/linuxfaqs.md +++ b/desktop/faqs/linuxfaqs.md @@ -5,30 +5,29 @@ title: Frequently asked questions for Linux redirect_from: - desktop/linux/space --- + +## Where does Docker Desktop store Linux containers? Docker Desktop stores Linux containers and images in a single, large "disk image" file in the Linux filesystem. This is different from Docker on Linux, which usually stores containers and images in the `/var/lib/docker` directory on the host's filesystem. -## Where is the disk image file? +### Where is the disk image file? -To locate the disk image file, select the Docker icon and then -**Settings** > **Resources** > **Advanced**. - -![Disk preferences](images/menu/prefs-advanced.png){:width="750px"} +To locate the disk image file, select **Preferences** from the Docker Dashboard then **Advanced** from the **Resources** tab. The **Advanced** tab displays the location of the disk image. It also displays the maximum size of the disk image and the actual space the disk image is consuming. Note that other tools might display space usage of the file in terms of the maximum file size, and not the actual file size. -## If the file is too large +#### What if the file is too large? If the disk image file is too large, you can: -- move it to a bigger drive, -- delete unnecessary containers and images, or -- reduce the maximum allowable size of the file. +- Move it to a bigger drive +- Delete unnecessary containers and images +- Reduce the maximum allowable size of the file -### Move the file to a bigger drive +#### How do I move the file to a bigger drive? To move the disk image file to a different location: -1. Select **Settings** > **Resources** > **Advanced**. +1. Select **Preferences** then **Advanced** from the **Resources** tab. 2. In the **Disk image location** section, click **Browse** and choose a new location for the disk image. @@ -36,7 +35,7 @@ To move the disk image file to a different location: Do not move the file directly in Finder as this can cause Docker Desktop to lose track of the file. -### Delete unnecessary containers and images +#### How do I delete unnecessary containers and images? Check whether you have any unnecessary containers and images. If your client and daemon API are running version 1.25 or later (use the `docker version` command on the client to check your client and daemon API versions), you can see the detailed space usage information by running: @@ -86,14 +85,14 @@ $ ls -klsh Docker.raw In this example, the actual size of the disk is `2333548` KB, whereas the maximum size of the disk is `64` GB. -### Reduce the maximum size of the file +#### How do I reduce the maximum size of the file? To reduce the maximum size of the disk image file: -1. Select the Docker icon and then select **Settings** > **Resources** > **Advanced**. +1. From Docker Dashboard select **Preferences** then **Advanced** from the **Resources** tab. 2. The **Disk image size** section contains a slider that allows you to change the maximum size of the disk image. Adjust the slider to set a lower limit. 3. Click **Apply & Restart**. -When you reduce the maximum size, the current disk image file is deleted, and therefore, all containers and images will be lost. \ No newline at end of file +When you reduce the maximum size, the current disk image file is deleted, and therefore, all containers and images will be lost. diff --git a/desktop/faqs/macfaqs.md b/desktop/faqs/macfaqs.md index 848e95207c..a17fce91fc 100644 --- a/desktop/faqs/macfaqs.md +++ b/desktop/faqs/macfaqs.md @@ -27,30 +27,28 @@ The privileged helper process `com.docker.vmnetd` is started by `launchd` and runs in the background. The process does not consume any resources unless Docker.app connects to it, so it's safe to ignore. +### Where does Docker Desktop store Linux containers and images? Docker Desktop stores Linux containers and images in a single, large "disk image" file in the Mac filesystem. This is different from Docker on Linux, which usually stores containers and images in the `/var/lib/docker` directory. -## Where is the disk image file? +#### Where is the disk image file? -To locate the disk image file, select the Docker icon and then -**Preferences** > **Resources** > **Advanced**. - -![Disk preferences](images/menu/prefs-advanced.png){:width="750px"} +To locate the disk image file, select **Preferences** from the Docker Dashboard then **Advanced** from the **Resources** tab. The **Advanced** tab displays the location of the disk image. It also displays the maximum size of the disk image and the actual space the disk image is consuming. Note that other tools might display space usage of the file in terms of the maximum file size, and not the actual file size. -## If the file is too big +#### What if the file is too big? If the disk image file is too big, you can: -- move it to a bigger drive, -- delete unnecessary containers and images, or -- reduce the maximum allowable size of the file. +- Move it to a bigger drive +- Delete unnecessary containers and images +- Reduce the maximum allowable size of the file -### Move the file to a bigger drive +##### How do I move the file to a bigger drive? To move the disk image file to a different location: -1. Select **Preferences** > **Resources** > **Advanced**. +1. Select **Preferences** then **Advanced** from the **Resources** tab. 2. In the **Disk image location** section, click **Browse** and choose a new location for the disk image. @@ -58,7 +56,7 @@ To move the disk image file to a different location: Do not move the file directly in Finder as this can cause Docker Desktop to lose track of the file. -### Delete unnecessary containers and images +##### How do I delete unnecessary containers and images? Check whether you have any unnecessary containers and images. If your client and daemon API are running version 1.25 or later (use the `docker version` command on the client to check your client and daemon API versions), you can see the detailed space usage information by running: @@ -108,11 +106,11 @@ $ ls -klsh Docker.raw In this example, the actual size of the disk is `2333548` KB, whereas the maximum size of the disk is `64` GB. -### Reduce the maximum size of the file +##### How do I reduce the maximum size of the file? To reduce the maximum size of the disk image file: -1. Select the Docker icon and then select **Preferences** > **Resources** > **Advanced**. +1. Select **Preferences** then **Advanced** from the **Resources** tab. 2. The **Disk image size** section contains a slider that allows you to change the maximum size of the disk image. Adjust the slider to set a lower limit.