Links

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 ก่อนออกจาก editor และ save file
{
"registry-mirror": "https://registry-cache.nipa.cloud"
}

2. restart Docker service

restart Docker service โดยใช้ command ดังนี้
systemctl restart docker.service

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

ตรวจสอบว่า config เสร็จเรียบร้อยดีหรือไม่ โดยใช้ command ดังนี้
docker info
registry mirrors ควรแสดงดังรูปด้านล่าง ก็เป็นอันเสร็จสิ้น