Home / Function/ start() — spring-boot Function Reference

start() — spring-boot Function Reference

Architecture documentation for the start() function in DockerComposeLifecycleManager.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  9a3bcb8a_c3cd_f4b9_7a55_7e8b9b547651["start()"]
  d4e529c4_6f38_ee07_32db_91c37f74e3ac["getComposeFile()"]
  9a3bcb8a_c3cd_f4b9_7a55_7e8b9b547651 -->|calls| d4e529c4_6f38_ee07_32db_91c37f74e3ac
  73331c44_507c_effa_9585_c0540ba9e2e8["getDockerCompose()"]
  9a3bcb8a_c3cd_f4b9_7a55_7e8b9b547651 -->|calls| 73331c44_507c_effa_9585_c0540ba9e2e8
  f015d923_716b_a08c_1033_38b5be9b5ab2["publishEvent()"]
  9a3bcb8a_c3cd_f4b9_7a55_7e8b9b547651 -->|calls| f015d923_716b_a08c_1033_38b5be9b5ab2
  style 9a3bcb8a_c3cd_f4b9_7a55_7e8b9b547651 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/lifecycle/DockerComposeLifecycleManager.java lines 98–148

	void start() {
		if (Boolean.getBoolean(AbstractAotProcessor.AOT_PROCESSING) || AotDetector.useGeneratedArtifacts()) {
			logger.trace("Docker Compose support disabled with AOT and native images");
			return;
		}
		if (!this.properties.isEnabled()) {
			logger.trace("Docker Compose support not enabled");
			return;
		}
		if (this.skipCheck.shouldSkip(this.classLoader, this.properties.getSkip())) {
			logger.trace("Docker Compose support skipped");
			return;
		}
		DockerComposeFile composeFile = getComposeFile();
		Set<String> activeProfiles = this.properties.getProfiles().getActive();
		List<String> arguments = this.properties.getArguments();
		DockerCompose dockerCompose = getDockerCompose(composeFile, activeProfiles, arguments);
		if (!dockerCompose.hasDefinedServices()) {
			logger.warn(LogMessage.format("No services defined in Docker Compose file %s with active profiles %s",
					composeFile, activeProfiles));
			return;
		}
		LifecycleManagement lifecycleManagement = this.properties.getLifecycleManagement();
		Start start = this.properties.getStart();
		Stop stop = this.properties.getStop();
		Wait wait = this.properties.getReadiness().getWait();
		List<RunningService> runningServices = dockerCompose.getRunningServices();
		if (lifecycleManagement.shouldStart()) {
			Skip skip = this.properties.getStart().getSkip();
			if (skip.shouldSkip(runningServices)) {
				logger.info(skip.getLogMessage());
			}
			else {
				start.getCommand().applyTo(dockerCompose, start.getLogLevel(), start.getArguments());
				runningServices = dockerCompose.getRunningServices();
				if (wait == Wait.ONLY_IF_STARTED) {
					wait = Wait.ALWAYS;
				}
				if (lifecycleManagement.shouldStop()) {
					this.shutdownHandlers
						.add(() -> stop.getCommand().applyTo(dockerCompose, stop.getTimeout(), stop.getArguments()));
				}
			}
		}
		List<RunningService> relevantServices = new ArrayList<>(runningServices);
		relevantServices.removeIf(this::isIgnored);
		if (wait == Wait.ALWAYS || wait == null) {
			this.serviceReadinessChecks.waitUntilReady(relevantServices);
		}
		publishEvent(new DockerComposeServicesReadyEvent(this.applicationContext, relevantServices));
	}

Domain

Subdomains

Calls

Frequently Asked Questions

What does start() do?
start() is a function in the spring-boot codebase.
What does start() call?
start() calls 3 function(s): getComposeFile, getDockerCompose, publishEvent.

Analyze Your Own Codebase

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

Try Supermodel Free