Skip to content

Commit

Permalink
feat(model-server)!: Use ENTRYPOINT instead of CMD in the provided Do…
Browse files Browse the repository at this point in the history
…cker image

This follows best practices for Docker images.
> You can use the exec form of ENTRYPOINT to set fairly stable default commands and arguments and then use either form of CMD to set additional defaults that are more likely to be changed.
See https://docs.docker.com/engine/reference/builder/#exec-form-entrypoint-example

Using a ENTRYPOINT in model-server docker container makes passing arguments easier.
For example,
`docker run modelix/model-server ./run-model-server.sh -inmemory`
would be simplified to
`docker run modelix/model-server -inmemory`

BREAKING CHANGE: The previous entry point was the default `ENTRYPOINT ["/bin/sh", "-c"]`.
 Now it is `ENTRYPOINT ["./run-model-server.sh"]`.
 If you used `docker run modelix/model-server ./run-model-server.sh <args>` to pass arguments,
 you now have to use `docker run modelix/model-server <args>`.
 If you used any other process, you now have to override the entry point with the `--entrypoint` option.
 See https://docs.docker.com/engine/reference/run/#entrypoint-default-command-to-execute-at-runtime
  • Loading branch information
odzhychko committed Jan 8, 2024
1 parent 3d41891 commit 63da264
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ EXPOSE 28101
COPY run-model-server.sh /usr/modelix-model/
COPY build/dependency-libs/ /usr/modelix-model/model-server/build/libs/
COPY build/libs/ /usr/modelix-model/model-server/build/libs/
CMD ["./run-model-server.sh"]
ENTRYPOINT ["./run-model-server.sh"]

0 comments on commit 63da264

Please sign in to comment.