Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker: Command "/bin/sh" not found

Tags:

node.js

docker

ENV PORT=3000
ENV NODE_ENV=production
EXPOSE $PORT

WORKDIR $APP_DIR
COPY yarn.lock package.json $APP_DIR/
RUN ["/usr/local/bin/yarn"]

COPY . $APP_DIR
ENTRYPOINT ["/usr/local/bin/yarn", "run"]
CMD ['dev']

Was running this using this command

docker run --rm -p 3000:3000 my-app:latest

And the console outputs yarn run v0.17.9 error Command "/bin/sh" not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I expect /usr/local/bin/yarn run dev to be executed inside docker, am I missing something?

like image 627
user469652 Avatar asked May 09 '26 13:05

user469652


1 Answers

Try switching to double quotes, single quotes aren't valid for a json string:

CMD ["dev"]
like image 196
BMitch Avatar answered May 12 '26 05:05

BMitch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!