Docker Compose Up gives “The system cannot find the file specified.” error

后端 未结 10 2198
悲&欢浪女
悲&欢浪女 2021-02-11 11:44

I have recently installed Docker Toolbox on my Windows 10 machine.

However, whenever I run docker-compose up I get the following error message:

相关标签:
10条回答
  • 2021-02-11 12:23

    I had this problem with a fresh install of Docker on Windows 10. My issue was that I hadn't actually run Docker first; I just installed the .msi and ran "docker-compose" from the command line.

    Once I ran Docker, (and followed a few more post-installation steps, to include logging out of and restarting my computer) I was able to run docker-compose without issue.

    0 讨论(0)
  • 2021-02-11 12:23

    You and I may or may not have the same problem. In the link posted by @Haken Lid above, the issue is with the PATH environment variable not having the correct version of Python.

    BUT, for me, the issue was that I had not set all of my environment variables, by running

    eval $(docker-machine env <vmname>)
    

    before I ran the docker-compose <any command>.

    0 讨论(0)
  • 2021-02-11 12:24

    I spent close to an hour fixing this issue on my Windows machine.

    1. Install Python (version 3.6.1 worked fine for me), selecting the option "add to PATH".
    2. Install Docker.
    3. Reboot your machine.
    4. On your notification bar you'll see an icon for Docker. Right-click it and select Settings.... Go to Shared Drives and select C: drive. You will be prompted for credentials. [*]
    5. Run docker build .
    6. Run docker-compose up.

      [*]: If you don't do this step you might see this error when on step 6: ERROR: for website Cannot create container for service website: C: drive is not shared. Please share it in Docker for Windows Settings. If after entering your credentials the C: drive isn't checked, create a new user for your machine that has full access to the folder where you will run docker-compose up.

    0 讨论(0)
  • 2021-02-11 12:28

    Quitting Docker and stopping Docker VM solved this for me.

    0 讨论(0)
  • 2021-02-11 12:28

    I ran into this issue after the Docker Quickstart Terminal hanged a while on "Waiting for an IP..." during start up.

    Restarting the Docker Quickstart Terminal fixed everything.

    0 讨论(0)
  • 2021-02-11 12:30

    You can set properties by typing the following commands:

    docker-machine env --shell cmd default
    @FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO @%i
    
    0 讨论(0)
提交回复
热议问题