this post was submitted on 27 Oct 2024
45 points (97.9% liked)

Programming

17303 readers
75 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

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.

top 5 comments
sorted by: hot top controversial new old
[–] MajorHavoc 2 points 3 days ago

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

[–] [email protected] 2 points 4 days ago (1 children)

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?

[–] [email protected] 7 points 4 days ago

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.

[–] tyler 2 points 4 days ago (1 children)

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

[–] [email protected] 8 points 4 days ago

Nothing else. Though docker socket issue was important enough.