For what it’s worth the error WARNING: buildx: git was not found in the system. Current commit information was not captured by the build
seems to be intentional and might possibly be resolved as part of these changes Git warning being displayed when building in a git directory with no commits yet · Issue #1587 · docker/buildx · GitHub. Nevertheless I have determined that simply adding --load
to my build command enabled the pipeline to complete as intended without any other further changes based on the latest docker:dind
image (where buildx is the default builder for linux). i.e. The following results in a single image file with 2 tags.
docker build -f docker/Dockerfile -t $REPO:$MYTAG1 -t $REPO:MYTAG2 --load .
docker push --all-tags $MYIMAGE
An alternative would look slightly different but is more geared towards multi-arch builds since it will results in the creation of multiple artifacts i.e. The following results in 3 artifacts; 2 images and an image index.
docker build -f docker/Dockerfile -t $REPO:$MYTAG1 -t $REPO:MYTAG2 --push .
In both cases the afrementioned warning is still displayed but seems to be harmless - at least in my case.