Jenkins with Docker plugin java.lang.NullPointerException: uri was not specified

I’m trying to use the Docker plugin with Jenkins. But Jenkins cannot access the REST API.

In the Jenkins configuration I put the Docker REST URL: http://127.0.0.1:4243 and when clicking on test connection it gives me Something went wrong, cannot connect to http://127.0.0.1:4243, cause: null

  • Ansible - Conditionally set volume and tls hostname based on inventory file in docker module
  • Dockerfile does not find local files in a maven project
  • Docker Java Application failing at obtaining input from console
  • Docker - see where things are installed, with dokku
  • How to expose ports between docker images in different sub-networks?
  • How can I disable internet access for docker containers
  • Jul 21, 2016 8:57:52 AM WARNING org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl doTestConnection
    
    uri was not specified
    java.lang.NullPointerException: uri was not specified
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
    at com.github.dockerjava.core.DockerClientConfig$DockerClientConfigBuilder.withUri(DockerClientConfig.java:406)
    at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.createDockerClient(DockerBuilder.java:120)
    at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.getDockerClient(DockerBuilder.java:204)
    at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.doTestConnection(DockerBuilder.java:138)
    at sun.reflect.GeneratedMethodAccessor235.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    

    But when I login to user jenkins su jenkins and do a curl 127.0.0.1:4243/info everything works as expected. I started Docker with -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock.

    What am I doing wrong?

  • How to import SHP file into docker PostgreSQL container?
  • How to config Marathon-lb to load balance a service launched in HOST network?
  • Development and production with docker with multiple sites
  • How to set Docker-compose arguments in console?
  • Interact with kafka docker container from outside of docker host
  • Rancher slow performance deploying new docker image
  • 2 Solutions collect form web for “Jenkins with Docker plugin java.lang.NullPointerException: uri was not specified”

    Had the same issue, for me it was a stupid little thing.

    Enter the URI: http://127.0.0.1:4243 or 2375 for the new version and click Apply first before you Test the connection.

    Current plugin ver 1.39 doesn’t accept http url format. Only tcp://127.0.0.1:2375 works fine.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.