Configuration of services running in a container
Table of contents
Learn how to initialize and configure Docker containers for testing
by copying files into containers and executing commands inside them.
Time to complete
15 minutes
In this guide, you will learn how to:
- Initialize containers by copying files into them
- Run commands inside running containers using
execInContainer() - Set up a PostgreSQL database with SQL scripts
- Create AWS S3 buckets in LocalStack containers
Prerequisites
- Java 17+
- Your preferred IDE
- A Docker environment supported by Testcontainers
NoteIf you're new to Testcontainers, visit the Testcontainers overview to learn more about Testcontainers and the benefits of using it.
Modules
- Copy files
Initialize containers by copying files into specific locations.
- Execute commands
Run commands inside running containers to initialize services for testing.