MathWebSearch / mws

MathWebSearch Implementation
https://search.mathweb.org/
GNU General Public License v3.0
46 stars 12 forks source link

Docker: Use image as a binary with ENTRYPOINT and CMD #110

Open ja-albert opened 1 year ago

ja-albert commented 1 year ago

Splitting the CMD in the Dockerfile into an ENTRYPOINT and CMD would give an more intuitive CLI. For example, this Dockerfile:

ENTRYPOINT ["/mws/bin/mwsd"]
CMD ["-p", "8080", "-I", "/data"]

would allow to directly interact with the mwsd binary:

(Not sure if the CMD part should also be moved to the ENTRYPOINT as defaults - probably depends on the implementation. That is, how does it handle two -p and -I options?)

For a more detailed explanation, see https://stackoverflow.com/questions/21553353/what-is-the-difference-between-cmd-and-entrypoint-in-a-dockerfile