Interface DockerCompose
public interface DockerCompose
Provides a high-level API to work with Docker compose.
- Since:
- 3.1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DurationTimeout duration used to request a forced stop. -
Method Summary
Modifier and TypeMethodDescriptionvoidRundocker compose downto stop and remove any running services.static DockerComposeget(DockerComposeFile file, String hostname, Set<String> activeProfiles) Factory method used to create aDockerComposeinstance.Return the running services for the active profile, or an empty list if no services are running.booleanReturn if services have been defined in theDockerComposeFilefor the active profiles.voidstart(org.springframework.boot.logging.LogLevel logLevel) Rundocker compose startto start services.voidRundocker compose stopto stop any running services.voidup(org.springframework.boot.logging.LogLevel logLevel) Rundocker compose upto create and start services.
-
Field Details
-
FORCE_STOP
Timeout duration used to request a forced stop.
-
-
Method Details
-
up
void up(org.springframework.boot.logging.LogLevel logLevel) Rundocker compose upto create and start services. Waits until all contains are started and healthy.- Parameters:
logLevel- the log level used to report progress
-
down
Rundocker compose downto stop and remove any running services.- Parameters:
timeout- the amount of time to wait orFORCE_STOPto stop without waiting.
-
start
void start(org.springframework.boot.logging.LogLevel logLevel) Rundocker compose startto start services. Waits until all containers are started and healthy.- Parameters:
logLevel- the log level used to report progress
-
stop
Rundocker compose stopto stop any running services.- Parameters:
timeout- the amount of time to wait orFORCE_STOPto stop without waiting.
-
hasDefinedServices
boolean hasDefinedServices()Return if services have been defined in theDockerComposeFilefor the active profiles.- Returns:
trueif services have been defined- See Also:
-
getRunningServices
List<RunningService> getRunningServices()Return the running services for the active profile, or an empty list if no services are running.- Returns:
- the list of running services
-
get
Factory method used to create aDockerComposeinstance.- Parameters:
file- the docker compose filehostname- the hostname used for services ornullif the hostname should be deducedactiveProfiles- a set of the profiles that should be activated- Returns:
- a
DockerComposeinstance
-