Home Explore Blog CI



docker

1st chunk of `content/manuals/desktop/troubleshoot-and-support/faqs/macfaqs.md`
59319caefce9faf97b8f1cd23a972bd8d58e0d01da2e59730000000100000f8b
---
description: Frequently asked questions for Docker Desktop for Mac
keywords: desktop, mac, faqs
title: FAQs for Docker Desktop for Mac
linkTitle: Mac
tags: [FAQ]
aliases:
- /desktop/mac/space/
- /docker-for-mac/space/
- /desktop/faqs/macfaqs/
weight: 20
---

### What is HyperKit?

HyperKit is a hypervisor built on top of the Hypervisor.framework in macOS. It runs entirely in userspace and has no other dependencies.

Docker uses HyperKit to eliminate the need for other VM products, such as Oracle
VirtualBox or VMware Fusion.

### What is the benefit of HyperKit?

HyperKit is thinner than VirtualBox and VMware fusion, and the version included is customized for Docker workloads on Mac.

### 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?

To locate the disk image file, select **Settings** from the Docker Desktop 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.

#### 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
- Reduce the maximum allowable size of the file

##### How do I move the file to a bigger drive?

To move the disk image file to a different location:

1. Select **Settings** then  **Advanced** from the **Resources** tab.

2. In the **Disk image location** section, select **Browse** and choose a new location for the disk image.

3. Select **Apply & Restart** for the changes to take effect.

> [!IMPORTANT]
>
> Do not move the file directly in Finder as this can cause Docker Desktop to lose track of the file.

##### 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:

```console
$ docker system df -v
```

Alternatively, to list images, run:

```console
$ docker image ls
```

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 is reclaimed within a few seconds.
- `Docker.qcow2`, space is 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.

##### How do I reduce the maximum size of the file?

To reduce the maximum size of the disk image file:

1. Select **Settings** then  **Advanced** from the **Resources** tab.

Title: Docker Desktop for Mac: FAQs and Disk Image Management
Summary
This section answers frequently asked questions about Docker Desktop for Mac, focusing on HyperKit and disk image management. It explains HyperKit's role as a lightweight hypervisor, how Docker Desktop stores Linux containers and images in a disk image file, and how to locate and manage this file. It provides instructions on moving the disk image to a larger drive, deleting unnecessary containers and images to free up space, and reducing the maximum allowable size of the disk image. Additionally, it includes commands for checking space usage and reclaiming space.