brave-hair-402
02/19/2023, 6:49 PMbroad-processor-92400
02/19/2023, 9:44 PMdist/
when running ./pants package path/to:docker_image
, or when using as a dependency).
So, some options:
1. use a dev release like 2.16.0.dev7
, but this will likely make life a bit trickier (e.g. the docs are only published for stable (2.14 and before) and beta versions (2.15))
2. parse the output of pants (I've heard some people doing this)
3. export the images to well-known/hard-coded tags, like some_repo:latest
and then retag them outside brave-hair-402
02/19/2023, 10:04 PMbroad-processor-92400
02/19/2023, 10:11 PMwhen you say "parsing the output of Pants," which files/output would I parse?Ah, yeah, when you run
./pants package ...
with a docker image target, pants will print something like the following to stderr:
09:06:41.16 [INFO] Built docker image: host/repo:tag
Docker image ID: sha256:0123456789abcdef
And so a CI script could use grep/sed etc. to extract the relveant information (or save it to a file and have the CDK app parse it in a real programming language)
What do you mean by "retag them outside paths"?Ah, typo, sorry: I mean "outside _pants_". That is, if pants tags with a hard-coded tag, run
docker tag some_repo:latest $COMPUTED_TAG
and then docker push $COMPUTED_TAG
, where $COMPUTED_TAG
is fed into CDK too (or some other way of retagging with the "real" tag).brave-hair-402
02/19/2023, 10:19 PM