-
Notifications
You must be signed in to change notification settings - Fork 362
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 refusing to use local unix sock for dockerd #474
Comments
@NorrinRadd if you're on a unix based system you can leave out the So here is what I would do: simplify your script down to the bare minimum to get things going ONLY for the build image task. Meaning: remove all the other tasks and dependencies and do something very simple that should "just work". Once we have that going (please post most simple reproducible snippet here) or not we can decide what to do next. |
Continued report: the daemon seems to be running perfectly fine: $ netstat -a|grep docker $ curl --unix-socket /var/run/docker.sock -X POST http:/v1.24/containers/1c6594faf5/start Similar Reportsspotify/docker-maven-plugin#221 |
@cdancy [Gradle] - Launching build. |
Are you running this script in a standalone environment or as part of bigger build? What environment are you running this on? Is it virtual? |
This is running on a jenkins server. It's a standalone job. It's RHELinux. |
hmmm ... do you have other machines where docker is installed where this does work? Just trying to figure out where your issue lies. Do you have a bare-bones snippet with all the extra stuff removed that someone could run? |
@NorrinRadd maybe in your CI environment |
Hmm we seem to have found the problem. The jenkins server is running in a docker container. The job gets a lot further when run locally. @cdancy |
Where's a better place to get support for this plugin than creating issues here? (assuming the problem is not a bug or feature request) |
Aaahhh got it. We use cloudbees Jenkins here and pass along the host socket url as an environment variable to the dockerized Jenkins server. We then reference that env-var and pass it along to the plugin. |
@NorrinRadd You can join us on Gitter https://gitter.im/gradle-docker-plugin/Lobby |
We may not be IN the lobby but we'll get emails if you ping us there. |
Ok. I posted over there. |
[workspace] $ /var/jenkins_home/jobs/platform-router-docker-build/workspace/gradlew clean pushToRegistry
Starting a Gradle Daemon, 2 busy Daemons could not be reused, use --status for details
:clean UP-TO-DATE
:buildImage
Building image using context '/var/jenkins_home/jobs/platform-router-docker-build/workspace'.
Using tag 'nimbus/platform-router' for image.
[dockerjava-jaxrs-async-0] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (org.newsclub.net.unix.AFUNIXSocketException) caught when processing request to {}->unix://localhost:80: No such file or directory
[dockerjava-jaxrs-async-0] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->unix://localhost:80
[dockerjava-jaxrs-async-0] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (org.newsclub.net.unix.AFUNIXSocketException) caught when processing request to {}->unix://localhost:80: No such file or directory
========================================================
// build.gradle
import com.github.jrubygradle.JRubyExec
import com.bmuschko.gradle.docker.tasks.container.*
import com.bmuschko.gradle.docker.tasks.image.*
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.github.jruby-gradle:jruby-gradle-plugin:1.5.0'
classpath 'com.bmuschko:gradle-docker-plugin:3.2.0'
}
}
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'com.github.jruby-gradle.base'
apply plugin: 'com.bmuschko.docker-remote-api'
dependencies {
jrubyExec 'rubygems:rspec:3.5.0'
jrubyExec 'rubygems:rest-client:2.0.2'
}
docker {
url = 'unix:///var/run/docker.sock'
certPath = null // I've tried with this line completely commented out also.
}
task buildImage(type: DockerBuildImage) {
tag = 'stuff/platform-router'
inputDir = file('.')
}
task createMyAppContainer(type: DockerCreateContainer) {
dependsOn buildImage
targetImageId { buildImage.getImageId() }
portBindings = ['8080:80']
}
task startMyAppContainer(type: DockerStartContainer) {
dependsOn createMyAppContainer
targetContainerId { createMyAppContainer.getContainerId() }
}
task stopMyAppContainer(type: DockerStopContainer) {
targetContainerId { createMyAppContainer.getContainerId() }
}
task testNginxDocker(type : JRubyExec) {
dependsOn startMyAppContainer
workingDir './spec'
script 'rake'
finalizedBy stopMyAppContainer
}
task pushToRegistry(type: DockerPushImage) {
dependsOn testNginxDocker
imageName = { buildImage.getImageId() }
tag = { buildImage.getTag() }
}
==========================================
The job fails during the buildImage task. It seems like it's attempting to use HTTP with a unix syntax..... There are lots of reports of this happening on the docker maven plugin... I don't know if this plugin is somehow using some of the same src/libs as the docker maven plugin, but the bug seems to be exactly the same. Is this something that can be fixed? In my use case, changing how dockerd listens is not an option. We don't have full admin over the machine.
The text was updated successfully, but these errors were encountered: