> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/on-premises/zh-tw/an-zhuang/air-gapped-offline-deployments.md).

# 隔離網路／離線部署

Overleaf Community Edition 和 Overleaf Pro 都是以可離線運作為目標設計的，這表示不一定總是能連線到 ghcr.io 登錄庫來提取所需的 `sharelatex` , `overleaf-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) 供 [Sandboxed Compiles](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://overleaf-pro.ayaka.space/on-premises/zh-tw/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.
