29
29

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 5 years have passed since last update.

boot2docker でエラー x509: certificate is valid for 127.0.0.1, not 192.168.59.103 の対処

Last updated at Posted at 2015-06-21

※2015/07/15追記
v1.7.1で修正されたと、コメントで教えていただきました。
boot2docker upgradeをしましょう。

※2015/06/27追記
コメント欄の方法を試したところ、発生しなくなりました。
最初に書いた方法では、一度イメージなどが初期化されるため、不都合です。

dockerコマンドを入れても、以下のエラーで接続できなくなった。

$docker ps
FATA[0000] An error occurred trying to connect: Get https://192.168.59.103:2376/v1.18/containers/json: x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.59.103

boot2dockerを再作成してあげて、解決。

$boot2docker delete
$boot2docker init
$boot2docker up
Waiting for VM and Docker daemon to start...
..........................ooooooooooooooooooooooooooo
Started.
Writing /Users/nanashi/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/nanashi/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/nanashi/.boot2docker/certs/boot2docker-vm/key.pem

To connect the Docker client to the Docker daemon, please set:
    export DOCKER_HOST=tcp://192.168.59.104:2376
    export DOCKER_CERT_PATH=/Users/nanashi/.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1
$export DOCKER_HOST=tcp://192.168.59.104:2376
$docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

ただし、IPアドレスが変わるので、.bashrcに書いてあったら、それも書き換えなければならない。

29
29
8

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
29
29

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?