Suppose I have a/Dockerfile:
FROM debian
RUN date > /hello
and b/Dockerfile:
FROM pxeger/a
RUN date >> /hello
and docker-bake.json:
{
"group": {
"default": {
"targets": ["a", "b"]
}
},
"target": {
"a": {
"context": "a/",
"tags": ["pxeger/a:latest"]
}
"b": {
"context": "b/",
"tags": ["pxeger/b:latest"]
}
}
}
Right now, if I run docker buildx bake, the image pxeger/a will be pulled from the registry before either image is built, even though the build process will produce an a. This means:
- needless extra pulls are made
- the final resulting containers cannot share all the layers of
a, because b was built upon the old version of a
- if
a does not exist on the registry, the build will fail
There seems to be no workaround for this. Even if bake doesn't want to include a Dockerfile parser and dependency resolution algorithm, it would be good to at least be able to manually force a dependency build order. (changing the order of group.default.targets doesn't work).
Of course this somewhat reduces the possible parallelism because a and b can't be built at the same time now.
Suppose I have
a/Dockerfile:and
b/Dockerfile:and
docker-bake.json:{ "group": { "default": { "targets": ["a", "b"] } }, "target": { "a": { "context": "a/", "tags": ["pxeger/a:latest"] } "b": { "context": "b/", "tags": ["pxeger/b:latest"] } } }Right now, if I run
docker buildx bake, the imagepxeger/awill be pulled from the registry before either image is built, even though the build process will produce ana. This means:a, becausebwas built upon the old version ofaadoes not exist on the registry, the build will failThere seems to be no workaround for this. Even if bake doesn't want to include a Dockerfile parser and dependency resolution algorithm, it would be good to at least be able to manually force a dependency build order. (changing the order of
group.default.targetsdoesn't work).Of course this somewhat reduces the possible parallelism because
aandbcan't be built at the same time now.