Closed leocencetti closed 1 week ago
Thanks for reporting, looking at your workflow:
runs-on:
- self-hosted
- linux
- ARM64
container:
image: ghcr.io/leocencetti/docker:latest
options: --privileged
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
volumes:
- /var/lib/docker:/var/lib/docker
- /var/cache/github-runner:/tmp/cache/
This does not look like a common setup :sweat_smile:
What is the ghcr.io/leocencetti/docker:latest
image? Seems to be a private package, would you mind sharing it if possible?
Also not sure what kind of runner you're using looking at self-hosted
, linux
, ARM64
but seems like these are self-hosted runners. Can you share the full workflow logs to help use figure out what's going on? And also enable debug for BuildKit to have containers logs: https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-container-logs.
What is the ghcr.io/leocencetti/docker:latest image? Seems to be a private package, would you mind sharing it if possible?
This is roughly equivalent to this dockerfile, I am just using ubuntu:22.04
as the base image instead of alpine
(with the required package manager adaptations).
Also not sure what kind of runner you're using looking at self-hosted, linux, ARM64 but seems like these are self-hosted runners
Yes, I am using a docker-in-docker (DIND) workflow on a self-hosted ARM64 runner (NVIDIA).
Can you share the full workflow logs to help use figure out what's going on?
Yes. I've collected the logs from relevant jobs in the workflow. I have omitted the docker build logs as they contain private info (and are probably unrelated). logs.zip
On a side note, the image I am building is on the larger side (some GB), and the full workflow logs are quite verbose (5k+ lines). I noticed that the logs are fetched by the action to produce the summary, so I am wondering if their size could be the issue. I don't seem to have this problem when building smaller (and less verbose) images using the same setup.
Yes. I've collected the logs from relevant jobs in the workflow. I have omitted the docker build logs as they contain private info (and are probably unrelated). logs.zip
Thanks! Looking at the logs it seems you're using an old version of buildx:
2024-06-19T11:49:15.0952010Z [command]/usr/local/bin/docker buildx version
2024-06-19T11:49:15.1712504Z github.com/docker/buildx v0.11.2 9872040b6626fb7d87ef7296fd5b832e8cc2ad17
That doesn't support dial-stdio
command introduced in Buildx 0.13.0: https://github.com/docker/buildx/releases/tag/v0.13.0
Can you make this change in your workflow to use latest stable and see if it fixes the issue on your side?:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
buildkitd-flags: --debug
I will try to repro on my side with older version.
Edit: Was able to repro:
Opened https://github.com/docker/build-push-action/pull/1145 to mitigate the issue. You can test with:
- name: Build and push image
uses: crazy-max/docker-build-push-action@summary-check
@crazy-max I tried this morning to run the CI workflow with the latest buildx
(v0.15.1) and I still get a failure (not the same one though):
docker buildx --builder builder-3e2fdd69-2ba2-4478-b367-2501d8cef169 dial-stdio
docker run --rm -i -v /github/home/.docker/buildx/refs:/buildx-refs -v /__w/_temp/docker-actions-toolkit-0j650g/export:/out docker.io/dockereng/export-build:latest --ref-state-dir=/buildx-refs --node=builder-3e2fdd69-2ba2-4478-b367-2501d8cef169/builder-3e2fdd69-2ba2-4478-b367-2501d8cef1690 --ref=b5ap7n4x5arkdbv617hvgbprg --uid=0 --gid=0
2024/06/20 06:42:45 failed to fill local state: failed to stat local ref directory /buildx-refs/builder-3e2fdd69-2ba2-4478-b367-2501d8cef169/builder-3e2fdd69-2ba2-4478-b367-2501d8cef1690: stat /buildx-refs/builder-3e2fdd69-2ba2-4478-b367-2501d8cef169/builder-3e2fdd69-2ba2-4478-b367-2501d8cef1690/: no such file or directory
Warning: Failed to export build record: /__w/_temp/docker-actions-toolkit-0j650g/export/rec.dockerbuild not found
Note, I am not using your latest fix yet, although I doubt it will help here (buildx
version is fine)...
Full logs: logs.zip
and I still get a failure (not the same one though):
docker buildx --builder builder-3e2fdd69-2ba2-4478-b367-2501d8cef169 dial-stdio docker run --rm -i -v /github/home/.docker/buildx/refs:/buildx-refs -v /__w/_temp/docker-actions-toolkit-0j650g/export:/out docker.io/dockereng/export-build:latest --ref-state-dir=/buildx-refs --node=builder-3e2fdd69-2ba2-4478-b367-2501d8cef169/builder-3e2fdd69-2ba2-4478-b367-2501d8cef1690 --ref=b5ap7n4x5arkdbv617hvgbprg --uid=0 --gid=0 2024/06/20 06:42:45 failed to fill local state: failed to stat local ref directory /buildx-refs/builder-3e2fdd69-2ba2-4478-b367-2501d8cef169/builder-3e2fdd69-2ba2-4478-b367-2501d8cef1690: stat /buildx-refs/builder-3e2fdd69-2ba2-4478-b367-2501d8cef169/builder-3e2fdd69-2ba2-4478-b367-2501d8cef1690/: no such file or directory Warning: Failed to export build record: /__w/_temp/docker-actions-toolkit-0j650g/export/rec.dockerbuild not found
Temp folder /__w/_temp
looks odd compared to what we have on GitHub public runners /home/runner/work/_temp
: https://github.com/docker/build-push-action/actions/runs/9585155679/job/26430413150#step:6:7 but don't think that's the issue. I wonder if volumes mount are just broken with your current setup when using your DinD image. Maybe we should rely on docker cp
instead of volumes :thinking:. I also see that the local ref cannot be found with /github/home/.docker/buildx/refs:/buildx-refs
.
Can you add these extra steps after - name: Build and push image
and give the logs?:
- name: Check docker config
run: |
tree -punahig /github/home/.docker
- name: Dump context
uses: crazy-max/ghaction-dump-context@v2
Contributing guidelines
I've found a bug, and:
Description
The generation of the build summary in the post-build job (added by https://github.com/docker/build-push-action/releases/tag/v6.0.0) fails
Expected behaviour
Generation should succeed
Actual behaviour
The post-build job fails unexpectedly with the following error:
The error can be reproduced when rerunning the workflow
Repository URL
No response
Workflow run URL
No response
YAML workflow
Workflow logs
BuildKit logs
No response
Additional info
No response