Docker multiline CMD or ENTRYPOINT
I have a really long command line for the default process due to a number of arguments. I think the easiest would be to create a script (for eg.
run.sh) and then call this script in your
CMD. I’m wondering if there is a way to make your
CMD multiline (the way we write
RUN). For eg.
ENTRYPOINT["/path/myprocess", "arg1", "arg2" ]
I was thinking this is a valid syntax since the format is json. However,
docker build throws the error
Step 14 : ENTRYPOINT[ Unknown instruction: ENTRYPOINT[
Is there a way I can split the
ENTRYPOINT to multiple lines?
One Solution collect form web for “Docker multiline CMD or ENTRYPOINT”
It was a typo in the dockerfile. I missed a
[. Dockerfile supports multiline
CMD by terminating the line with
\, same as
RUN. So, in my case it can be
ENTRYPOINT [ "/path/myprocess", \ "arg1", \ "arg2" \ ]