如何設定 Docker 下載 image 略過憑證

前言
有遇過 pull 自己的私有倉庫無法 pull 下來的問題嗎,今天來教大家如何解決無法 pull image 問題,可暫時解決狀況
錯誤訊息
出現以下訊息代表,這個 docker registry 並沒有經過 https 憑證,所以 docker 會把它擋下來
Error response from daemon: Get "https://192.168.18.35:5000/v2/": tls: failed to verify certificate: x509: cannot validate certificate for 192.168.18.35 because it doesn't contain any IP SANs
解決方法
如果是 linux 系統,在 /etc/docker/ 目錄下建立 daemon.json 檔案,加入下面 json 資訊
{
"insecure-registries": ["192.168.18.35:5000"]
}
再來重啟 docker
sudo systemctl restart docker
如果是 windows 系統,在 docker desktop 設定下加上上方 json 設定,套用即可使用
