Uh oh!
There was an error while loading. Please reload this page.
feat(core): add buildargs to DockerImage - #614
Conversation
Hi @black-snow, if I can offer some assistance, it looks like the number of steps just changed I take the blame for the original test it was way too hardcoded (also notice the logs enumeration, that will be the next issue imo) : assertlogs[0] == {"stream": "Step 1/2 : FROM alpine:latest"}
assertlogs[3] == {"stream": f'Step 2/2 : CMD echo "{random_string} |
alexanderankin
commented
Jun 23, 2024
there are conflicts, i would like for the tests to be clarified as well, etc. |
black-snow
commented
Jun 23, 2024
Thanks, I'll take a look tonight. Will be an easy fix and I think I'll pull it out into a separate test. What I was thinking about: Would it make sense just to pass the kwargs down to docker-py? I'd favour keywords over kwargs every time but it's basically a wrapper around docker-py, so it might make sense to do so. Not sure about this. On the other hand - most of the args aren't likely to change. It wouldn't be too hard to duplicate and document them. |
2 notes if I may
|
black-snow
commented
Jun 27, 2024
@Tranquility2 ofc, feedback is always welcome!
|
Hi @black-snow just wanted to update I found a bug in the withDockerImage(path=dir, tag="test", buildargs={"MY_ARG": "some_arg"}) asimage:if you still want to add this as a more direct flag I'm in favor, notice it now has a sperate test as you originally suggested 😄 |
black-snow
commented
Oct 1, 2024
Thanks for the heads-up and the fix @Tranquility2! I'll abandon this PR. When kwargs get passed down correctly + I get a hint in the docstring (of the constructor) I'm totally happy with not having a separate kwarg :) |
My plan is to add withDockerImage().with_build_arg(key, val) asimage:Something like we have in the Container :) defwith_build_arg(self, key: str, value: str) ->Self:
self._build_args[key] =valuereturnselfHinting is also a track I'm working on and will definitely be added as well as part of the track. see for example: #691#692#700#702 |
I'm fine with a builder-style construct :) Type hinting? Excellent. I was rather relating to having "kwargs will get passed throught to the underlying docker-py" right in the docstring of |
Tranquility2
commented
Oct 2, 2024
Sounds good, I'll update. |

Adds
--build-argequivalent as mentioned in #610I don't get the tests to pass so this is actually untested!
Also, I'd rather move it into a separate, well-named test instead of stuffing everything in there but I didn't want to refactor so much. I'll perhaps refactor in another PR.