Docker commands fails (in Windows)

前端 未结 25 2426
-上瘾入骨i
-上瘾入骨i 2020-12-23 02:26

I am trying to use Docker on a windows machine and is hit with every possible issue it seems. My latest one is this: My machine is running but I can\'t seem to interact with

相关标签:
25条回答
  • 2020-12-23 02:37

    I have had this issue on a Windows 2016 machine. Happened because the docker service wasn't started. In my case the docker service as failing with the following error

    fatal: Error starting daemon: pid file found, ensure docker is not running or delete C:\ProgramData\docker.pid

    Deleting the C:\ProgramData\docker.pid file did the trick.

    0 讨论(0)
  • 2020-12-23 02:37

    For me, this error was resolved after I removed daemon.json file in "%programdata%\docker\config"

    The content in my daemon.json is the following:

    {
      "hosts": ["tcp://0.0.0.0:2375"]
    }
    

    I created this manually as part of some testing. But after I restarted the server, I started to get the error in this question.

    0 讨论(0)
  • 2020-12-23 02:37

    I had the same issue on my Windows 10. Find below what I did to solve it:

    After installing Docker, Just restart your PC, run docker application (It may require enabling Hyper-V), then open command line and type: docker run hello-world

    Everything works fine :)

    0 讨论(0)
  • 2020-12-23 02:38

    To start default host in windows I know three ways given below you can use one of them.

    1. Starting or restarting already created a default machine by the Docker:

      docker-machine start default
      docker-machine restart default
      

      Now check docker-machine env

    2. The following environment properties need to be set:

      set DOCKER_CERT_PATH=%USERPROFILE%\.docker\machine\machines\default
      set DOCKER_HOST=tcp://192.168.99.100:2376
      set DOCKER_MACHINE_NAME=default
      set DOCKER_TLS_VERIFY=1
      
    3. To create a new machine using the following command:

    Windows 10/HyperV:

    docker-machine create --driver hyperv default
    docker-machine create -d hyperv default
    

    Mac, Linux, windows 7 & 8:

    docker-machine create --driver virtualbox default
    docker-machine create -d virtualbox default
    
    0 讨论(0)
  • 2020-12-23 02:39

    I run into this problem when using docker-machine and I haven't run the docker-machine env command after rebooting. I'm not sure how to do this in cmd.exe, but if you're using powershell try issuing this command:

    docker-machine env --shell=powershell | Invoke-Expression
    
    0 讨论(0)
  • 2020-12-23 02:39

    I solved this error by run the {DOCKER_TOOLBOX_INSTALL_PATH}start.sh in bash.

    0 讨论(0)
提交回复
热议问题