Interface DockerCompose
public interface DockerCompose
Provides a high-level API to work with Docker compose.
- Since:
- 3.1.0
- Author:
- Moritz Halbritter, Andy Wilkinson, Phillip Webb
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Duration
Timeout duration used to request a forced shutdown. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Rundocker compose down
to shutdown any running services.static DockerCompose
get
(DockerComposeFile file, String hostname, Set<String> activeProfiles) Factory method used to create aDockerCompose
instance.Return the running services for the active profile, or an empty list if no services are running.boolean
Return if services have been defined in theDockerComposeFile
for the active profiles.boolean
Return if services defined in theDockerComposeFile
for the active profile are running.void
Rundocker compose start
to startup services.void
Rundocker compose stop
to shutdown any running services.void
Rundocker compose up
to startup services.
-
Field Details
-
FORCE_SHUTDOWN
Timeout duration used to request a forced shutdown.
-
-
Method Details
-
up
Rundocker compose up
to startup services. Waits until all contains are started and healthy.- Parameters:
logLevel
- the log level used to report progress
-
down
Rundocker compose down
to shutdown any running services.- Parameters:
timeout
- the amount of time to wait orFORCE_SHUTDOWN
to shutdown without waiting.
-
start
Rundocker compose start
to startup services. Waits until all contains are started and healthy.- Parameters:
logLevel
- the log level used to report progress
-
stop
Rundocker compose stop
to shutdown any running services.- Parameters:
timeout
- the amount of time to wait orFORCE_SHUTDOWN
to shutdown without waiting.
-
hasDefinedServices
boolean hasDefinedServices()Return if services have been defined in theDockerComposeFile
for the active profiles.- Returns:
true
if services have been defined- See Also:
-
hasRunningServices
boolean hasRunningServices()Return if services defined in theDockerComposeFile
for the active profile are running.- Returns:
true
if services are running- 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 aDockerCompose
instance.- Parameters:
file
- the docker compose filehostname
- the hostname used for services ornull
if the hostname should be deducedactiveProfiles
- a set of the profiles that should be activated- Returns:
- a
DockerCompose
instance
-