Error response from daemon: Dockerfile parse error line 1: unknown instruction: #

后端 未结 9 2850
名媛妹妹
名媛妹妹 2021-01-17 08:07

Im new to docker and trying to learn it. Im following this tutorial: https://docs.docker.com/get-started/part2/#apppy

So I installed Docker on Windows. Created 3 fil

9条回答
  •  伪装坚强ぢ
    2021-01-17 08:19

    I experienced this issue when working on a React app setup on Docker.

    Sending build context to Docker daemon 1.143MB

    Error response from daemon: Dockerfile parse error line 1: unknown instruction: +#

    Here's how I solved it

    The issue was that I had another file named Dockerfile (capital case D) which had some instructions in it, and it was conflicting with the original dockerfile (lower case d) in my project root directory.

    I fixed this by deleting the Dockerfile and running the command:

    docker build t myapp:latest .
    

    to build the docker image from the dockerfile instead.

    That's all.

    I hope this helps

提交回复
热议问题