一、問題描述
想要查看當(dāng)前有哪些容器,于是使用如下命令:
dp_user@rqalnxgrid4:/usr/sap/wwpFile> sudo docker ps -a
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
為了解決這個(gè)問題,我查看了網(wǎng)上的一些解決方法。
二、解決方案
$ systemctl daemon-reload
$ sudo service docker restart
$ sudo service docker status (should see active (running))
$ sudo docker run hello-world
按照以上命令進(jìn)行設(shè)置啟動(dòng),可以看到docker啟動(dòng)成功了。
dp_user@rqalnx***:/usr/sap/wwpFile> sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:5f179596a7335398b805f036f7e8561b6f0e32cd30a32f5e19d17a3cda6cc33d
Status: Downloaded newer image for hello-world:latest
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
-- 本人撰寫,嚴(yán)禁抄襲。