Home / Type/ DockerCompose Type — spring-boot Architecture

DockerCompose Type — spring-boot Architecture

Architecture documentation for the DockerCompose type/interface in DockerCompose.java from the spring-boot codebase.

Entity Profile

Source Code

core/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DockerCompose.java lines 37–151

public interface DockerCompose {

	/**
	 * Timeout duration used to request a forced stop.
	 */
	Duration FORCE_STOP = Duration.ZERO;

	/**
	 * Run {@code docker compose up} to create and start services. Waits until all
	 * contains are started and healthy.
	 * @param logLevel the log level used to report progress
	 */
	void up(LogLevel logLevel);

	/**
	 * Run {@code docker compose up} to create and start services. Waits until all
	 * contains are started and healthy.
	 * @param logLevel the log level used to report progress
	 * @param arguments the arguments to pass to the up command
	 * @since 3.4.0
	 */
	void up(LogLevel logLevel, List<String> arguments);

	/**
	 * Run {@code docker compose down} to stop and remove any running services.
	 * @param timeout the amount of time to wait or {@link #FORCE_STOP} to stop without
	 * waiting.
	 */
	void down(Duration timeout);

	/**
	 * Run {@code docker compose down} to stop and remove any running services.
	 * @param timeout the amount of time to wait or {@link #FORCE_STOP} to stop without
	 * waiting.
	 * @param arguments the arguments to pass to the down command
	 * @since 3.4.0
	 */
	void down(Duration timeout, List<String> arguments);

	/**
	 * Run {@code docker compose start} to start services. Waits until all containers are
	 * started and healthy.
	 * @param logLevel the log level used to report progress
	 */
	void start(LogLevel logLevel);

	/**
	 * Run {@code docker compose start} to start services. Waits until all containers are
	 * started and healthy.
	 * @param logLevel the log level used to report progress
	 * @param arguments the arguments to pass to the start command
	 * @since 3.4.0
	 */
	void start(LogLevel logLevel, List<String> arguments);

	/**
	 * Run {@code docker compose stop} to stop any running services.
	 * @param timeout the amount of time to wait or {@link #FORCE_STOP} to stop without
	 * waiting.
	 */
	void stop(Duration timeout);

	/**
	 * Run {@code docker compose stop} to stop any running services.
	 * @param timeout the amount of time to wait or {@link #FORCE_STOP} to stop without
	 * waiting.
	 * @param arguments the arguments to pass to the stop command
	 * @since 3.4.0
	 */
	void stop(Duration timeout, List<String> arguments);

	/**
	 * Return if services have been defined in the {@link DockerComposeFile} for the
	 * active profiles.
	 * @return {@code true} if services have been defined
	 * @see #hasDefinedServices()
	 */
	boolean hasDefinedServices();

	/**
	 * Return the running services for the active profile, or an empty list if no services
	 * are running.
	 * @return the list of running services
	 */
	List<RunningService> getRunningServices();

	/**
	 * Factory method used to create a {@link DockerCompose} instance.
	 * @param file the Docker Compose file
	 * @param hostname the hostname used for services or {@code null} if the hostname
	 * should be deduced
	 * @param activeProfiles a set of the profiles that should be activated
	 * @return a {@link DockerCompose} instance
	 */
	static DockerCompose get(DockerComposeFile file, @Nullable String hostname, Set<String> activeProfiles) {
		return get(file, hostname, activeProfiles, Collections.emptyList());
	}

	/**
	 * Factory method used to create a {@link DockerCompose} instance.
	 * @param file the Docker Compose file
	 * @param hostname the hostname used for services or {@code null} if the hostname
	 * should be deduced
	 * @param activeProfiles a set of the profiles that should be activated
	 * @param arguments the arguments to pass to Docker Compose
	 * @return a {@link DockerCompose} instance
	 * @since 3.4.0
	 */
	static DockerCompose get(DockerComposeFile file, @Nullable String hostname, Set<String> activeProfiles,
			List<String> arguments) {
		DockerCli cli = new DockerCli(null, new DockerComposeOptions(file, activeProfiles, arguments));
		return new DefaultDockerCompose(cli, hostname);
	}

}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free