Package io.floci.testcontainers.config
Class StorageConfig.Builder
java.lang.Object
io.floci.testcontainers.config.StorageConfig.Builder
- Enclosing class:
- StorageConfig
Builder for
StorageConfig.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates an immutableStorageConfigfrom this builder.pruneVolumesOnDelete(boolean pruneVolumesOnDelete) Sets whether named volumes are removed immediately after a child container stops on resource delete.Generates a temporary directory on the host and uses it as the persistent storage path.
-
Method Details
-
randomHostPersistentPath
Generates a temporary directory on the host and uses it as the persistent storage path. The directory is created under the JVM's default temp-file location with the prefixfloci-and is bind-mounted into the container at/app/data.- Returns:
- this builder
- Throws:
IllegalStateException- if the temporary directory cannot be created
-
pruneVolumesOnDelete
Sets whether named volumes are removed immediately after a child container stops on resource delete. Inmemorystorage mode volumes are always removed regardless of this flag. Defaults tofalseto match real AWS behaviour (data survives delete).- Parameters:
pruneVolumesOnDelete-trueto prune volumes on delete (default true)- Returns:
- this builder
-
build
Creates an immutableStorageConfigfrom this builder.- Returns:
- the storage configuration
-