-
Notifications
You must be signed in to change notification settings - Fork 98
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
workaround for docker not found error #435
Comments
I had the same issue, but only recently, and only when I was executing the gradle task from IntelliJ IDEA Ultimate. It was working from the command line without any issues. I was about to share my specs (jdk, gradle, intellij versions, etc), but while doing so I did some changes and it got fixed. Notably:
After doing the above two, I could now run the gradle task from IntelliJ as well |
I've had the issue both on the command line and in the IDE. This does not seem to relate to intellij settings at all for me at least. But instead of a maybe this will work or that will work, we should just make this less flaky? It's clearly failing to resolve things that are clearly there and listed on a PATH. This gradle issue seems related: gradle/gradle#26453 |
Same here, but only with IntelliJ |
A variant of the original workaround that assumes the
|
Same issue here. It seems related to: gradle/gradle#10483 |
My working work around version: // Works around an issue where the docker command is not found.
// Falls back to the default, which may work on some platforms.
// https://github.com/avast/gradle-docker-compose-plugin/issues/435
// https://github.com/gradle/gradle/issues/10483
if (DefaultNativePlatform.getCurrentOperatingSystem().isMacOsX) {
listOf("/usr/bin/docker-compose", "/usr/local/bin/docker-compose").firstOrNull {
File(it).exists()
}?.let { docker ->
executable.set(docker)
}
listOf("/usr/bin/docker", "/usr/local/bin/docker").firstOrNull {
File(it).exists()
}?.let { docker ->
dockerExecutable.set(docker)
}
} |
Is there any target solution planned to solve this issue? |
@aleksanderlech CORRECTION: to be fair, this is actually an IntelliJ issue (see IDEA-334183) |
This workaround works for me. Although it's just enough friction to wait and see if this issue will be addressed. I am having this same issue trying to update a project to JDK 21 on command line and in intellij. Is there anything needed to help understand reproduce the issue? |
@dalarche-te if you're experiencing this on the CLI, it's likely because the gradle daemon was started from IntelliJ. Kill the daemon ( |
I think there's something wonky with how the docker command is resolved. I commented about a simple workaround a few weeks ago on this on one of the closed tickets: #406 (comment)
But after fixing this again on another project, I think it would be nice to just integrate the fix in the plugin or at least document the workaround somewhere.
In short, on Java 21 (with sdkman), docker for desktop, and mac the plugin is no longer able to resolve the docker command from gradle.
Here's the work around:
What this does is it tries to lookup the docker command in a few standard locations where it would normally be found before falling back to the existing behavior of trying to do magic via the PATH variable. Somehow it skips /usr/local/bin/docker, which is where I definitely have it and which is definitely on my PATH. It worked in Java 17 and somehow after switching to Java 21 (via sdkman, this may be a factor) it doesn't.
The text was updated successfully, but these errors were encountered: