I created an image using java_image but I would like to pass arguments to my main function (i.e. String args[]). How can I do that when I use "bazel run name_of_image" command?
bazel run //your:rule -- arg1 arg2 ... argN
Everything after --
is passed to the binary.
When using java_image
, bazel run //my_image
will only load the image into the Docker daemon, it won't run it. To run it, you should use:
docker run bazel/my_image:my_image [args]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With