I made a library similar to Testcontainers, but works differently. (github.com)
from akash_rawal@lemmy.world to programming@programming.dev on 27 Oct 2024 13:51
https://lemmy.world/post/21332159

Testcontainers is a library that starts your test dependencies in a container and stop them after you are done using them. Testcontainers needs Docker socket access for mounting within its reaper, so I made a (for now minimal) different library that does not need Docker socket access. It also works with daemonless Podman.

#programming

threaded - newest

tyler@programming.dev on 27 Oct 2024 14:10 next collapse

What problem does this solve that test containers does not? Besides socket access?

akash_rawal@lemmy.world on 27 Oct 2024 14:32 collapse

Nothing else. Though docker socket issue was important enough.

key@lemmy.keychat.org on 27 Oct 2024 16:52 next collapse

It says this works via the cli but the docker cli works by talking to the socket so don’t you still need socket access? With podman you just need to startup the user-level socket and set a few env vars and testcontainers works fine. I’m maybe missing the “why” it’s important to avoid direct socket access? Is it to avoid configuring SELinux?

akash_rawal@lemmy.world on 27 Oct 2024 17:28 collapse

Testcontainers uses ‘ryuk’ to clean up containers and it needs docker socket mounted within its container to work. So if you had any hardening config that prevents the docker socket access within a container e.g user namespace or SELinux then Testcontainers doesn’t work.

And I think it would be nice if Testcontainers ‘just worked’ with Podman without any additional steps.

MajorHavoc@programming.dev on 28 Oct 2024 04:32 collapse

This is terrific. More folks would be more excited if they realized how much less hassle Podman is than Docker.