As the title suggests, starting today we’ve been experiencing issues with successfully running the build job in our pipeline. This issue is reproduced even when no changes were done to the repository and even on old jobs that actually succeeded before (e.g. a job from 2 months ago).
The error we are facing is the following:
#36 DONE 156.8s
#37 preparing layers for inline cache
WARNING: buildx: git was not found in the system. Current commit information was not captured by the build
ERROR: failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 1
So from what we could piece together as well as test, the issue seems to be related to the runner itself rather than the docker image we are building, but we are kind of stuck here.
Does anyone have any ideas what the problem could be?
as stated above, it’s probably due to the recent update of the docker latest image which contains some pretty significant changes under the hood Docker Engine 23.0 release notes | Docker Documentation . The best quick fix at the moment is to pin to an older version such as 20.10 (in my case following the same error). I’ll follow up when I’ve figured out how to make the new version work.
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.
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.
In our case, the warning & subsequent error prevented us from actually being able to build our image. While this was fixed with the solution provided by @gkinsman, I will also try yours as well and come back with what I found.
I fixed my gitlab build issue preparing layers for inline cache followed by unexpected EOF by using previous docker image docker:20.10.22-dind instead of docker:dind. Thanks for the tip to look at previous docker image!
FYI the error comes from docker 23.0.0.
In my case our runner set up with docker machine installed this version of docker by default.
The solution was to remove builkit_inline_cache=1
But the GitHub issue related seems to be closed. So it has to be fixed.
I have to check that
Running a docker build with gitlab-ci. Works well locally, but we are moving runners to AWS on ubuntu 20 and it appears that DNS is not working in the containers. Any ideas greatly appreciated, perhas Is there a way to statically set the git repo DNS address globally in the config, not finding any variables for this in the doc.
I have simply updated my image build job with this line as a quick fix for now until the upstream docker image is either working better or there is a more standard documented way of doing builds going forward.