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

Add alpine build #236

Merged
merged 1 commit into from
Aug 14, 2023
Merged

Add alpine build #236

merged 1 commit into from
Aug 14, 2023

Conversation

jprendes
Copy link
Collaborator

@jprendes jprendes commented Aug 7, 2023

This PR adds support for building alpine binaries.

The main changes:

  • Add a build argument to the Dockerfile to specify the base image.
  • Update the bake file to account for the new argument
  • Move some of the logic from the Dockerfile to a shell script that handles the different base images.
  • The name of the tar archives now end with -gnuor -musl (for debian and alpine respectively).
  • Bumped wasmedge-sdk to 0.11.2 (required for building with alpine Add options to allow generating statically linked binaries WasmEdge/wasmedge-rust-sdk#48).
  • Add a feature to vendor the dbus crate (so that it links statically)

Result:

$ docker buildx bake bins-cross tar-cross
# ... 4 parallel builds, go get a coffee ...

$ ls bin
alpine-amd64  alpine-arm64  bullseye-amd64  bullseye-arm64

$ ls bin/alpine-amd64/
containerd-shim-wasmedged-v1  containerd-shim-wasmtimed-v1  containerd-wasmedged
containerd-shim-wasmedge-v1   containerd-shim-wasmtime-v1   containerd-wasmtimed
# same output for bin/alpine-arm64, bin/bullseye-amd64, and bin/bullseye-arm64

$ ls release/
containerd-shim-wasmedge-linux-amd64-gnu.tar.gz   containerd-shim-wasmtime-linux-amd64-gnu.tar.gz
containerd-shim-wasmedge-linux-amd64-musl.tar.gz  containerd-shim-wasmtime-linux-amd64-musl.tar.gz
containerd-shim-wasmedge-linux-arm64-gnu.tar.gz   containerd-shim-wasmtime-linux-arm64-gnu.tar.gz
containerd-shim-wasmedge-linux-arm64-musl.tar.gz  containerd-shim-wasmtime-linux-arm64-musl.tar.gz

$ ldd bin/alpine-amd64/containerd-shim-wasmedge-v1 
        statically linked

$ ldd bin/bullseye-amd64/containerd-shim-wasmedge-v1 
        linux-vdso.so.1 (0x00007ffe1e1b8000)
        librt.so.1 => /usr/lib/librt.so.1 (0x00007f33f077d000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f33f0778000)
        # ... and more ...

@jprendes jprendes marked this pull request as ready for review August 7, 2023 22:34
@jprendes jprendes requested review from cpuguy83, Mossaka and utam0k August 7, 2023 22:37
@jprendes jprendes force-pushed the alpine-build branch 2 times, most recently from aaa2f15 to 971ab68 Compare August 9, 2023 08:40
Copy link
Contributor

@jsturtevant jsturtevant left a comment

Choose a reason for hiding this comment

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

LGTM, though I not really familiar with these tools. left a few non-blocking comments

crates/containerd-shim-wasmedge/Cargo.toml Show resolved Hide resolved
rust-toolchain.toml Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Copy link
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!

@Mossaka
Copy link
Member

Mossaka commented Aug 14, 2023

Thanks for contributing!! I am going to merge and can do a release tomorrow.

@Mossaka Mossaka merged commit 74248dd into containerd:main Aug 14, 2023
@jprendes jprendes deleted the alpine-build branch August 18, 2023 13:45
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.

3 participants