Skip to content

MinIO Containers

Testcontainers can be used to automatically instantiate and manage MinIO containers.

Usage example

Create a MinIOContainer to use it in your tests:

MinIOContainer container = new MinIOContainer("minio/minio:RELEASE.2023-09-04T19-57-37Z");

The MinIO Java client can be configured with the container as such:

MinioClient minioClient = MinioClient
    .credentials(container.getUserName(), container.getPassword())

If needed the username and password can be overridden as such:

MinIOContainer container = new MinIOContainer("minio/minio:RELEASE.2023-09-04T19-57-37Z")

Adding this module to your project dependencies

Add the following dependency to your pom.xml/build.gradle file:

 testImplementation "org.testcontainers:minio:1.19.8"