acoustic-library-86413
09/02/2023, 8:44 PMdocker_image(
name="my-service",
registries=["@my_registry"],
image_tags=["{build_args.EXPECTED_TAG}"]
)
When I build this image locally I would prefer to fallback to latest
, e.g. only type pants package /path/to/service/Dockerfile
but in CI I might provide it as EXPECTED_TAG=1.0.2 pants package /path/to/service/Dockerfile
. I've tried setting it in the docker_env_vars, but subsequently exposing it in the shell does not seem to have precedence over this. If I don't provide the EXPECTED_TAG the build errors out about missing variables.refined-addition-53644
09/02/2023, 9:10 PM.pants.rc
https://www.pantsbuild.org/docs/options#pantsrc-filecurved-television-6568
09/02/2023, 9:21 PMDockerfile
that way you have a very low prio default value that pants will replace with anything else you provide.acoustic-library-86413
09/03/2023, 8:44 AM.pants.rc
. I'm not sure it fits the bill here since it can't be overridden using a command line env-var, but it could have other uses, so I appreciate the suggestion. I think you're right @curved-television-6568. This does serve as a nice fallback that can be easily overridden on the command line!