Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin docker-remote-api is not compatible with Gradle 8.0 #1165

Closed
3ric-T opened this issue Feb 16, 2023 · 5 comments
Closed

Plugin docker-remote-api is not compatible with Gradle 8.0 #1165

3ric-T opened this issue Feb 16, 2023 · 5 comments
Assignees
Labels

Comments

@3ric-T
Copy link

3ric-T commented Feb 16, 2023

Expected Behavior

As a user of docker-remote-api plugin,
I want to have a plugin which runs with latest version 8.0 of gradle wrapper
So that I can build Docker images of my application

Current Behavior

Build fails with the following error:

Build file '/home/erict/workspaces_xxx/xxx/build.gradle.kts' line: 13

An exception occurred applying plugin request [id: 'com.bmuschko.docker-remote-api', version: '9.2.1']
> Failed to apply plugin 'com.bmuschko.docker-remote-api'.
   > Using internal convention mapping with a Provider backed property.
     Consult the upgrading guide for further information: https://docs.gradle.org/8.0/userguide/upgrading_version_7.html#convention_mapping

Full stacktrace is attached to the issue
With version 7.6 of Gradle, there is no issue. It seems to be related to the deprecation of some convetion mapping as stated in the error message.

Context

Simple declaration of the plugin, via version catalog file libs.versions.toml:

[versions]
dockerRemoteApiPluginVersion      = "9.2.1"

[libraries]

[bundles]

[plugins]
dockerRemoteApi = { id = "com.bmuschko.docker-remote-api", version.ref="dockerRemoteApiPluginVersion" }

Steps to Reproduce (for bugs)

Just declare the plugin as above in build file with Kotlin DSL. Any call to a Gradle task make it fail.

Your Environment

Gradle 8.0
Openjdk version "17.0.5"

@bmuschko
Copy link
Owner

bmuschko commented Feb 17, 2023

I can't reproduce your issue with Gradle 8.0. I used the following build script:

plugins {
    id 'com.bmuschko.docker-remote-api' version '9.2.1'
}

import com.bmuschko.gradle.docker.tasks.image.Dockerfile
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage

task createDockerfile(type: Dockerfile) {
    from 'ubuntu:12.04'
    label(['maintainer': 'Benjamin Muschko "[email protected]"'])
}

task buildImage(type: DockerBuildImage) {
    dependsOn createDockerfile
    images.add('bmuschko/myimage:latest')
}

Please provide a project on GitHub that reproduces your issue.

Looking at the stack trace, it seems your issue seems to come from a different plugin:

com.netflix.gradle.plugins.docker.OsPackageDockerBasePlugin.createTasks(OsPackageDockerBasePlugin.groovy:41)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at com.netflix.gradle.plugins.docker.OsPackageDockerBasePlugin.this$dist$invoke$1(OsPackageDockerBasePlugin.groovy)
	at com.netflix.gradle.plugins.docker.OsPackageDockerBasePlugin$2.methodMissing(OsPackageDockerBasePlugin.groovy)

@3ric-T
Copy link
Author

3ric-T commented Feb 17, 2023

Indeed, that's strange.
I didn't carefully look at the stacktrace, I'm sorry. I'll dig into this.

@3ric-T
Copy link
Author

3ric-T commented Feb 17, 2023

I created a project similar to yours, using version catalog file and Gradle 8.0, with only your plugin and it works perfectly.
Then it is related to another plugin which seems to pollute what I try to do. I close the ticket.

Sorry for the inconvenience, your plugin is really useful and saves us a lot of time creating Docker images for our products. Thanks for your work.

@3ric-T 3ric-T closed this as completed Feb 17, 2023
@3ric-T
Copy link
Author

3ric-T commented Feb 17, 2023

As you can see here, Nebula is using your plugin in its own gradle-ospackage-plugin. But nowhere in the docs is referenced a task that builds Docker images. This plugin is designed to build RPM and DEB packages.
It seems that these pieces of code are abandonned, untouched since 4 years. I'll open a issue at Nebula's to see if they can do anything for that
Issue #421 opened

@bmuschko
Copy link
Owner

This plugin is designed to build RPM and DEB packages.

Yeah, that doesn't make sense. I am pretty sure https://github.com/nebula-plugins/gradle-ospackage-plugin/blob/main/src/main/groovy/com/netflix/gradle/plugins/docker/OsPackageDockerBasePlugin.groovy#L43 is the issue.

@bmuschko bmuschko added wontfix and removed question labels Feb 17, 2023
@bmuschko bmuschko self-assigned this Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants