Docker Native on Mac
Insecure Registry
在Mac版本的docker native中,如果需要設定insecure registry時候,無法像Linux中直接尋找/etc/docker中的位置來建立ca.crt檔案,讓docker client可以trust docker registry的ssl key... 因此需要設定insecure registry來避過docker client的檢查,下面是從狀態列叫出的Preference視窗,其中Insecure registries部分就是設定您的私有registry的位置。
接著,嘗試pull設定上去的私有registry資料時候,會提示是否將相關的設定設為透通...
$ git pull git.linkeriot.io:5000/linkeriot/iot-server
The authenticity of host 'git.linkeriot.io (123.123.123.123)' can't be established.
ECDSA key fingerprint is SHA256:wNmaKraaaJfnq/QGdV4ZgYfJ+4EOaaaaMZWFfdYY.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'git.linkeriot.io' (ECDSA) to the list of known hosts.
Warning: the ECDSA host key for 'git.linkeriot.io' differs from the key for the IP address '123.123.123.123'
Offending key for IP in /Users/peihsinsu/.ssh/known_hosts:228
Are you sure you want to continue connecting (yes/no)? yes
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
接下來如果registry並未有設定帳號密碼,應該已經可以直接pull資料,但是如果建立registry時候有使用apache htpasswd建立存取使用者的話,則需要再多一個步驟:
$ docker login git.linkeriot.io:5000
Username: simonsu
Password:
Login Succeeded
一且設定無誤之後,應該就可以開始push/pull你的docker image了唷~
docker pull git.linkeriot.io:5000/linkeriot/iot-server
Using default tag: latest
latest: Pulling from linkeriot/iot-server
8f4ec95ceaee: Already exists
6e3a0332ed00: Already exists
a3ed95caeb02: Already exists
fd318c406805: Pull complete
Digest: sha256:fb2968fb1e14aaaaaaaa1c8009a8c0469bc262485d1e61e6cf94e9e26
Status: Downloaded newer image for git.linkeriot.io:5000/linkeriot/iot-server:latest