Trying to write a single Dockerfile that can accommodate multiple build options via arguments. The mpm --no-gpu flag is hard to work around without having to do either some conditional logic and code repetition, or some dynamic code evaluation which is rightly frowned up.
Example:
ARG no_gpu=false
RUN if [[ $no_gpu == false ]]; then
mpm --no-gpu ....
else
mpm ....
fi
This combined with the existing complexity around mpm calls leads to some not-very-nice Dockerfiles.
If the --no-gpu option was a name=value argument instead, with a default true when present, this would greatly simplify the callability, and preserve backwards compatibility. It would also be consistent with existing mpm arguments.
Trying to write a single Dockerfile that can accommodate multiple build options via arguments. The
mpm --no-gpu
flag is hard to work around without having to do either some conditional logic and code repetition, or some dynamic code evaluation which is rightly frowned up.Example:
This combined with the existing complexity around
mpm
calls leads to some not-very-nice Dockerfiles.If the
--no-gpu
option was a name=value argument instead, with a defaulttrue
when present, this would greatly simplify the callability, and preserve backwards compatibility. It would also be consistent with existing mpm arguments.mpm --no-gpu=true
same asmpm --no-gpu
.mpm --no-gpu=false
same asmpm
.