LoginSignup
2
2

More than 5 years have passed since last update.

Dockerって何?状態の私が、Windows10 Proインストールエラーを解決した話(以前Home版を稼働していた場合)

Last updated at Posted at 2019-04-23

Windows10 ProのPCにすでにDockerがインストールされていたため、
利用しようとするとエラーになったので、解決手順をメモしておきます:relaxed:

docker.gif

追記(4/25):
フォロワーさんから、教えていただきました!
ありがたい:crying_cat_face:

Dockerがインストールされてるっていうより実はdocker for winがVmの立ち上げとかをやってくれてるだけ、っていうのが真相です

1、とりあえずDockerとToolboxをアンインストール

アンインストールして、Windows10 Proの方法で再度インストールすれば大丈夫(と思っていた)

ともあれ一度、クリーンな状態にしましょう。
ToolboxはProには不要なので、忘れずアンインストール★

2、Pro版の再インストール

◆ここからDLできます
Install Docker Desktop for Windows

念のため前調べをして。。。
以下の記事を参考にさせていただきました。(ありがとうございます♡)

◆俺のDocker - Windows10にインストール
https://qiita.com/Ogaaaan/items/99fe54f052ca450889f7

◆Docker for WindowsをWindows10 Proにインストール
https://qiita.com/anikundesu/items/7ecf20b7e8a60f8439a8

※記事にもありますが、「Hyper-Vを有効化」を忘れずに!

3、インストールが終わったら

  • きちんとインストールできてるか確認(できてる!)
docker -v
Docker version 18.09.2, build 6247962
  • imagesの状況を確認するとエラーになる!
docker images
could not read CA certificate "C:\\Users\\...\\.docker\\machine\\machines\\default\\ca.pem": open C:\Users\...\.docker\machine\machines\default\ca.pem: The system cannot find the path specified.

4、原因はDocker Toolboxの残骸

Dockerに詳しくないので、エラーをググってみると下記の記事と同じ状況でした。
(ありがとうございます♡)

◆Docker for Windowsをインストール後 could not read CA certificateエラーが出た時の解決方法
https://qiita.com/icck/items/60e1c1f8b6a05c8fdf72

記事どおりに、Powershellでコマンドを実行してみた。

[Environment]::SetEnvironmentVariable("DOCKER_CERT_PATH", $null, "User")
[Environment]::SetEnvironmentVariable("DOCKER_HOST", $null, "User")
[Environment]::SetEnvironmentVariable("DOCKER_MACHINE_NAME", $null, "User")
[Environment]::SetEnvironmentVariable("DOCKER_TLS_VERIFY", $null, "User")
[Environment]::SetEnvironmentVariable("DOCKER_TOOLBOX_INSTALL_PATH", $null, "User")

再度imagesコマンドをたたく

docker images
could not read CA certificate "C:\\Users\\...\\.docker\\machine\\machines\\default\\ca.pem": open C:\Users\...\.docker\machine\machines\default\ca.pem: The system cannot find the path specified.

エラーになりました・・・(何で?)

5、何かが残っているのかもしれない

調べてみたところ、下記が残っている場合があるとか。

  • コンテナが残っている?
  • imagesが残っている?

など、自動的に消えないものが邪魔をしている。と考えました。

6、お掃除コマンドを発見

以下の記事を参考にさせていただきました。(ありがとうございます♡)

◆Dockerのお掃除
http://suguru03.hatenablog.com/entry/2017/02/14/085000

7、コマンドを実行してみる

色んなコマンドがあるようですが、一発で綺麗にしたかったので、
以下のコマンドを利用しました。

docker system prune

記事によると、以下のように何か特定的なものを削除する場合のコマンドもあるようです。

  • イメージだけ削除したい場合
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /etc:/etc spotify/docker-gc
  • コンテナを削除したい場合
docker rm -v $(docker ps -a -q -f status=exited)

8、無事動きました!

  • 以下のコマンドでターミナルに出てくる文字を確認します。
docker run hello-world
  • Dockerから以下のメッセージが届いたら(ターミナルに出力されたら)OK!
Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

今回は会社のPCでの実行だったので、前に使っていた人が間違えて(?)Home版をインストールし、
使っていたのかもしれないですが。

もし、間違えても私は上記の手順で解決できました。
参考になるとうれしいです♡

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