> For the complete documentation index, see [llms.txt](https://docs-epc.gitbook.io/ncs-documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-epc.gitbook.io/ncs-documents/compute/compute-instance/setup-docker-image-caching.md).

# Setup Docker Image Caching

## Prerequisite

* ต้องมี instance อยู่ใน project หากไม่มี ศึกษาได้จาก [ขั้นตอนการ launch instance](/ncs-documents/compute/compute-instance/launch-compute-instance.md)

{% hint style="info" %}
ถ้า launch instance ด้วย **distribution image** ที่ทาง NIPA Cloud Space เตรียมไว้ให้ Docker Image Caching จะถูก enable ไว้แล้ว ไม่จำเป็นต้อง setting เพิ่ม

![](/files/R22cmF31vcp240KfQkab)
{% endhint %}

## Instructions

สำหรับ image ที่ไม่ใช่ distribution image จะต้อง config registry mirror ไปที่ [https://registry-cache.nipa.cloud ](<https://registry-cache.nipa.cloud >)

### 1. แก้ไข file docker config

Access เข้าแก้ไข file /etc/docker/daemon.json โดยใช้ command&#x20;

```
$nano /etc/docker/daemon.json
```

และเพิ่มค่าดังนี้ลงไปใน file&#x20;

```
{
    "registry-mirror": "https://registry-cache.nipa.cloud"
}
```

จากนั้นออกจาก editor และ save file

### 2. Restart Docker service

Restart Docker service โดยใช้ command&#x20;

```
systemctl restart docker.service
```

### 3. ตรวจสอบผลการ config&#x20;

ตรวจสอบว่า config เสร็จเรียบร้อยดีหรือไม่ โดยใช้ command&#x20;

```
docker info
```

registry mirrors ควรแสดงดังรูปด้านล่าง ก็เป็นอันเสร็จสิ้น\
![](/files/yhAH9NQ17u1W9O0knvto)<br>


---

# 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://docs-epc.gitbook.io/ncs-documents/compute/compute-instance/setup-docker-image-caching.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.
