Setting Docker Image Caching

วิธีเปิดใช้งานและตั้งค่า image caching บน instance

Prerequisite

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

Instructions

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

1. แก้ไข file docker config

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

$nano /etc/docker/daemon.json

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

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

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

2. Restart Docker service

Restart Docker service โดยใช้ command

systemctl restart docker.service

3. ตรวจสอบผลการ config

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

docker info

Last updated