> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 0. 安装 Docker Desktop

> 在 Mac 上安装 Docker Desktop，并检查引擎、资源、文件共享和 Docker socket。

Ayakaleaf Pro 运行在 Docker 上。在 Mac 上，你需要使用 Docker Desktop，它会在一个 Linux 虚拟机中运行 Docker 引擎。

**1. 安装并启动 Docker Desktop**

安装适用于你的 Mac（Apple 芯片或 Intel）的 [Docker Desktop](https://docs.docker.com/desktop/setup/install/mac-install/) 版本，打开它，并等待引擎启动完成。你也可以从终端启动它：

```bash theme={null}
open -a Docker
```

**2. 检查 Docker 引擎**

在终端中运行以下命令：

```bash theme={null}
docker context show
docker info
docker compose version
```

上下文应指向你本地的 Docker Desktop 引擎，通常为 `desktop-linux`。如果选中了其他上下文，请在继续之前切换到 Docker Desktop：

```bash theme={null}
docker context use desktop-linux
```

`docker info` 必须输出 **Server** 部分。仅运行 `docker --version` 只能说明客户端已安装。

**3. 检查资源和文件共享**

在 Docker Desktop 的 **Settings** 中，对照[开始之前](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/installation/using-docker-compose/macos#before-you-start)检查 CPU、内存和磁盘上限，并检查文件共享设置，请参阅 [Docker Desktop 设置](https://docs.docker.com/desktop/settings-and-maintenance/settings/)。

本指南将 Toolkit 放在 `/Users` 下，Docker Desktop 默认会共享该目录。如果你使用其他位置，并且 `bin/up` 因 `Mounts denied` 而失败，请将该目录添加到文件共享中。

**4. 检查用于沙盒编译的 Docker socket**

Toolkit 会将 `/var/run/docker.sock` 挂载到应用程序中，使其能够为每次编译启动一个单独的 TeX Live 容器。请在 `config/overleaf.rc` 中保留 `DOCKER_SOCKET_PATH=/var/run/docker.sock`。

macOS 上的 Docker CLI 可能会通过 `~/.docker/run/docker.sock` 进行连接。这是 Mac 上的客户端端点，并不是更改 Toolkit 挂载源的理由：编译器需要的是 Linux 容器所看到的引擎 socket。

如果 Mac 上缺少 `/var/run/docker.sock`，请在 **Settings → Advanced** 下开启 **Allow the default Docker socket to be used**，请参阅 [Docker 的权限要求](https://docs.docker.com/desktop/setup/install/mac-permission-requirements/)。

> [!CAUTION]
>
> 不要通过对 socket 运行 `chmod 777` 来绕过错误。访问 Docker socket 等同于拥有 Docker 虚拟机的 root 权限。

### 下一步

`docker info` 正常运行后，请继续阅读 [1. 下载 Toolkit](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/installation/using-docker-compose/macos/1.-download-the-toolkit.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.