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

# 如何自定义 Dockerfile

用户可以在从父级 LangGraph 镜像导入后，向 Dockerfile 添加一系列额外的行。为此，您只需修改 `langgraph.json` 文件，将要运行的命令传递给 `dockerfile_lines` 键。例如，如果我们想在图中使用 `Pillow`，则需要添加以下依赖项：

```
{
    "dependencies": ["."],
    "graphs": {
        "openai_agent": "./openai_agent.py:agent",
    },
    "env": "./.env",
    "dockerfile_lines": [
        "RUN apt-get update && apt-get install -y libjpeg-dev zlib1g-dev libpng-dev",
        "RUN pip install Pillow"
    ]
}
```

这将安装使用 Pillow 所需的系统包，如果我们处理的是 `jpeg` 或 `png` 图像格式。

***

<div className="source-links">
  <Callout icon="terminal-2">
    [将这些文档](/use-these-docs)通过 MCP 连接到 Claude、VSCode 等，以获取实时答案。
  </Callout>

  <Callout icon="edit">
    [在 GitHub 上编辑此页面](https://github.com/langchain-ai/docs/edit/main/src/langsmith/custom-docker.mdx) 或 [提交问题](https://github.com/langchain-ai/docs/issues/new/choose)。
  </Callout>
</div>
