From 3fc321e80473f4e05d1156878b658a36e7eff01b Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Wed, 18 May 2022 08:56:45 +0100 Subject: [PATCH] Move --daemon to CMD from ENTRYPOINT I've moved the `--daemon` command from `ENTRYPOINT` to `CMD` to allow users of the dockerfile some flexibility The executable and/or arguments in `CMD` can be overridden easily by users of the container, but `ENTRYPOINT` is intended as a "this is always at the start of the command". ([reference](https://docs.docker.com/engine/reference/builder/#cmd)) For example, with the change in this commit: - `docker run ghcr.io/markqvist/nomadnet:master --help` will output the same as `nomadnet --help` - `docker run ghcr.io/markqvist/nomadnet:master` will run `nomadnet --daemon` - `docker run ghcr.io/markqvist/nomadnet:master ""` will run `nomadnet` (if we wanted this to be a little more self-explaining, there could be a `--ui` flag which runs the UI and is default-on, so `docker run ghcr.io/markqvist/nomadnet:master --ui` would work) --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d1c016d..ea3e1b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,4 +21,5 @@ COPY --from=build /opt/venv /opt/venv VOLUME /root/.reticulum VOLUME /root/.nomadnetwork -ENTRYPOINT ["nomadnet", "--daemon"] \ No newline at end of file +ENTRYPOINT ["nomadnet"] +CMD ["--daemon"]