The question Bazel run - passing main arguments asks how to pass arguments to arguments to the container when using bazel run //package:target
. My question is how pass docker arguments via bazel run //package:target
, e.g. --gpus=all
.
The only workaround that I am aware of is to split it into two commands, e.g.
bazel run //package:target -- --norun
docker run --gpus=all package:target
I was not able to find docker arguments in the container_image
rules.
Is there a better way?
I would like to encode docker arguments like --gpus=all
in the container_image
configuration.