cancel
Showing results for 
Search instead for 
Did you mean: 
JS_Learning
Moderator
Moderator
  • 1,338 Views

dockerfile question cmd syntax

Hi,

I have a question, regarding the syntaxt of the CMD command, in a Dockerfile.

Example of CMD command 

I truncated the example from the source above, as the rest is not relevant:

CMD ["/opt/eap/bin/standalone.sh", "-b", "0.0.0.0"]

Why can't it be:

CMD ["/opt/eap/bin/standalone.sh -b 0.0.0.0" ]?

I have tried the two versions above. The first one, while it appears to be the correct syntax, did not work: the process was not starting and making plenty of errors.

Using the second syntax, I was able to start the process, and it was logging as if it's started. I was unable to connect to that running container though (the issue might be due to something else).

 

Thanks in advance,

 

 

Labels (3)
1 Reply
ericbos
Flight Engineer
Flight Engineer
  • 1,298 Views

In the exec form the CMD expects an array, but I believe EAP needs some more parameters:

CMD ["sh", "bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]

This is what I have in my Dockerfile and it creates a working image in my CRC environment.

0 Kudos
Join the discussion
You must log in to join this conversation.