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

后端 未结 9 2860
名媛妹妹
名媛妹妹 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.

提交回复
热议问题