There is a statement in your post and the title “CMD line is ignored”, which simply never happens, and there is no explanation why you think it is ignored. So there is nothing to answer here. That’s why I didn’t write before and followed the discussion to see where it goes.
So why do you think it? Despite the replies mentioning entrypoint and cmd you haven’t addressed what you didn’t understand or why you thought it was irrelevant. It is extremely important to understand the keywords in an answer and if you don’t, even after reading the linked documentations, ask for more explanation pointing out what you didn’t understand.
You run docker-compose build
. Now why do you think the CMD line should have any affect during building the image? What was that you expected to see and you didn’t see.
These things in a technical question are always important regardless of what the topic is, not just in case of Docker. Otherwise you can say the line is ignored, and we can say it isn’t. And that’s the end of the discussion.
Please, read this guide: How to format your forum posts
Now if you want to learn about the entrypoint and cmd and when these are running, you can read my blogpost. There is also a video in the post embedded from youtube:
I write and talk about all the instructions related to command executions. In your case, I think CMD is irrelevant, as you don’t run a container, just build the image.