Skip to content

Build test image without docker.#41

Merged
cpuguy83 merged 1 commit intocontainerd:mainfrom
cpuguy83:oci-tar-builder
Jan 3, 2023
Merged

Build test image without docker.#41
cpuguy83 merged 1 commit intocontainerd:mainfrom
cpuguy83:oci-tar-builder

Conversation

@cpuguy83
Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 commented Dec 14, 2022

This manually assembles the tar instead of requring buildkit/buildx/docker to create it.

Instead of using buildx to stick our single binary into a container image we can build the tar ourself.
This should work on Windows (not tested...) or Linux and only depends on cargo to build.

Closes #36

@cpuguy83 cpuguy83 requested review from Mossaka and devigned December 14, 2022 21:48
@cpuguy83
Copy link
Copy Markdown
Member Author

@jsturtevant for testing on Windows.

Copy link
Copy Markdown
Member

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Comment thread crates/wasi-demo-app/build.rs Outdated
@jsturtevant
Copy link
Copy Markdown
Contributor

jsturtevant commented Dec 19, 2022

@jsturtevant for testing on Windows.

the sample program and image file build run on windows. When I tried loading it into containerd I got the follow error:

 .\ctr.exe image import --all-platforms ..\..\runwasi\target\wasm32-wasi\debug\img.tar
unpacking ghcr.io/containerd/runwasi/wasi-demo-app:latest (sha256:01f42703daa223ec938b719aac05b09812f0e6b5ca8c5a69f73ef55546e4b881)...time="2022-12-19T09:11:41-08:00" level=info msg="apply failure, attempting cleanup"
 error="failed to extract layer sha256:8e73cf52c941fc918688f08efb674b55883a7a1b8ac36b7069af83557c7f3313: hcsshim::ProcessBaseLayer \\\\?\\C:\\ProgramData\\containerd\\root\\io.containerd.snapshotter.v1.windows\\snapshots\\1217: The system cannot find the path specified.: unknown" 
key="extract-614379200-CtdF sha256:8e73cf52c941fc918688f08efb674b55883a7a1b8ac36b7069af83557c7f3313"

ctr: failed to extract layer sha256:8e73cf52c941fc918688f08efb674b55883a7a1b8ac36b7069af83557c7f3313: hcsshim::ProcessBaseLayer \\?\C:\ProgramData\containerd\root\io.containerd.snapshotter.v1.windows\snapshots\1217: The system cannot find the path specified.: unknown

I don't think this is an issue with this PR per say. I am sort of guessing but might be related to the fact that Windows doesn't have a "baselayer" or doesn't know how handle the image layer produced. I'll have to dig in deeper to figure it out.

I don't think we should hold this up for Windows support as there is quite a bit work to do there anyways.

@cpuguy83 cpuguy83 force-pushed the oci-tar-builder branch 2 times, most recently from cd14260 to 914bb41 Compare December 19, 2022 21:46
This manually assembles the tar instead of requring
buildkit/buildx/docker to create it.

Instead of using buildx to stick our single binary into a container
image we can build the tar ourself.
This should work on Windows (not tested...) or Linux and only depends on
cargo to build.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@cpuguy83 cpuguy83 merged commit 0808503 into containerd:main Jan 3, 2023
@cpuguy83 cpuguy83 deleted the oci-tar-builder branch January 3, 2023 19:52
@jsturtevant jsturtevant mentioned this pull request Jan 9, 2023
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants