CheckOps
dockertest
dockertest is an Apache-2.0 Go library from Ory that starts Docker containers for integration tests against real databases and services, and cleans them up afterwards.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
Dockertest lets Go tests run against third-party services in Docker. The README explains the motivation: mocking databases is strenuous, schema changes force mock rewrites, and it is smarter to test against a real database that is destroyed after testing.
Tests start a container from any Docker Hub or custom image, wait until the service is ready using a retry helper, connect to it, run the test and purge the container. It works with databases such as PostgreSQL and MySQL, and any service available as an image.
Dockertest is maintained by Ory and released v4.0.1 in October 2026.
In the quality loop it supports integration tests in Go with real dependencies.
The source code is at ory/dockertest on GitHub under the Apache-2.0 licence, with about 4,500 stars; the most recent commit was on 19 October 2026.
Features
- Any Docker image: Run real services for tests.
- Readiness retry: Wait until a service accepts connections.
- Cleanup: Purge containers after tests.
- Go native: Use with the standard testing package.
- CI friendly: Works anywhere Docker runs.
Pros
- Real dependencies: Tests catch issues mocks miss.
- Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 19 October 2026.
- Community: About 4,500 GitHub stars.
Cons
- Needs Docker: Not available in every CI environment.
- Slower than unit tests: Container start-up adds time.
Usage and Links (Example)
pool, _ := dockertest.NewPool("")
res, _ := pool.Run("postgres", "16", []string{"POSTGRES_PASSWORD=secret"})
defer pool.Purge(res)
Resources:
Pricing
dockertest is free and open source under the Apache-2.0 licence.
Recommended for?
- Go teams writing integration tests against real services.
- Not a fit without Docker; consider Testcontainers for richer modules.
Conclusion
dockertest is a simple, maintained way to use real containers in Go integration tests.
On CheckOps, dockertest is filed under the Integration testing stage. Related tools listed here include Testcontainers, Go testing package, Testify, GoMock (uber-go/mock), Moto and WireMock. Before choosing, compare them on licence, supported languages and platforms, hosting model, and how well each fits your existing CI pipeline. Facts on this page were checked against the official website, documentation and repository on 11 November 2026; statements the vendor makes about its own product are marked as vendor claims.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with dockertest side by side.
TTestcontainersTestcontainers starts throwaway Docker containers from tests so integration tests can use real databases, brokers, and browsers.Compare with dockertest
GGo testing packageGo's built-in testing package and go test command provide unit tests, table-driven subtests, benchmarks, fuzzing, examples and coverage with no third-party dependencies.Compare with dockertest
TTestifyTestify is an MIT-licensed Go toolkit with assert and require assertion packages, mock objects and test suites, the most widely used testing library in the Go ecosystem.Compare with dockertest
GGoMock (uber-go/mock)GoMock is an Apache-2.0 mocking framework for Go, maintained by Uber after the original golang/mock was archived, with the mockgen code generator and a gomock controller for expectations.Compare with dockertest
MMotoMoto is an Apache-2.0 Python library that mocks AWS services in tests, with decorators for boto3 code and a standalone server mode for other languages.Compare with dockertest
WWireMockA tool for mocking HTTP services.Compare with dockertest