2
2

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

「Cannot connect to the Docker daemon . Is the docker daemon running?」 解消

Posted at

Dockerの立ち上げで何度もつまづくのは面倒なので、今回出たエラーの解消法を記載しました。

1. 解決策
2. まとめ 
3. 参考文献 

全てはこのIs the docker daemon running?というエラーから。

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

こちらの方の記事を参考にして書きコードを打ってもcommand not found祭り。
https://qiita.com/raySSK/items/655e63f12755012a28db

$ systemctl start docker
bash: systemctl: command not found

$ service start docker
bash: service: command not found

$ systemctl start docker
bash: systemctl: command not found

$ systemctl enable docker
bash: systemctl: command not found
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

何やってもCommand not foundと出る。

docker -v
Docker version 20.10.6, build 370c289

Dockerはインストールされてるみたい。一旦Ubuntuを再起動してみた。
https://eng-entrance.com/linux-ubuntu-reboot

$ sudo reboot
$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

まだ解決しない。

#1-解決策

LaunchpadにあるDockerアプリを確認。No containers runnning(どのコンテナも起動されていません)とあるので、このコードをターミナルにコピペ。

2021-06-12 7.57のイメージ.jpg

 $docker run -d -p 80:80 docker/getting-started
Unable to find image 'docker/getting-started:latest' locally
latest: Pulling from docker/getting-started
540db60ca938: Already exists 
0ae30075c5da: Pull complete 
9da81141e74e: Pull complete 
b2e41dd2ded0: Pull complete 
7f40e809fb2d: Pull complete 
758848c48411: Pull complete 
23ded5c3e3fe: Pull complete 
38a847d4d941: Pull complete 
Digest: sha256:10555bb0c50e13fc4dd965ddb5f00e948ffa53c13ff15dcdc85b7ab65e1f240b
Status: Downloaded newer image for docker/getting-started:latest
5b05fdc4d6e0cf375cb88034b8c2eca23467d802bc83f84cc1ddcf055eed3c46

やっと解決できました!

$ docker ps
CONTAINER ID   IMAGE                    COMMAND                  CREATED         STATUS         PORTS                               NAMES
5b05fdc4d6e0   docker/getting-started   "/docker-entrypoint.…"   7 seconds ago   Up 5 seconds   0.0.0.0:80->80/tcp, :::80->80/tcp   brave_colden

#2-まとめ

Is the docker daemon running?が出たら、Launchpad→Dockerapp→コードをコピペすればDockerが起動される。

はあ、俺の貴重な朝の1時間が、、
まあ、切り替えていきましょ!

#3-参考文献
https://www.konosumi.net/entry/2018/01/21/125523

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?