echo not found in docker image

Viewed 1732

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
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"]
Related