Closed Enteee closed 6 years ago
I was looking at the code lase week end and from my understandning this should work. Therefore I do assume this is a bug? Maybe related to how a image with with a default task is registered in the context.
digging deeper.. :pick:
I think I've identified the problem. It seems to be an issue with tracking which dependencies were modified in the context. Debugging why that is failing now.
Ah, the problem is that the dependency name taht is saved is a full task name (image/A:build
), but the check for modified deps is using the short name image/A
.
A workaround (using the excellent example you provided) would be to set the depends
to image/A:build
, which then properly rebuilds things. I'll look into a proper fix, which I think would be to make sure it's always using fully expanded task names.
Yay, awesome!
While thinking about this I discovered a possible loophole:
what happens if you have three images, A
, B
, C
with B
and C
both depend on A
.
if you now:
B
&& build C
A
B
(this should now build A
then B
)C
I think 4 won't do anything, wherease it maybe should. But I'll test your changes and maybe come back with a new feature request. This seems to be a bigger task, since dobi probably has to persist information about dependencies to get this solved.
Ah yes, that is probably true. I think that could be fixed by comparing the imageID of the parent image at build time against the current imageID of the tag in the first FROM
. The parent imageID at build time may need to be stored in he image record as well.
At some point I'd like to try and use buildkit directly, which I hope would provide more information about the image directly.
dobi version 0.11.1 (build: ee9138c, date: Sun Jun 24 19:40:44 UTC 2018)
When building an image on top of another one,
dobi
does not rebuild the child once the parent changes. with parent: all the images listed as dependencies.dobi.yaml
:A/Dockerfile
:A/a
:B/Dockerfile
:When I run
dobi image/B
, this first buildsimage/A
thenimage/B
on top of the just builta
.If then something in
A
changes, I get the folliwng unexpected behaviour:Instead of
[image:build image/B] b is fresh
I would expect dobi to re buildimage/B
.