> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/zh-cn/an-zhuang/air-gapped-offline-deployments.md).

# 空气隔离/离线部署

一般来说，我们不建议在离线环境中部署 AyakaLeaf Pro，因为它的许多功能，例如 GitHub 同步和 Zotero 集成，都需要互联网连接。

但是如果你想离线工作，这意味着有时可能无法连接到 ghcr.io 注册表来拉取所需的 `sharelatex` , `ayakaleaf-pro` 以及 TeX Live 镜像。这不是问题，因为 Docker 提供了用于导出和导入镜像的工具，这将帮助你进行离线/空气隔离部署。

从高层来看，你需要在一台有互联网连接的设备上下载所需的镜像，将它们导出到便携设备（或使用 SCP/Rsync 传输），然后将它们导入到空气隔离服务器上。

为此，你需要完成以下步骤：

* 拉取所有所需的镜像（ `overleaf-pro`, `git-bridge`, `mongo`, `redis` + 任何所需的 [TeX Live 镜像](https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/sandboxed-compiles#available-tex-live-images) 用于 [沙箱化编译](https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/sandboxed-compiles)）在一台有互联网连接的机器上
  * `docker pull ghcr.io/ayaka-notes/overleaf-pro:6.1.2`
  * `docker pull quay.io/sharelatex/git-bridge:6.1.2` （标签必须与 `overleaf-pro`)
  * `docker pull mongo:6` （请改成真实版本）
  * `docker pull redis:6.2` （请改成真实版本）
  * `docker pull ghcr.io/ayaka-notes/texlive-full:2024.1` （请改成真实版本）
* 对于 **每个** 已拉取的镜像，你接下来需要将它们导出为 .tar 文件。例如， `docker save ghcr.io/ayaka-notes/overleaf-pro:6.1.2 > overleaf-pro:6.1.2.tar`
* 使用你偏好的方法，将 `.tar` 文件从联网机器传输到离线/空气隔离服务器
* 对于每个 .tar 文件，使用 `docker load` 命令从 .tar 文件加载镜像。例如， `docker load < overleaf-pro:6.1.2.tar`
* 最后，运行 `docker images` 命令来查看/确认镜像已成功加载且可用

{% hint style="danger" %}
默认情况下，当你运行 `bin/up` 命令时，Toolkit 会尝试自动拉取通过 `ALL_TEX_LIVE_DOCKER_IMAGES` 在 `config/variables.env`中设置的每个 TeX Live 镜像。由于你的部署是空气隔离的，这将失败——你可以通过使用 `SIBLING_CONTAINERS_PULL=false` 在 `config/overleaf.rc`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/zh-cn/an-zhuang/air-gapped-offline-deployments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
