jarlah
Testcontainers - A Testcontainers implementation for Elixir
Testcontainers
Testcontainers is an Elixir library that supports ExUnit tests, providing lightweight, throwaway instances of common databases, or anything else that can run in a Docker container.
It supports Testcontainers Desktop, but doesn’t need it to run. It will find and pick up a docker engine that works every time it runs.
Let me show you its features
In its basic form Testcontainers can used like this:
{:ok, _} = Testcontainers.start_link()
config = %Testcontainers.Container{image: "redis:latest"}
{:ok, container} = Testcontainers.start_container(config)
But the most interesting usage for Elixir is the Ecto module, which lets you run tests without having a postgres (or mysql) container running (see the README section for this advanced usage).
You can also spin up a throwaway container in a single ExUnit test:
container(:redis, Testcontainers.RedisContainer.new())
or shared container for multiple tests
container(:redis, Testcontainers.RedisContainer.new(), shared: true)
How it works
It has a dependency on an autogenerated elixir library for the docker engine api. The complex logic for calling out to docker is hidden inside that library.
Most Liked Responses
jarlah
Proud to announce v1.8.0 which brings support for two new technologies, RabbitMq and Emqx.
There are a lot of new contributors in this release and this is really encouraging.
Key features that has been implemented is private registry support and proper user agent is sent to docker engine api.
![]()
jarlah
a friendly and helpful github user that previously reported podman not working, got back to me and told me that it was still not working after the release. Well i brought in the big guns, virtualbox, and installed ubuntu 24 and podman and started podman.socket service in user mode. Confirmed the issue, fixed the bug and released v1.11.5
Thanks to github user kianmeng for this helpful testing.








