skip to Main Content

I’m new to docker and I’d like to understand the reason for this error, I’m creating a dockerfile where to start Elasticsearch, Mysql and the application, when I build it gives me this error "Error response from daemon: dockerfile parse error line 38: instruction unknown: ENTRYPOINT["/BIN/ENTRYPOINT.SH"]"

Dockerfile

FROM ubuntu:20.04
WORKDIR \wsl.localhostUbuntuhomemarcoprojectmultiple-docker-containerbackend
COPY . .
RUN apt update
RUN apt-get update
RUN apt-get install wget -y
RUN apt install apt-transport-https ca-certificates gnupg -y
RUN wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
RUN sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
RUN apt-get update -y
RUN apt-get install elasticsearch -y
RUN apt install mysql-server -y
RUN apt install npm -y
RUN npm install
RUN npm install nodemon
RUN apt install nodejs -y
EXPOSE 3306 
EXPOSE 9200
EXPOSE 5000
COPY entrypoint.sh /bin/entrypoint.sh
RUN chmod +x /bin/entrypoint.sh
ENTRYPOINT ["/bin/entrypoint.sh"]

entrypoint.sh

#!/bin/sh

service elasticsearch start

service elasticsearch enable

service mysql start

npm start `

What could be the problem? I’m running this on an ubuntu terminal

2

Answers


  1. In your question you wrote ENTRYPOINT["/BIN/ENTRYPOINT.SH"], in the Dockerfile I see ENTRYPOINT ["/BIN/ENTRYPOINT.SH"].

    If your are talking about ENTRYPOINT["/BIN/ENTRYPOINT.SH"] the error is the missing space before the opening square bracket.

    Login or Signup to reply.
  2. The previous answer is not very helpful.

    I was getting the same error, but I wasn’t missing a space and my error was not missing the space.

    Turns out, there were newlines between directives in the Dockerfile.

    So clearly spacing matters a little more than it should. 😉

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search