Docker: unable to prepare context: unable to evaluate symlinks in Dockerfile path: GetFileAttributesEx

后端 未结 30 2249
野性不改
野性不改 2020-11-29 21:23

I just downloaded Docker Toolbox for Windows 10 64bit today. I\'m going through the tutorial. I\'m receving the following error when trying to build an image using a Docke

相关标签:
30条回答
  • 2020-11-29 21:49

    I also faced the same issues and it was resolved when i created file named with DockerFile and mentioned all the command which wanted to get executed while creation of any image.

    0 讨论(0)
  • 2020-11-29 21:50

    That's just because Notepad add ".txt" at the end of Dockerfile

    0 讨论(0)
  • 2020-11-29 21:50

    The issue is related to the DockerFile creation procedure.

    In order to work, open cmd, cd to the directory of interest and type:

    abc>DockerFile
    

    This will create a file called DockerFile inside your folder.

    Now type:

    notepad DockerFile 
    

    This will open the DockerFile file in notepad and you will have to copy/paste the standard code provided.

    Save the file and now, finally, build your image with Docker typing:

    docker build -t docker-whale . 
    

    This is working for me and I hope it helps others

    0 讨论(0)
  • 2020-11-29 21:51

    I had named my file dockerfile instead of Dockerfile (capitalized), and once I changed that, it started processing my "Dockerfile".

    0 讨论(0)
  • 2020-11-29 21:53

    Execute docker build -t getting-started . in your project directory and make sure Dockerfile is present and having no .txt extension. If you are on Windows, check the 'file name extension' in the under the view tab in the File Explorer to show whether .txt is there or not and remove it if the former is true. Good Luck.

    0 讨论(0)
  • 2020-11-29 21:54

    The error message is misleading. The problem has nothing to do with symlinks really. It is usually only that docker cannot find the Dockerfile describing the build.

    Typical reasons are these:

    • Dockerfile has wrong name.
      It must be called Dockerfile. If it is called, for instance, dockerfile, .Dockerfile, Dockerfile.txt, or other, it will not be found.
    • Dockerfile is not in context.
      If you say docker build contextdir, the Dockerfile must be at contextdir/Dockerfile. If you have it in, say, ./Dockerfile instead, it will not be found.
    • Dockerfile does not exist at all.
      Sounds silly? Well, I got the above error message from my GitLab CI after I had written a nice Dockerfile, but forgotten to check it in. Silly? Sure. Unlikely? No.
    0 讨论(0)
提交回复
热议问题