Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-shymov committed Sep 30, 2024
1 parent e5bd40d commit 5265b05
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Make copy docker-buildx binary to temporary config directory work on windows too ([1819](https://github.com/fabric8io/docker-maven-plugin/pull/1819))
- Pull FROM images in relative path Dockerfiles ([1823](https://github.com/fabric8io/docker-maven-plugin/issues/1823))
- Docker-compose healthcheck configuration support ([1825](https://github.com/fabric8io/docker-maven-plugin/pull/1825))
- Docker container wait timeout default value made configurable using defaultContainerWaitTimeout configuration option ([1825](https://github.com/fabric8io/docker-maven-plugin/pull/1825))
- Docker container wait timeout default value made configurable using startContainerWaitTimeout configuration option ([1825](https://github.com/fabric8io/docker-maven-plugin/pull/1825))

* **0.45.0 (2024-07-27)**:
- Automatically create parent directories of portPropertyFile path ([1761](https://github.com/fabric8io/docker-maven-plugin/pull/1761))
Expand Down
2 changes: 1 addition & 1 deletion src/main/asciidoc/inc/external/_docker_compose.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ In addition to the `docker-compose.yml` you can add all known options for <<buil

The following Docker Compose file keywords are not yet supported:

* `cgroup_parent`, `devices`, `env_file`, `expose`, `pid`, `security_opt`, `stop_signal`, `cpu_quota`, `ipc`, `mac_address`, `read_only`, `healthcheck` are not yet supported (but might be in a future version).
* `cgroup_parent`, `devices`, `env_file`, `expose`, `pid`, `security_opt`, `stop_signal`, `cpu_quota`, `ipc`, `mac_address`, `read_only` are not yet supported (but might be in a future version).
* `extend` for including other Docker Compose files is not yet implemented.
* Only **services** are currently evaluated, there is no supported yet for **volumes** and **networks**.
* When using https://docs.docker.com/compose/compose-file/compose-file-v2/#depends_on[`depends_on` with long syntax] in a Docker Compose file, be advised the plugin cannot apply all usage constellations expressible in it. The root cause is this plugin uses the concept of pausing execution based on <<start-wait,wait conditions>> attached to dependent containers, while Docker Compose applies checks when starting the depending container. Keep in mind that execution of a container is continued as soon as any wait condition is fulfilled.
6 changes: 6 additions & 0 deletions src/main/asciidoc/inc/start/_configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ In addition to the <<global-configuration>>, this goal supports the following gl
| Starts docker images in parallel while dependencies expressed as <<start-links,Link>> or <<start-depends-on,dependsOn>> are respected. This option can significantly reduce the startup time because independent containers do not need to wait for each other.
| `docker.startParallel`

| *startContainerWaitTimeout*
| Overrides the default across all the containers wait timeout (<wait><time>) is milliseconds.
Overriding that property might become particularly useful when docker-compose config defines the healthchecks,
but the default wait timeout of 10000ms is too short for some containers to become healthy.
| `docker.startContainerWaitTimeout`

|===

The `<run>` configuration element knows the following sub elements:
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/io/fabric8/maven/docker/StartMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
@Mojo(name = "start", defaultPhase = LifecyclePhase.PRE_INTEGRATION_TEST)
public class StartMojo extends AbstractDockerMojo {

public static final String DOCKER_DEFAULT_CONTAINER_WAIT_TIMEOUT = "docker.defaultContainerWaitTimeout";
@Parameter(property = "docker.showLogs")
private String showLogs;

Expand Down Expand Up @@ -99,14 +98,16 @@ public class StartMojo extends AbstractDockerMojo {
@Parameter(property = "docker.autoCreateCustomNetworks", defaultValue = "false")
protected boolean autoCreateCustomNetworks;

public static final String DOCKER_DEFAULT_CONTAINER_WAIT_TIMEOUT = "docker.startContainerWaitTimeout";

/**
* Overrides the default across all the containers wait time is milliseconds.
* Overriding that property might become particularly useful when docker-compose config defines
* the healthchecks, but the default wait timeout {@link io.fabric8.maven.docker.wait.WaitUtil#DEFAULT_MAX_WAIT}
* is too short for some containers to become healthy.
*/
@Parameter(property = DOCKER_DEFAULT_CONTAINER_WAIT_TIMEOUT, defaultValue = "10000")

Check warning on line 109 in src/main/java/io/fabric8/maven/docker/StartMojo.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/io/fabric8/maven/docker/StartMojo.java#L109

Added line #L109 was not covered by tests
protected int defaultContainerWaitTimeout = 10000;
protected int startContainerWaitTimeout = 10000;

// property file to write out with port mappings
@Parameter
Expand Down Expand Up @@ -284,7 +285,7 @@ private void startImage(final ImageConfiguration imageConfig,
final Properties projProperties = project.getProperties();
final RunImageConfiguration runConfig = imageConfig.getRunConfiguration();
final PortMapping portMapping = runService.createPortMapping(runConfig, projProperties);
projProperties.computeIfAbsent(DOCKER_DEFAULT_CONTAINER_WAIT_TIMEOUT, key -> defaultContainerWaitTimeout);
projProperties.computeIfAbsent(DOCKER_DEFAULT_CONTAINER_WAIT_TIMEOUT, key -> startContainerWaitTimeout);

Check warning on line 288 in src/main/java/io/fabric8/maven/docker/StartMojo.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/io/fabric8/maven/docker/StartMojo.java#L288

Added line #L288 was not covered by tests
final LogDispatcher dispatcher = getLogDispatcher(hub);

StartContainerExecutor startExecutor = new StartContainerExecutor.Builder()
Expand Down

0 comments on commit 5265b05

Please sign in to comment.