-
I have a Dockerfile that defines multiple targets that i can build. so I created a docker-bake.hcl:
imagine the Dockerfile looks something like this:
This works like a charm. Though I'm struggling to override the IMAGES from the commandline
results in:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I've actually noticed that the whole handling of the IMAGES variable is going wrong. If you add a another target that uses that IMAGES as a matrix e.g.:
when you now try to build the |
Beta Was this translation helpful? Give feedback.
Did some further fiddling and I found a solution.
First of all the second was not really a problem, you need to make sure the 'name' is unique (not only in your target but in your whole hcl file) so i just appended an identifier:
name = "{tgt}-prod-env"
and that worked like a charm.
Passing in the IMAGES as an array did not work. Somehow coercing an environment variable to an array never worked, so I took another approach where i pass in the IMAGES as a string and then parse them in the hcl itself: