接口 DockerCompose
public interface DockerCompose
Provides a high-level API to work with Docker compose.
- 从以下版本开始:
- 3.1.0
- 作者:
- Moritz Halbritter, Andy Wilkinson, Phillip Webb
-
字段概要
字段 -
方法概要
修饰符和类型方法说明void
Rundocker compose down
to stop and remove any running services.void
Rundocker compose down
to stop and remove any running services.static DockerCompose
get
(DockerComposeFile file, String hostname, Set<String> activeProfiles) Factory method used to create aDockerCompose
instance.static DockerCompose
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.void
Rundocker compose start
to start services.void
Rundocker compose start
to start services.void
Rundocker compose stop
to stop any running services.void
Rundocker compose stop
to stop any running services.void
Rundocker compose up
to create and start services.void
Rundocker compose up
to create and start services.
-
字段详细资料
-
FORCE_STOP
Timeout duration used to request a forced stop.
-
-
方法详细资料
-
up
Rundocker compose up
to create and start services. Waits until all contains are started and healthy.- 参数:
logLevel
- the log level used to report progress
-
up
Rundocker compose up
to create and start services. Waits until all contains are started and healthy.- 参数:
logLevel
- the log level used to report progressarguments
- the arguments to pass to the up command- 从以下版本开始:
- 3.4.0
-
down
Rundocker compose down
to stop and remove any running services.- 参数:
timeout
- the amount of time to wait orFORCE_STOP
to stop without waiting.
-
down
Rundocker compose down
to stop and remove any running services.- 参数:
timeout
- the amount of time to wait orFORCE_STOP
to stop without waiting.arguments
- the arguments to pass to the down command- 从以下版本开始:
- 3.4.0
-
start
Rundocker compose start
to start services. Waits until all containers are started and healthy.- 参数:
logLevel
- the log level used to report progress
-
start
Rundocker compose start
to start services. Waits until all containers are started and healthy.- 参数:
logLevel
- the log level used to report progressarguments
- the arguments to pass to the start command- 从以下版本开始:
- 3.4.0
-
stop
Rundocker compose stop
to stop any running services.- 参数:
timeout
- the amount of time to wait orFORCE_STOP
to stop without waiting.
-
stop
Rundocker compose stop
to stop any running services.- 参数:
timeout
- the amount of time to wait orFORCE_STOP
to stop without waiting.arguments
- the arguments to pass to the stop command- 从以下版本开始:
- 3.4.0
-
hasDefinedServices
boolean hasDefinedServices()Return if services have been defined in theDockerComposeFile
for the active profiles.- 返回:
true
if services have been defined- 另请参阅:
-
getRunningServices
List<RunningService> getRunningServices()Return the running services for the active profile, or an empty list if no services are running.- 返回:
- the list of running services
-
get
Factory method used to create aDockerCompose
instance.- 参数:
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- 返回:
- a
DockerCompose
instance
-
get
static DockerCompose get(DockerComposeFile file, String hostname, Set<String> activeProfiles, List<String> arguments) Factory method used to create aDockerCompose
instance.- 参数:
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 activatedarguments
- the arguments to pass to Docker Compose- 返回:
- a
DockerCompose
instance - 从以下版本开始:
- 3.4.0
-