Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building large image failed when sending tarball #5902

Open
4 tasks done
C2H5OHlife opened this issue Apr 10, 2025 · 1 comment
Open
4 tasks done

Building large image failed when sending tarball #5902

C2H5OHlife opened this issue Apr 10, 2025 · 1 comment

Comments

@C2H5OHlife
Copy link

C2H5OHlife commented Apr 10, 2025

Contributing guidelines and issue reporting guide

Well-formed report checklist

  • I have found a bug that the documentation does not mention anything about my problem
  • I have found a bug that there are no open or closed issues that are related to my problem
  • I have provided version/information about my environment and done my best to provide a reproducer

Description of bug

Bug description

I'm building image with buildkit and nerdctl, and everything was ok before. But when I tried to build an image with large size( > 12G), the building progress always got interrupted when it's "sending tarball".

Reproduction

  1. Run buildkit in container with nerdctl:
nerdctl run --network host -d --name mybuilder \
    -v cgroup:/sys/fs/cgroup:ro \
    -v /var/lib/buildkit:/var/lib/buildkit \
    -v /var/lib/containerd:/var/lib/containerd \
    -v /run/containerd/containerd.sock:/run/containerd/containerd.sock \
    -v /etc/buildkitd.toml:/etc/buildkit/buildkitd.toml \
    -v /run/buildkit:/run/buildkit \
    --privileged --dns-opt attempts:3 moby/buildkit:v0.20.1 --allow-insecure-entitlement network.host --allow-insecure-entitlement=network.host --config /etc/buildkit/buildkitd.toml;
  1. Build image with nerdctl or buildctl
nerdctl builder build --debug --platform="amd64" --build-arg xxxx --pull -t "<image name>:test" -f "/path/to/Dockerfile" "/tmp/tmp.9jjKHTO6F2"

or

buildctl --addr=unix:///run/buildkit/buildkitd.sock build --progress=auto --frontend=dockerfile.v0 --local=context=/tmp/tmp.9jjKHTO6F2 --output=type=docker,name=<image name>:test --local=dockerfile=/path/to/dockerfile --opt=filename=Dockerfile --opt=image-resolve-mode=pull | nerdctl load
  1. Get output

client:

# with nerdctl
 => exporting to docker image format                                                                                                                          535.7s
 => => exporting layers                                                                                                                                       402.7s
 => => exporting manifest sha256:1af34501835daf7da7eaaa1c41b0afa5fb11feac00628fca13120b9785985eca                                                               0.0s
 => => exporting config sha256:21f8adb8cefc647fc3b6fb51eee0d76bb21d676525262732fe8e5a1d61f1a4a6                                                                 0.0s
 => => sending tarball                                                                                                                                        133.0s
FATA[0737] no image was built

# with buildctl and nerdctl
 => => sending tarball                                                                                                                                        127.9s
FATA[0728] failed to ingest "blobs/sha256/678b6ad0fcd2f959239cff5b58533a5556fe989bac08e6a8e08a40258c7503ec": failed to read expected number of bytes: unexpected EOF

buildkitd container logs:

time="2025-04-09T09:05:37Z" level=error msg="/moby.buildkit.v1.Control/Solve returned error: rpc error: code = Canceled desc = failed to copy to tar: rpc error: code = Canceled desc = context canceled" spanID=4ffe8aba86860a15 traceID=9e7fe6d9e338ada0f88ceb75b1528085

Version information

nerdctl version
Client:
Version: v2.0.0
OS/Arch: linux/amd64
Git commit: https://github.com/containerd/nerdctl/commit/ef588dafa080e3dbc9c061ff3802affb66aef291
buildctl:
Version: v0.20.2
GitCommit: 97437fdd7e32f29bb80288d800cd4ffcb34e1c15

Server:
containerd:
Version: 1.6.21
GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc:
Version: 1.1.7
GitCommit: v1.1.7-0-g860f061
buildctl --version
buildctl http://github.com/moby/buildkit v0.20.2 97437fdd7e32f29bb80288d800cd4ffcb34e1c15

Buildkit: tried moby/buildkit:v0.20.1 and moby/buildkit:v0.17.0

@jsternberg
Copy link
Collaborator

Are you using the containerd backend? It might be useful to upgrade containerd too if you are. I think 1.6 is fairly old.

The failed to ingest message seems to be coming from containerd when it's trying to import the exported tarball.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants