0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

docker-machine Waiting for ssh to be availableで止まる

Posted at

環境:windows10

PowerShellで

docker-machine create --driver hyperv machine-name

を実行したところ

...Waiting for ssh to be available

から動きませんでした。

docker-machine ls 

で状況を確認したところ

Unable to query docker version: Get https://123.123.123.123:2376/v1.15/version:x509:certificate has expired or is not yet valid

と証明書関係でエラーになっていることがわかった。

試したこと

デバッグをしてみる

docker-machine --debug create --driver hyperv machine-name
実行結果
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : ssh command error:
command : exit 0
err     : exit status 255
output  :

上記がループされていた。原因がよくわからなかった。

試したこと2

証明書を再作成

docker-machine regenerate-certs --client-certs
結果

変わらなかった。証明書の期限切れではないようだった。

試したこと3

sshログインしてみる

ssh -i ./id_rsa docker@123.123.123.123
実行結果
It is required that your private key files are NOT accessible by others.
This private key will be ignored.

これは鍵の権限が400か600でないとダメなのに、ほかのユーザにも権限があるから変えないとダメだそう。

鍵のファイルからプロパティ→セキュリティ→自分のユーザーをフルコントロールにし、その他を削除して再度SSHに接続。入ることができて、docker-machineも無事に作成することができました。

感想

エラーの原因を特定するログを出すのに苦戦してしまいました。。。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?