Class EmbeddedPostgres.Builder
java.lang.Object
com.opentable.db.postgres.embedded.EmbeddedPostgres.Builder
- Enclosing class:
- EmbeddedPostgres
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
setBindMount
(BindMount bindMount) Set up a bind mount between the local file system and the remotesetBindMount
(String localFile, String remoteFile) Set up a readonly bind mount.setDatabaseName
(String databaseName) Override the default databaseName of postgressetImage
(org.testcontainers.utility.DockerImageName image) Set a default image.setLocaleConfig
(String key, String value) Set up arguments to initDB processsetNetwork
(org.testcontainers.containers.Network network, String networkAlias) Set up a shared network and the alias.setPGStartupWait
(Duration pgStartupWait) Override the default startup wait for the container to start and be readysetServerConfig
(String key, String value) Arguments passed to the postgres process itselfAdd the tag to an existing imagestart()
-
Method Details
-
setPGStartupWait
Override the default startup wait for the container to start and be ready- Parameters:
pgStartupWait
- time to wait- Returns:
- builder
-
setServerConfig
Arguments passed to the postgres process itself- Parameters:
key
- keyvalue
- value- Returns:
- builder
-
setBindMount
Set up a readonly bind mount.- Parameters:
localFile
- local file system referenceremoteFile
- remote file system reference- Returns:
- builder
-
setBindMount
Set up a bind mount between the local file system and the remote- Parameters:
bindMount
- object representing this bind- Returns:
- builder
-
setNetwork
public EmbeddedPostgres.Builder setNetwork(org.testcontainers.containers.Network network, String networkAlias) Set up a shared network and the alias. This is useful if you have multiple containers, and they need to communicate with each other.- Parameters:
network
- The Network. Usually Network.Shared.networkAlias
- an alias by which other containers in the network can refer to this container- Returns:
- builder
-
setDatabaseName
Override the default databaseName of postgres- Parameters:
databaseName
- the name- Returns:
- builder
-
setLocaleConfig
Set up arguments to initDB process- Parameters:
key
- keyvalue
- value- Returns:
- builder
-
setImage
Set a default image. This may be with or without a tag- Parameters:
image
- Docker image- Returns:
- builder
-
setTag
Add the tag to an existing image- Parameters:
tag
- Tag- Returns:
- builder
-
start
- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-