Kron4ek / Conty

Easy to use unprivileged Linux container packed into a single portable executable
MIT License
729 stars 41 forks source link

POSIX-Compliance #178

Closed LaithOsama closed 1 week ago

LaithOsama commented 1 week ago

Hi folks, first of all, I'd like to thank you for this project, it's incredibly helpful.

In simple systems, there is a huge need for a project like this, but there is a drawback here, which is that most simple, self-contained systems are POSIX and require POSIX compatibility.

I ask, is dependency on GNU software an absolute necessity?

I think that in a project of this kind, portability should be prioritized.

Greetings. Leith.

Kron4ek commented 1 week ago

Hi.

I ask, is dependency on GNU software an absolute necessity?

You mean GNU coreutils and tar? Probably not a necessity, alternatives like busybox and bsdtar (libarchive) are probably fine too.

All other dependencies, including bash, are included in Conty and do not rely on the host system binaries and libraries, so portability shouln't be an issue.

Kron4ek commented 1 week ago

I just tried Conty on Alpine Linux, which has no GNU software installed at all out of the box, Conty works fine there. Therefore both coreutils and busybox are enough to run Conty.

LaithOsama commented 1 week ago

I appreciate your efforts in maintaining compatibility with busybox ... yet busybox isn't fully POSIX-compliant or anything close to sbase lets say.

In some cases a departure from the POSIX specification may be acceptable, as the priorities vary between projects...While I think focusing on compatibility in a project like this as an absolute priority would make more sense.

If I get some free time soon, I would like to contribute to find POSIX approachs whenever possible, is conty-start.shis where I should start with?

Kron4ek commented 1 week ago

There is a chance that sbase is fine too, i just haven't tested Conty with it.

If I get some free time soon, I would like to contribute to find POSIX approachs whenever possible, is conty-start.shis where I should start with?

There is no need for conty-start.sh to be fully POSIX compliant, since Conty has bash included in it, which it uses to execute conty-start.sh. As for utilities, it works with coreutils and busybox, if there are some issues when using sbase i can try to fix them.

LaithOsama commented 1 week ago

There is a chance that sbase is fine too, i just haven't tested Conty with it.

In sbase I get head error shows that the option -c is not available... and then nothing run or show after. I think there are other things as well because sbase is strictly POSIX compliant It's different with busybox as it has a wide range of features and options and I wasn't pointing to it in the first comment.

There is no need for conty-start.sh to be fully POSIX compliant, since Conty has bash included in it, which it uses to execute conty-start.sh. As for utilities, it works with coreutils and busybox, if there are some issues when using sbase i can try to fix them.

Cool. In this case I've to close the issue, I really appreciate your help.

Thanks for your responses. Best regards.

Kron4ek commented 1 week ago

I added a fix, Conty should now work with sbase. Let me know if you still have the issue.

LaithOsama commented 1 week ago

Great work mate! The new POSIX approach seems to be very efficient and even faster then the other one (In startup time via time). However, yesterday I already downloaded a static GNU head binary and it wasn't enough, as conty.sh was seems to be loading quietly with no errors. This could be because head isn't the only non-POSIX util/shell feature in the script.

To have a better idea, I suggest to fire up qemu with the live oasis image. It uses sbase and a very POSIX-compliant overall system.

Amazing work by the way, I tried before to repalce head with dd but my command wasn't this fast by any means.

Kron4ek commented 1 week ago

I tried Conty on oasis in qemu. It does not work under regular user due to unprivileged user namespaces (CONFIG_USER_NS) not enabled in the kernel, but it does work fine under root.

32-bit applications do not work though due to CONFIG_IA32_EMULATION not enabled in the kernel config.

LaithOsama commented 4 days ago

My internet is terrible, just now I tried it and I can confirm that it works. Very great work and implementation, congratulations.

Thank you, I appreciate it.