bazel-remote icon indicating copy to clipboard operation
bazel-remote copied to clipboard

Set default configuration in Dockerfile using environment variables

Open AlexandreCarlton opened this issue 7 years ago • 2 comments

This will allow users to easily change the port and directory without having to override the entrypoint.

I also updated the README to document the usage of these environment variables.

AlexandreCarlton avatar Jul 13 '18 23:07 AlexandreCarlton

LGTM, or we could change ENTRYPOINT to CMD IIRC.

nicolov avatar Jul 17 '18 06:07 nicolov

I considered this, but if we had:

CMD ["--port=80", "--dir=/data"]

then a user already providing arguments to the docker run invocation (for example --max-size 1) would override these options instead of appending to them. From the docs:

If the user specifies arguments to docker run then they will override the default specified in CMD.

Specifying these values as environment variables seemed better to avoid breaking changes.

AlexandreCarlton avatar Jul 17 '18 13:07 AlexandreCarlton