错误“无法连接到Docker守护程序”在Ubuntu Docker容器中
我是Docker的新手,并且正在执行以下步骤,
- 在Windows上安装了Docker-Desktop,
- 从上面的图像中创建了图像“ Ubuntu”(标签为“ Jammy”)
- 了容器
- 创建 使用命令(docker
拉hello-world
)
这给了我以下错误,
Using default tag: latest
**Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?**
我尝试运行命令docker版本
,它给了我以下输出
Client:
Version: 20.10.12
API version: 1.41
Go version: go1.17.3
Git commit: 20.10.12-0ubuntu4
Built: Mon Mar 7 17:10:06 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
,然后我尝试了命令Sudo Service Docker Start
,但它给了我以下错误,
docker: unrecognized service
我在这里遇到的错误,并试图找到一种使Docker命令在我的Ubuntu Docker容器中工作的方法。请帮助我了解出了什么问题以及如何解决问题。
容器上的Ubuntu版本:
PRETTY_NAME="Ubuntu 22.04 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
注1:我也使用了上述所有命令sudo
,但结果仍然相同。
注2:我还启用了在tcp:// localhost:2375 tls
选项上露出守护程序
I am a newbie to docker and I am performing the following steps
- Installed docker-desktop on windows
- Pulled the image "ubuntu" (tag is "jammy")
- Created the container from the above image
- Tried to pull the 'hello-world' docker image with the command (docker
pull hello-world
)
This gives me the following error
Using default tag: latest
**Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?**
I tried to run the command docker version
and it gave me the following output
Client:
Version: 20.10.12
API version: 1.41
Go version: go1.17.3
Git commit: 20.10.12-0ubuntu4
Built: Mon Mar 7 17:10:06 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I then tried the command sudo service docker start
but it gives me the below error
docker: unrecognized service
I am stuck here and am trying to find a way to make the docker commands work in my ubuntu docker container. Please help me in understanding what is going wrong and how to resolve it.
Ubuntu version on the container:
PRETTY_NAME="Ubuntu 22.04 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
Note 1: I have used the sudo
also for all the above commands but still the same result.
Note 2: I have also enabled Expose daemon on tcp://localhost:2375 without TLS
option in the docker desktop and restarted my pc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论