bitter-ability-32190
07/27/2022, 2:21 PM./pants run <docker_img>
?
I've tried `--docker-env-vars="MYVAR"`:
MYVAR=1 ./pants --docker-env-vars="MYVAR" run <docker>
, but the pex_binary
which is run is no dice. I suspect maybe docker.run_args
?bitter-ability-32190
07/27/2022, 2:24 PM-e
on docker.run_args
should do it, but I get
"docker run" requires at least 1 argument.
🤔
I'm using --docker-run-args="-e"
so it should be _append_ing a valuebitter-ability-32190
07/27/2022, 2:25 PM-e
and then the name 🤦♂️bitter-ability-32190
07/27/2022, 2:27 PMrun_args
on a docker_image
target would be nicebitter-ability-32190
07/27/2022, 2:27 PMbitter-ability-32190
07/27/2022, 2:28 PMclean-alligator-41449
09/19/2023, 8:45 AMbitter-ability-32190
09/19/2023, 11:12 AMclean-alligator-41449
09/19/2023, 1:16 PMPut another way, the first makes sure the variable is in the sandbox, the second is telling docker to use it
But the variable does not have to be in the sandbox, for docker to pick it up when doing pants run
on a docker image target.
I guess it's not obvious to me why a pants run on a docker image (which leads to a docker run
command, does not count as an invocation. According to the docs Environment variables to set for docker invocations.
I have what I need now, but I would humbly suggest that maybe the documentation could have been clarified.bitter-ability-32190
09/19/2023, 1:17 PMclean-alligator-41449
09/19/2023, 1:18 PMbitter-ability-32190
09/19/2023, 1:19 PM