Class MinIOContainer

java.lang.Object
org.testcontainers.containers.GenericContainer<MinIOContainer>
org.testcontainers.containers.MinIOContainer
All Implemented Interfaces:
AutoCloseable, org.testcontainers.containers.Container<MinIOContainer>, org.testcontainers.containers.ContainerState, org.testcontainers.containers.traits.LinkableContainer, org.testcontainers.containers.wait.strategy.WaitStrategyTarget, org.testcontainers.lifecycle.Startable

public class MinIOContainer extends org.testcontainers.containers.GenericContainer<MinIOContainer>
Testcontainers implementation for MinIO.

Supported image: minio/minio

Exposed ports:

  • S3: 9000
  • Console: 9001
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.testcontainers.containers.Container

    org.testcontainers.containers.Container.ExecResult
  • Field Summary

    Fields inherited from class org.testcontainers.containers.GenericContainer

    CONTAINER_RUNNING_TIMEOUT_SEC, dependencies, dockerClient, INTERNAL_HOST_HOSTNAME, waitStrategy

    Fields inherited from interface org.testcontainers.containers.ContainerState

    STATE_HEALTHY
  • Constructor Summary

    Constructors
    Constructor
    Description
    MinIOContainer(String dockerImageName)
    Constructs a MinIO container from the dockerImageName
    MinIOContainer(org.testcontainers.utility.DockerImageName dockerImageName)
    Constructs a MinIO container from the dockerImageName
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Configures the MinIO container
     
     
     
    withPassword(String password)
    Overrides the DEFAULT_PASSWORD
    withUserName(String userName)
    Overrides the DEFAULT_USER

    Methods inherited from class org.testcontainers.containers.GenericContainer

    addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, containerIsCreated, containerIsStarted, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPortNumbers, getLivenessCheckPorts, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setContainerDef, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, stop, toString, waitingFor, waitUntilContainerStarted, withAccessToHost, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCopyToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectory

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.testcontainers.containers.Container

    addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBind

    Methods inherited from interface org.testcontainers.containers.ContainerState

    copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunning

    Methods inherited from interface org.testcontainers.lifecycle.Startable

    close
  • Constructor Details

    • MinIOContainer

      public MinIOContainer(String dockerImageName)
      Constructs a MinIO container from the dockerImageName
      Parameters:
      dockerImageName - the full image name to use
    • MinIOContainer

      public MinIOContainer(org.testcontainers.utility.DockerImageName dockerImageName)
      Constructs a MinIO container from the dockerImageName
      Parameters:
      dockerImageName - the full image name to use
  • Method Details

    • withUserName

      public MinIOContainer withUserName(String userName)
      Overrides the DEFAULT_USER
      Parameters:
      userName - the Root user to override
      Returns:
      this
    • withPassword

      public MinIOContainer withPassword(String password)
      Overrides the DEFAULT_PASSWORD
      Parameters:
      password - the Root user's password to override
      Returns:
      this
    • configure

      public void configure()
      Configures the MinIO container
      Overrides:
      configure in class org.testcontainers.containers.GenericContainer<MinIOContainer>
    • getS3URL

      public String getS3URL()
      Returns:
      the URL to upload/download objects from
    • getUserName

      public String getUserName()
      Returns:
      the Username for the Root user
    • getPassword

      public String getPassword()
      Returns:
      the password for the Root user