gradle-docker-plugin: gradle and spring boot plugin and errors with docker java
thanks alot for the great plugin. we have sadly encountered a strange issue with the docker java plugin ever since we upgraded to spring boot M4.
Execution failed for task ':mrm-external_ota:buildImage'.
> Could not resolve all dependencies for configuration ':mrm-external_ota:dockerJava'.
> Could not determine artifacts for javax.ws.rs:javax.ws.rs-api:2.1
> Could not get resource 'https://[internalrep]/repository/maven-central/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.$%7Bpackaging.type%7D'.
> Could not HEAD 'https://[internalrep]/repository/maven-central/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.$%7Bpackaging.type%7D'. Received status code 500 from server: Server Error
while I have no problem resolving and building the project, it fails while fetching the deps during docker image builds and as I see it $%7Bpackaging.type%7D is not replaced correctly which should be the package type variable.
If I switch back to spring boot M3 plugin, this will run as well, so not sure whats going on!
Any ideas ?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 43
Commits related to this issue
- Downgrading spring boot because of #467 — committed to The-Alchemist/gradle-docker-plugin by The-Alchemist 7 years ago
- Update gradle-docker version to 3.2.5 See https://github.com/bmuschko/gradle-docker-plugin/issues/467 — committed to FAForever/faf-java-api by micheljung 6 years ago
- Downgraded gradle-docker-plugin because it fails see bmuschko/gradle-docker-plugin#467 — committed to blen-desta/saml-conformance by blen-desta 6 years ago
- - Updated the Jenkinsfile - Changed detekt failure threshold to 1 - Downgraded gradle-docker-plugin because it fails see bmuschko/gradle-docker-plugin#467 — committed to blen-desta/saml-conformance by blen-desta 6 years ago
- - Updated the Jenkinsfile (#195) - Changed detekt failure threshold to 1 - Downgraded gradle-docker-plugin because it fails see bmuschko/gradle-docker-plugin#467 — committed to codice/saml-conformance by blen-desta 6 years ago
- fix (build): https://github.com/bmuschko/gradle-docker-plugin/issues/467 — committed to gurv/vg-project by gurv 5 years ago
I have similar issues with Springboot 2.0M4
Seems to be related to jersey and a new version with Springboot 2.0M4, not sure why that causes it.
I get this stacktrace with M4 but M3 works fine
[dockerjava-jaxrs-async-0] ERROR com.github.dockerjava.core.async.ResultCallbackTemplate - Error during callback java.lang.IllegalStateException: InjectionManagerFactory not found. at org.glassfish.jersey.internal.inject.Injections.lambda$lookupInjectionManagerFactory$0(Injections.java:98)I was getting the error too. Adding jcenter() fixed it for me. The clue was from Ben Muschko found here:
https://github.com/takuro-yamane/gradle-docker-plugin-spring-boot-m4
@cdancy thank you! That worked!
@orzeh put together a project solely for the purpose of building a shaded version of
docker-javawhich I will maintain and publish to jcenter. My thinking is to use this, in place of depending ondocker-java, which should get us around issues like this once and for all. As thedocker-javaproject itself seems to not want to do the work I went ahead and knocked it out. Give it a look over and let me know what you think of the idea.https://github.com/project-aries/docker-java-shaded
Bumped into this issue today as well. More will come as Spring Boot is now at RC2. It won’t be long until the masses come 😃
@cdancy I upgraded to latest version
3.2.5, getting below error -build.gradle
I had previously worked-around the “Could not build image: null” by having separate “buildImage” and “tagImage” tasks as suggested in https://github.com/bmuschko/gradle-docker-plugin/issues/399. Leaving off the
tagproperty in thebuildImageseems to be key.That, in conjunction with the changes in the linked repository from @orzeh above seems to have allowed me to build and dockerize a Spring Boot 2.0 application (
2.0.0.M5specifically).@gnilron I would reach out and try to get an updated shaded jar if that’s what works for you. You could always hop on the docker-java gitter channel and bug those guys about providing one OOTB as I’ve done as much many times myself 😃
I’ve just created small Spring Boot M.4 application and was able to build a Docker image without any issues.
@cdancy I already added jcenter() in repositories . Still it fails during buildimage
@piersf and @cdancy - great!, An example is here.
for me spring-boot RC1 worked with gradle-docker-plugin 3.2.4 with the following in dependencyManagement section:
@iNikem we will probably wait until SB 2.0 is released. That being said we may not be able to fix it without changes in
docker-java.@rafalQA please check @takuro-yamane example - it seems to work.
@takuro-yamane thanks for sharing this! I checked and it works well with latest M7 too 👍
@wwadge I created repository with example: https://github.com/orzeh/gradle-docker-plugin-spring-boot-m4
It builds image, so issue reported here is fixed, however it seems that this shaded library is out of date, because build fails with:
This seems to be this issue in
docker-javaThere’s already a shaded version of docker-java published. This patch will make it work:
From here: https://github.com/jenkinsci/docker-plugin/blob/master/docker-java-shaded/pom.xml
Can we use this version instead?