Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Building a node image: Error response from daemon: dockerfile parse error line 15: unknown instruction: CMD["NODE",

I am trying to build a docker image for an app that uses yarn dependencies. I have this error when I run

docker build . -t [name]

It starts building, but then I get this error.

Error response from daemon: dockerfile parse error line 15: unknown instruction: CMD["NODE",

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This is my dockerfile

FROM node

WORKDIR /usr/src/app

RUN npm install

COPY package*.json ./
COPY . .

RUN npm install --global yarn
RUN yarn install

EXPOSE 3002

CMD["node", "app.js"]
CMD["yarn", "start"]

What am I doing wrong?

I tried changing the Dockerfile lines. Is there a different way for building yarn apps?

>Solution :

Change:

CMD["node", "app.js"]
CMD["yarn", "start"]

in

CMD ["node", "app.js"]
CMD ["yarn", "start"]

You missed the space between CMD and [.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading