pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.33k stars 638 forks source link

Support for `docker run` arguments in `docker_environment` #18994

Open generalov opened 1 year ago

generalov commented 1 year ago

Is your feature request related to a problem? Please describe. I'd like to specify additional docker run arguments for a docker_environment.

Describe the solution you'd like

docker_environment(
  ...,
  docker_run_args = ["--add-host pypi.myorg.com:10.0.1.11"]
)

Describe alternatives you've considered Alternatively, docker_environment could inherit the docker run arguments from [docker].run_args in pants.toml.

Additional context Probably, there should be another tool for spawning complex environments like docker compose or devcontainers.

zimtkeks commented 1 year ago

This feature would also be very valuable for my department. We are behind a corporate proxy that is accessible via cntlm at localhost of internal hosts. We would pass --network host as extra argument to docker run (and docker build, for docker_image targets) to enable internet access.

There may be other means to solve that particular problem but passing additional docker run/build args has most likely plenty of other uses.