docker报错FATA [0000] Get http:///var/run/docker.sock/v1.17/version:dial unix /var/run/docker.sock(FAT

本文介绍了一种在Kali系统中遇到的Docker连接错误及其解决方案。通过安装AppArmor并重启Docker服务来修复无法连接到Docker守护进程的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

root@kali:~/Desktop# docker images
FATA[0000] Get http:///var/run/docker.sock/v1.18/images/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? 


解决:

sudo apt-get install apparmor


service docker restart



[root@0404 ~]# systemctl status dockerdocker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: active (running) since 日 2025-06-08 11:25:00 CST; 45min ago Docs: https://docs.docker.com Main PID: 13844 (dockerd) Tasks: 27 Memory: 279.0M CGroup: /system.slice/docker.service ├─13844 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/con... ├─14946 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-po... └─14952 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 27... 6月 08 12:10:39 0404 dockerd[13844]: time="2025-06-08T12:10:39.791256349+08:... 6月 08 12:10:39 0404 dockerd[13844]: time="2025-06-08T12:10:39.792029919+08:... 6月 08 12:10:42 0404 dockerd[13844]: time="2025-06-08T12:10:42.790951361+08:... 6月 08 12:10:42 0404 dockerd[13844]: time="2025-06-08T12:10:42.791697100+08:... 6月 08 12:10:43 0404 dockerd[13844]: time="2025-06-08T12:10:43.792125591+08:... 6月 08 12:10:43 0404 dockerd[13844]: time="2025-06-08T12:10:43.792293242+08:... 6月 08 12:10:46 0404 dockerd[13844]: time="2025-06-08T12:10:46.791733691+08:... 6月 08 12:10:46 0404 dockerd[13844]: time="2025-06-08T12:10:46.792178125+08:... 6月 08 12:10:47 0404 dockerd[13844]: time="2025-06-08T12:10:47.792911404+08:... 6月 08 12:10:47 0404 dockerd[13844]: time="2025-06-08T12:10:47.793449663+08:... Hint: Some lines were ellipsized, use -l to show in full. [root@0404 ~]# # 列出所有系统Pods(需容器运行时正常) [root@0404 ~]# crictl pods -n kube-system Incorrect Usage: invalid value "kube-system" for flag -n: parse error NAME: crictl pods - List pods USAGE: crictl pods command [command options] [arguments...] COMMANDS: help, h Shows a list of commands or help for one command OPTIONS: --id value filter by pod id --label value [ --label value ] filter by key=value label --last value, -n value Show last n recently created pods. Set 0 for unlimited (default: 0) --latest, -l Show the most recently created pod (default: false) --name value filter by pod name regular expression pattern --namespace value filter by pod namespace regular expression pattern --no-trunc Show output without truncating the ID (default: false) --output value, -o value Output format, One of: json|yaml|table (default: "table") --quiet, -q list only pod IDs (default: false) --state value, -s value filter by pod state --verbose, -v show verbose info for pods (default: false) --help, -h show help (default: false) FATA[0000] invalid value "kube-system" for flag -n: parse error [root@0404 ~]# crictl ps -a WARN[0000] runtime connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead. WARN[0000] image connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead. E0608 12:12:43.766070 18318 remote_runtime.go:390] "ListContainers with filter from runtime service failed" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory\"" filter="&ContainerFilter{Id:,State:nil,PodSandboxId:,LabelSelector:map[string]string{},}" FATA[0000] listing containers: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory"
06-09
"Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 这个错误通常出现在尝试与Docker守护进程建立连接时失败。这可能是因为Docker守护进程未运行或出现其他问题。 为了解决这个问题,你可以尝试以下几个步骤: 1. 确保Docker守护进程正在运行。你可以通过运行命令"sudo service docker status"来检查Docker守护进程的状态。如果它未运行,你可以使用"sudo service docker start"启动它。 2. 检查Docker守护进程的日志以获取更多信息。你可以使用命令"sudo tail -f /var/log/upstart/docker.log"来查看日志。日志可能会给出关于为什么无法连接到守护进程的更多详细信息。 3. 确保你的用户具有适当的权限来访问Docker守护进程。默认情况下,只有root用户和docker组的成员才能访问守护进程。你可以将当前用户添加到docker组中,以便能够与守护进程进行交互。你可以使用命令"sudo usermod -aG docker your_username"将当前用户添加到docker组中(将"your_username"替换为你的用户名)。 4. 确认/var/run/docker.sock文件存在并具有正确的权限。你可以使用命令"ls -l /var/run/docker.sock"来检查文件的权限和所有者。如果文件不存在或具有不正确的权限,你可以尝试通过运行"sudo chmod 666 /var/run/docker.sock"来更改权限。 总结起来,当出现"Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"错误时,你应该检查Docker守护进程的运行状态,查看日志获取更多信息,确保用户具有访问权限,并确认文件权限和所有者设置正确。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?](https://blog.csdn.net/qq_42114918/article/details/81840335)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [ubuntu vps安装docker报错:Cannot connect to the Docker daemon at unix:///var/run/docker.sock....](https://download.csdn.net/download/weixin_38733787/14094320)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值