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

后端 未结 9 2856
名媛妹妹
名媛妹妹 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:21

    I had an extra line break in my Dockerfile. Didn't even notice it until I read some of these comments and realized it could be a problem. Originally my file was:

    FROM openjdk:8
    COPY . /usr/src/Main
    WORKDIR /usr/src/Main
    ENTRYPOINT ["java", "-Xmx700m","-classpath", ".:./resources/:./lib/*",
    "org.spark.docker.demo.DockerMultilayerPerceptronClassifier"]
    

    and the error I was seeing was:

    $ docker build -t docker-classifier .                                                                                                                                         
    Sending build context to Docker daemon  248.3MB
    Error response from daemon: Dockerfile parse error line 5: unknown instruction: "ORG.SPARK.DOCKER.DEMO.DOCKERMULTILAYERPERCEPTRONCLASSIFIER"]
    

    Took me a while to figure it out until I read some of these comments above and looked into the line formatting and realized "org.spark.docker.demo.DockerMultilayerPerceptronClassifier"] was on a line of it's own. Once I removed the line break before it everything worked fine. I assumed the parser would ignore it.

    0 讨论(0)
  • 2021-01-17 08:27

    i run docker compose in intellij idea, solved this by remove the number in docker parent folder name.

    0 讨论(0)
  • 2021-01-17 08:28

    While running, appended some text in the start of the file. Removed those using vi in terminal and working fine.

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