Docker commands fails (in Windows)

前端 未结 25 2431
-上瘾入骨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:49
    1. Open cmd with admin rights.
    2. Execute following command

      docker-machine env --shell cmd default

    3. you will receive following output

      SET DOCKER_TLS_VERIFY=1

      SET DOCKER_HOST=tcp://192.168.99.102:2376

      SET DOCKER_CERT_PATH=C:\Users\DBashyal.docker\machine\machines\default

      SET DOCKER_MACHINE_NAME=default

      REM Run this command to configure your shell:

      REM @FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO @%i

    4. Copy the highlighted line and execute on cmd

      @FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO @%i

    5. Execute following command

      docker ps

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

    As pointed in other answers you need to set a few environment variables.

    The easiest way to do it is:

     @FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd') DO @%i
    

    This will run docker-machine env --shell cmd and add those environmental variables.

    If you want these variables to be persistent defined them in windows (tutorial).

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

    I was getting this error, while running the command docker-compose up. The problem for me was, the docker service was not running. So I had to run services.msc and start the docker service.

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

    Make sure Hyper-V is up and running:

    • open elevated command prompt
    • type bcdedit /set hypervisorlaunchtype auto
    • reboot
    • run "Docker for Windows"
    0 讨论(0)
  • 2020-12-23 02:52

    below resolved. i copied answer from another forum

    I had this problem after update. After re-installing VB I switched on "VirtualBox NDIS6 Bridged Networking Driver" in properties network connection.

    It property switched off default in my case.

    0 讨论(0)
  • 2020-12-23 02:57
    1. Switch to Windows Containers
    2. docker info
    3. docker ps
    4. Switch back to Linux containers
    5. docker info
    6. Viola!

    The windows switch likely runs the missing configurations that Linux also needs.

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