Repository navigation
Conversation
2d18366 to
01db27a
Compare
|
I need to work through this later, but I'm unclear how the current code works on non-Windows. How do those platforms distinguish a tar file from log output on stdout? They shouldn't be passing through a termInal on the way, the terminal is where nerdctl's stdio is connected, so I don't understand what's different on Windows. |
|
Hey @TBBle |
|
Still investigating the issue. This is a temp fix and the PR is WIP (may and may not be the final solution).
|
|
Deeply confused about this.
This does not make any sense. Now suspecting buildctl might be the problem. |
|
buildctl "output" goes to stderr. Is it the case on windows?
or
|
01db27a to
1e7bbf4
Compare
1e7bbf4 to
80dc420
Compare
| output = "type=docker" | ||
| // https://github.com/moby/buildkit?tab=readme-ov-file#output | ||
| // type=image is the native type for containerd | ||
| output = "type=image" |
There was a problem hiding this comment.
Default to type=image instead of type=docker. See #3604 (comment)
cc @profnandaa
| if r.N == 0 { | ||
| // Avoid confusing "unrecognized image format" | ||
| return errors.New("no image was built") | ||
| return fmt.Errorf("no image was built: %w", err) |
There was a problem hiding this comment.
Make the error more descriptive by adding the actual error
14392ff to
f4728b4
Compare
Does this introduce a requirement that buildkit is configured to use the containerd worker? Or is that already a requirement for using |
| Expected: test.Expects(0, nil, test.Equals("nerdctl-build-test-string\n")), | ||
| }, | ||
| { | ||
| Description: "Successfully build with output docker, name cannot be used", |
There was a problem hiding this comment.
@apostasie I've removed this test for now. I may be missing something. What is this testing?
There was a problem hiding this comment.
Missed this ^, sorry.
I believe this test does confirm that when you build with no output, you then cannot use the image.
There was a problem hiding this comment.
I do too find the description hard to grok.
@TBBle In Windows, containerd-worker is the default. There is ongoing work to support oci-worker on Windows. On Linux environments, [oci-worker is the default].(https://github.com/moby/buildkit/blob/5cd5a63de5d37512c24f20085607509b749df762/README.md#linux-setup) Additionally, with the shift from docker to containerd, we then should switch to using References:
@AkihiroSuda @jsturtevant What do you think? |
|
The OCI worker still has to be supported |
|
Using OCI-Worker on Linux (Ubuntu 22.04.5 LTS):
|
- Use default image name only when user has not specified one Signed-off-by: Christine Murimi <[email protected]>
6811330 to
dec2718
Compare
PR Description
Linked Issue: containerd/nerdctl#3629
This PR resolves #3629 for
nerdctl buildcommand when passed with:--progress auto,--progress tty, or--progressflag is not specified (which then defaults to--progress auto)--outputflag is not specifiedExample:
nerdctl build -t <TAG> --file .\Dockerfile .Background
The issue occurs because the build progress output and the tarball are both sent to stdout on WIndows.
Solution
nerdctl/pkg/cmd/builder/build.go
Line 216 in 0d7dc8e
When a user does not specify the
--outputflag, we default it to usetype=imageinstead oftype=dockerbecause the image is actually uploaded to containerd image store. According to buildctl documentation,type=imageis the native type for containerd.Additional tasks
Not included in this PR
type=ocinerdctl/pkg/cmd/builder/build.go
Line 220 in 0d7dc8e
type=dockerCurrenly fails with
archive/tar: invalid tar headermoby/buildkit/issues/5528References