# Testcontainers

14 Hacker News commenters recommended Testcontainers and 3 criticized it, November 2025 to November 2026. It was recommended in 8 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** Starts real databases and services in Docker containers for tests, so people skip mocks and in-memory stand-ins. Main caveat: some worry about images pulled from Docker Hub.

## Why people recommend it

- Runs tests against real databases (4 comments): "Testcontainers are great for tests in particular when you don't want to use some mocked in-memory DB" ([source](https://news.ycombinator.com/item?id=49365911)) "because it's not fully Postgres, I've switched entirely to TestContainers" ([source](https://news.ycombinator.com/item?id=46503193)) "I'm using them for integration tests that need Postgres." ([source](https://news.ycombinator.com/item?id=46427339))
- Starts real services for integration tests (4 comments): "It uses Testcontainers to start and autowire runtime deps (postgres, redis, keycloak, etc.)." ([source](https://news.ycombinator.com/item?id=47156085)) "introduce Testcontainers and load testing tools and anything else that makes sense" ([source](https://news.ycombinator.com/item?id=49332906)) "always run tests running real infra like testcontainers" ([source](https://news.ycombinator.com/item?id=48116717))

## What people warn about

- Images pulled from Docker Hub (1 comments): "people find out testcontainers or whatever is pulling from docker hub rather than the company registry" ([source](https://news.ycombinator.com/item?id=48159345))

## Alternatives hackers recommend

- [Mockito](https://hackerapproved.com/p/mockito.md): 19 recommend
- [cargo-nextest](https://hackerapproved.com/p/cargo-nextest.md): 18 recommend
- [Vitest](https://hackerapproved.com/p/vitest.md): 17 recommend
- [pytest](https://hackerapproved.com/p/pytest.md): 12 recommend
- [Cucumber](https://hackerapproved.com/p/cucumber.md): 9 recommend

## Cite as

Hacker Approved, "Testcontainers", https://hackerapproved.com/p/testcontainers/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
