You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker daemon已运行但无法连接,拉取镜像失败求助

Troubleshooting Docker Daemon Connection Issues for docker pull

It looks like your Docker client is trying to connect to a Docker daemon running on a virtual machine at tcp://192.168.99.102:2376—this is typical if you’re using Docker Toolbox (which relies on a VirtualBox VM) instead of Docker Desktop’s native local daemon. Let’s walk through targeted fixes since you’ve already tried basic steps like restarting the service and using sudo:

Step 1: Check Docker Machine VM Status

First, confirm the underlying VM is running and accessible:

  • List your Docker Machine instances to verify the VM state:
    docker-machine ls
    
  • Look for the VM linked to 192.168.99.102 (usually named default). If its status shows Stopped, start it with:
    docker-machine start default
    
  • Load the required environment variables to point your Docker client to this VM:
    eval $(docker-machine env default)
    
    This sets DOCKER_HOST, DOCKER_TLS_VERIFY, and DOCKER_CERT_PATH to the correct values for the VM.

Step 2: Clear Stale Environment Variables (If Using Docker Desktop)

If you switched from Docker Toolbox to Docker Desktop, leftover environment variables might force the client to connect to the wrong daemon:

  • Clear the conflicting variables:
    unset DOCKER_HOST DOCKER_TLS_VERIFY DOCKER_CERT_PATH
    
  • Close and reopen your terminal to apply the change, then try the docker pull command again.

Step 3: Validate TLS Certificates

Port 2376 uses TLS encryption, so missing or corrupted certificates can block connections:

  • Check if your certificate path is correctly configured:
    echo $DOCKER_CERT_PATH
    
    It should point to a path like ~/.docker/machine/machines/default.
  • If certificates are missing or corrupted, regenerate them:
    docker-machine regenerate-certs default
    
  • Reload the environment variables again with eval $(docker-machine env default) and test the pull command.

Step 4: Test Direct Connection with Manual TLS Params

If the above steps fail, manually specify the daemon address and certificates to rule out environment issues:

docker -H tcp://192.168.99.102:2376 \
  --tlsverify \
  --tlscacert=~/.docker/machine/machines/default/ca.pem \
  --tlscert=~/.docker/machine/machines/default/cert.pem \
  --tlskey=~/.docker/machine/machines/default/key.pem \
  pull osixia/phpldapadmin:latest

Step 5: Check Network/Firewall Blockages

  • Verify you can ping the VM IP to confirm network connectivity:
    ping 192.168.99.102
    
    If ping fails, restart the VM with docker-machine restart default or check VirtualBox’s network settings for the VM.
  • Temporarily disable your local firewall (e.g., sudo ufw disable on Ubuntu) to rule out port blocking, then test the pull command again. Remember to re-enable the firewall afterward.

内容的提问来源于stack exchange,提问作者Juan David Porras Palencia

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:48:03