AdSense

網頁

2020/5/2

Docker Machine Unable to query docker version: Get https://192.168.99.101:2376/v1.15/version: x509: certificate is valid for 192.168.99.100, not 192.168.99.101

今天重新啟動VM的Docker machine後查詢machine列表時,其中一個machine的ERROR欄位出現無法獲得版本的訊息如下。

Unable to query docker version: Get https://192.168.99.101:2376/v1.15/version: x509: certificate is valid for 192.168.99.100, not 192.168.99.101


$ docker-machine ls
NAME          ACTIVE   DRIVER       STATE     URL                         SWARM  DOCKER     ERRORS
default       -        virtualbox   Running   tcp://192.168.99.100:2376          v19.03.5
demo-docker   -        virtualbox   Running   tcp://192.168.99.101:2376          Unknown    Unable to query docker version: Get https://192.168.99.101:2376/v1.15/version: x509: certificate is valid for 192.168.99.100, not 192.168.99.101

解決方法是使用docker-machine regenerate-certs <machine-name>重新產生該machine的certificate。

$ docker-machine regenerate-certs demo-docker
Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Waiting for SSH to be available...
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...


沒有留言:

AdSense