Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

echo not found in docker image [closed]

I am creating a docker image in alpine and adding a CMD at the end, The image builds sucessfully, but when aI go to run the image:

CMD ["echo",  "some text"]  --- last line of image

error

/bin/sh: echo,: not found

Tried making it /bin/echo, but still get the same error. Do I need to start an interactive shell (docker run -it image /bin/sh). Thank you :).

/bin/sh: /bin/echo,: not found
like image 736
justaguy Avatar asked Apr 21 '26 19:04

justaguy


1 Answers

Notice how it's looking for echo, with a comma? Get rid of the extra quote that snuck in there.

CMD ["echo", "some text"]
like image 56
John Kugelman Avatar answered Apr 25 '26 02:04

John Kugelman