containers / toolbox

Tool for interactive command line environments on Linux
https://containertoolbx.org/
Apache License 2.0
2.59k stars 220 forks source link

Consider adding apk based Image like Wolfi or Alpine #1474

Open lduktus opened 8 months ago

lduktus commented 8 months ago

Both seem to be common choices for containers and currently there is no official image, that uses apk as package manager. Of course this can be done using distrobox, but having a more officially supported image would make sense (if it is doable and maintainable).

debarshiray commented 8 months ago

The toolbox(1) binary has very unusual ABI constraints and requirements because the same binary from the host is bind mounted into the container as its entry point. This pushes the boundary of what's considered expected and supported by the GNU/Linux runtime, and the GNU C and Google Go tool-chains. I am still working with the GNU tool-chain folks to make this a better supported use-case.

See this blog post for the details.

Given that Alpine doesn't use the GNU C Library, I am apprehensive of adding support for a different implementation of a critical piece of the puzzle. Note that the dynamic linker is part of glibc and has a private interface with libc.so that affects the early start-up of a process.

debarshiray commented 8 months ago

I didn't know about Wolfi before you mentioned it.

I see that it uses the GNU C Library, so that removes the problem mentioned above. Toolbx images tend to be more featureful and bigger, because the containers are meant to be long-lasting interactive CLI environments instead of being ephemeral deployments of server-side applications and services. I wonder if that will conflict with Wolfi's goal of being stripped down. What do you think?

I see that there's no concept of a Wolfi host, which simplifies our test matrix.

Do you know any Wolfi developer who is interested in maintaining the image and drive changes into Wolfi, if needed? Are you interested? :)

See this blog post for some context on adding support for new distributions.

lduktus commented 7 months ago

While I would love to contribute, this may be above my skill level. I also don't know anybody at the Wolfi Project. But there is a Wolfi toolbox by the Universal Blue community, however it only seems to work with distrobox. I've already opened an issue there:

https://github.com/ublue-os/toolboxes/issues/71#issue-2203970214

However, the scope of the project is slightly different and I think having an official apk based Distro with GNU C support would be a nice option. I am not sure if there is necessarily a conflict between providing a long-lasting CLI environment and the stripped down approach by Wolfi. Imho this strongly depends on the use case and required packages. But as it is not a classical distro certain things may not work, which I think is fine.

Thank you for the links and explanation. This is very helpful, when I find the time I will definitely see whether I can build a working container.

debarshiray commented 7 months ago

Oh, I totally forgot that we do have an alpine-toolbox image in the staging repository at github.com/toolbx-images/images, and it does work. :)

Would you be interested in helping maintain that? I think @siosm will appreciate the help. We can try to reach out to the musl folks to see what they think about how we set up the toolbox(1) binary.

debarshiray commented 7 months ago

While I would love to contribute, this may be above my skill level.

Not one of us really knows what they are doing. :)

I also don't know anybody at the Wolfi Project. But there is a Wolfi toolbox by the Universal Blue community, however it only seems to work with distrobox. I've already opened an issue there:

ublue-os/toolboxes#71 (comment)

Cool.

However, the scope of the project is slightly different and I think having an official apk based Distro with GNU C support would be a nice option. I am not sure if there is necessarily a conflict between providing a long-lasting CLI environment and the stripped down approach by Wolfi. Imho this strongly depends on the use case and required packages. But as it is not a classical distro certain things may not work, which I think is fine.

It will be good to have a list of things that are preventing a working Wolfi container. Then we can see what we can do about those.

lduktus commented 5 months ago

Sorry for answering late, I had a lot of work last weeks: I will try to test it in the coming days. Maybe I can at least provide a list of things that block Wolfi.

castrojo commented 5 months ago

I wish I would have seen this issue earlier! I helped maintain the alpine images in the toolbx-images repo, I'd love to help out as it'd likely be a copy, search and replace. I'll work on this!

cc @EyeCantCU

lduktus commented 5 months ago

I had some spare time yesterday and managed to get Wolfi working, but now I see it is already merged into toolbx-images. Nice :)

Btw the setup is relatively easy, however I didn't tested a lot.