Repository navigation
Closed
Description
Description
docker-compose.yml
version: '2.1'
services:
redis1:
image: redis
depends_on:
redis2:
condition: service_started
redis2:
image: redis
Output:
/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/jglassman/iiworkspace/sandbox "-Dmaven.home=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3" "-Dclassworlds.conf=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/m2.conf" "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=58768:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2017.2.5 io.fabric8:docker-maven-plugin:0.22.1:build
objc[32441]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java (0x105d3a4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x107dc04e0). One of the two will be used. Which one is undefined.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.me.sandbox:sandbox:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 12, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sandbox 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- docker-maven-plugin:0.22.1:build (default-cli) @ sandbox ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.292 s
[INFO] Finished at: 2017-11-02T14:31:01-04:00
[INFO] Final Memory: 14M/308M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.22.1:build (default-cli) on project sandbox: A type incompatibility occurred while executing io.fabric8:docker-maven-plugin:0.22.1:build: Cannot cast java.util.LinkedHashMap to java.util.List
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>io.fabric8:docker-maven-plugin:0.22.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/jglassman/.m2/repository/io/fabric8/docker-maven-plugin/0.22.1/docker-maven-plugin-0.22.1.jar
[ERROR] urls[1] = file:/Users/jglassman/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar
[ERROR] urls[2] = file:/Users/jglassman/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar
[ERROR] urls[3] = file:/Users/jglassman/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
[ERROR] urls[4] = file:/Users/jglassman/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar
[ERROR] urls[5] = file:/Users/jglassman/.m2/repository/com/github/jnr/jnr-unixsocket/0.12/jnr-unixsocket-0.12.jar
[ERROR] urls[6] = file:/Users/jglassman/.m2/repository/com/github/jnr/jnr-ffi/2.0.9/jnr-ffi-2.0.9.jar
[ERROR] urls[7] = file:/Users/jglassman/.m2/repository/com/github/jnr/jffi/1.2.11/jffi-1.2.11.jar
[ERROR] urls[8] = file:/Users/jglassman/.m2/repository/com/github/jnr/jffi/1.2.11/jffi-1.2.11-native.jar
[ERROR] urls[9] = file:/Users/jglassman/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
[ERROR] urls[10] = file:/Users/jglassman/.m2/repository/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar
[ERROR] urls[11] = file:/Users/jglassman/.m2/repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar
[ERROR] urls[12] = file:/Users/jglassman/.m2/repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar
[ERROR] urls[13] = file:/Users/jglassman/.m2/repository/org/ow2/asm/asm-util/5.0.3/asm-util-5.0.3.jar
[ERROR] urls[14] = file:/Users/jglassman/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar
[ERROR] urls[15] = file:/Users/jglassman/.m2/repository/com/github/jnr/jnr-constants/0.9.1/jnr-constants-0.9.1.jar
[ERROR] urls[16] = file:/Users/jglassman/.m2/repository/com/github/jnr/jnr-enxio/0.12/jnr-enxio-0.12.jar
[ERROR] urls[17] = file:/Users/jglassman/.m2/repository/com/github/jnr/jnr-posix/3.0.29/jnr-posix-3.0.29.jar
[ERROR] urls[18] = file:/Users/jglassman/.m2/repository/org/apache/commons/commons-lang3/3.6/commons-lang3-3.6.jar
[ERROR] urls[19] = file:/Users/jglassman/.m2/repository/org/apache/commons/commons-text/1.1/commons-text-1.1.jar
[ERROR] urls[20] = file:/Users/jglassman/.m2/repository/org/json/json/20140107/json-20140107.jar
[ERROR] urls[21] = file:/Users/jglassman/.m2/repository/org/fusesource/jansi/jansi/1.16/jansi-1.16.jar
[ERROR] urls[22] = file:/Users/jglassman/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.57/bcpkix-jdk15on-1.57.jar
[ERROR] urls[23] = file:/Users/jglassman/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.57/bcprov-jdk15on-1.57.jar
[ERROR] urls[24] = file:/Users/jglassman/.m2/repository/org/apache/maven/plugins/maven-assembly-plugin/2.6/maven-assembly-plugin-2.6.jar
[ERROR] urls[25] = file:/Users/jglassman/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
[ERROR] urls[26] = file:/Users/jglassman/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
[ERROR] urls[27] = file:/Users/jglassman/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
[ERROR] urls[28] = file:/Users/jglassman/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.jar
[ERROR] urls[29] = file:/Users/jglassman/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[ERROR] urls[30] = file:/Users/jglassman/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[31] = file:/Users/jglassman/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
[ERROR] urls[32] = file:/Users/jglassman/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[33] = file:/Users/jglassman/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[34] = file:/Users/jglassman/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[35] = file:/Users/jglassman/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[36] = file:/Users/jglassman/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar
[ERROR] urls[37] = file:/Users/jglassman/.m2/repository/org/codehaus/plexus/plexus-archiver/3.0.1/plexus-archiver-3.0.1.jar
[ERROR] urls[38] = file:/Users/jglassman/.m2/repository/org/iq80/snappy/snappy/0.3/snappy-0.3.jar
[ERROR] urls[39] = file:/Users/jglassman/.m2/repository/org/apache/maven/shared/file-management/1.1/file-management-1.1.jar
[ERROR] urls[40] = file:/Users/jglassman/.m2/repository/org/apache/maven/shared/maven-shared-io/1.1/maven-shared-io-1.1.jar
[ERROR] urls[41] = file:/Users/jglassman/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar
[ERROR] urls[42] = file:/Users/jglassman/.m2/repository/org/apache/maven/shared/maven-filtering/1.3/maven-filtering-1.3.jar
[ERROR] urls[43] = file:/Users/jglassman/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.6/maven-shared-utils-0.6.jar
[ERROR] urls[44] = file:/Users/jglassman/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
[ERROR] urls[45] = file:/Users/jglassman/.m2/repository/org/codehaus/plexus/plexus-io/2.6/plexus-io-2.6.jar
[ERROR] urls[46] = file:/Users/jglassman/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
[ERROR] urls[47] = file:/Users/jglassman/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.21/plexus-utils-3.0.21.jar
[ERROR] urls[48] = file:/Users/jglassman/.m2/repository/org/apache/maven/shared/maven-repository-builder/1.0/maven-repository-builder-1.0.jar
[ERROR] urls[49] = file:/Users/jglassman/.m2/repository/joda-time/joda-time/2.9.9/joda-time-2.9.9.jar
[ERROR] urls[50] = file:/Users/jglassman/.m2/repository/org/yaml/snakeyaml/1.18/snakeyaml-1.18.jar
[ERROR] urls[51] = file:/Users/jglassman/.m2/repository/com/google/guava/guava/23.0-android/guava-23.0-android.jar
[ERROR] urls[52] = file:/Users/jglassman/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar
[ERROR] urls[53] = file:/Users/jglassman/.m2/repository/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar
[ERROR] urls[54] = file:/Users/jglassman/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
[ERROR] urls[55] = file:/Users/jglassman/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar
[ERROR] urls[56] = file:/Users/jglassman/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.24/plexus-interpolation-1.24.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Process finished with exit code 1
Info
- d-m-p version :
- Maven version (
mvn -v) :
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"
- Docker version :
ip-192-168-1-7:sse-service jglassman$ docker --version && docker-compose --version
Docker version 17.09.0-ce, build afdb6d4
docker-compose version 1.16.1, build 6d1ac21
Reacted by cdbennett, Bob Tiernay, Philip Durbin, Oliver Bertuch and Juan Pablo Tosca Villanueva
Metadata
Metadata
Assignees
Labels
No labels
Activity
matt-shaw commentedon Jan 5, 2018
I've just hit the same problem. Is there any news on this issue?
rhuss commentedon Jan 10, 2018
No, there is no news on this (mostly because of lack of time, there is also no support for version 3 yet). Happy to take PRs though ....
jimusbobus commentedon Feb 19, 2018
I've created a test for this - https://github.com/jimusbobus/docker-maven-plugin/commit/b2fee7935e18edfa2e52821e4fe6b90335105b29
I'd be more than happy to try and fix this, but i'm lost as where to start :)
Swapping from lists to maps was not as simple as i had hoped....
cdbennett commentedon Feb 21, 2020
For reference, here a full stack dump from v0.33 of the plugin.
cdbennett commentedon Feb 21, 2020
The docker-maven-plugin needs to look at the node type and if it's a map, then use asMap() and extract the keys. On the other hand, if it's a List, then use asList() as it already does.
It's unclear what the depends_on condition used by the docker-maven-plugin actually is, when not defined by the new condition docker-compose element. Does it was for healthy status?
robson90 commentedon Jul 26, 2022
@jimusbobus the link you provided returns a 404. Do you have it still on hand ?
jimusbobus commentedon Jul 26, 2022
Sorry no I do not, I moved on from that job and cleaned up all my old repositories and had forgotten about this issue and have deleted the repo :/
pdurbin commentedon Nov 3, 2023
Hi! First of all, we love the Docker Maven Plugin! Thanks! ❤️
We're having the same problem trying to get our app to wait for postgres to start on Windows.
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.43.4:run (default-cli) on project dataverse: A type incompatibility occurred while executing io.fabric8:docker-maven-plugin:0.43.4:run: Cannot cast java.util.LinkedHashMap to java.util.ListWe're trying to add something like this:
feat(compose): add compatibility for dependsOn with compose 2.1+ syntax
rhuss commentedon Nov 5, 2023
Thanks for raising this. Unfortunately, I'm not able to work on this plugin currently, and I have the feeling that the docker compose support is quite aged over the time.
I guess @rohanKanojia also don't has much bandwidth to rigorously work on this part of the plugin, too, but we are happy to integrate any PRs that improve the docker compose support.
poikilotherm commentedon Nov 5, 2023
I am already working on a feature branch to make this happen. PR forthcoming.
feat(compose): apply compose svc conditions as wait configurations fa…
test(compose): add tests for depends_on handling fabric8io#888
poikilotherm commentedon Nov 6, 2023
@rohanKanojia @rhuss I implemented transfering the compose conditions to wait configuration now.
But I hit another wall: a compose file allows to specify a
healthcheckfor a container which is not added at build- but at runtime. The plugin currently is not capable to pick that up, as it looks likeContainerCreateConfigdoes not yet support adding a health check (which is possible as of Docker API 1.24). So someone usingcondition: service_healthywithout a predefinedHEALTHCHECKin an image (e.g. using plain Postgres) is kind of dead in the woods...How shall I proceed? It takes quite a few changes to ship this kind of information. I'm also worried about compatibility: the current implementation supports adding healthchecks only via build configuration and not via compose file (at all).
Should we create a fresh issue for this? Should this be two distinct PRs or one closing both?
test(compose): add integration test for depends_on in compose fabric8…
doc(compose): add hint about depends_on limitations fabric8io#888
feat(compose): add compatibility for dependsOn with compose 2.1+ syntax
feat(compose): apply compose svc conditions as wait configurations #888
test(compose): add tests for depends_on handling #888
test(compose): add integration test for depends_on in compose #888
doc(compose): add hint about depends_on limitations #888