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

NPE during docker:build #277

Closed
arun-gupta opened this issue Sep 2, 2015 · 4 comments
Closed

NPE during docker:build #277

arun-gupta opened this issue Sep 2, 2015 · 4 comments

Comments

@arun-gupta
Copy link

Building https://github.com/arun-gupta/microservices/tree/master/microservice as mvn package -Pdocker gives the following error:

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution docker:build of goal org.jolokia:docker-maven-plugin:0.13.3:build failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.NullPointerException
    at org.jolokia.docker.maven.access.hc.DockerAccessWithHcClient.<init>(DockerAccessWithHcClient.java:62)
    at org.jolokia.docker.maven.AbstractDockerMojo.createDockerAccess(AbstractDockerMojo.java:243)
    at org.jolokia.docker.maven.AbstractDockerMojo.execute(AbstractDockerMojo.java:169)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    ... 20 more

Environment variables:

DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_MACHINE_NAME=default
DOCKER_TLS_VERIFY=1
DOCKER_CERT_PATH=/Users/arungupta/.docker/machine/machines/default

Docker configuration:

Images: 78
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 82
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.0.9-boot2docker
Operating System: Boot2Docker 1.8.0 (TCL 6.3); master : 7f12e95 - Tue Aug 11 17:55:16 UTC 2015
CPUs: 1
Total Memory: 996.2 MiB
Name: default
ID: G3BT:IMYD:LHIU:NFP5:3YLF:2LYS:YZW2:U6IO:C3YU:ROQM:7U6X:OYM3
Debug mode (server): true
File Descriptors: 15
Goroutines: 28
System Time: 2015-09-02T21:08:27.766035651Z
EventsListeners: 0
Init SHA1: 
Init Path: /usr/local/bin/docker
Docker Root Dir: /mnt/sda1/var/lib/docker
Username: arungupta
Registry: https://index.docker.io/v1/
Labels:
 provider=virtualbox
@arun-gupta
Copy link
Author

Added a property docker.host in pom.xml and that started messing up the configuration. I think the property names need to be better qualified for the plugin.

@jgangemi
Copy link
Collaborator

jgangemi commented Sep 2, 2015

i have docker.host set just fine in my pom.

<docker.host>tcp://172.16.116.139:2375</docker.host>

how are you defining the property in your pom? i don't see it anywhere.

@arun-gupta
Copy link
Author

I defined docker.host as 192.178.99.100 as opposed to tcp://192.168.99.100:2376. Later is indeed the appropriate way of setting DOCKER_HOST instead of just setting the IP address.

So I'll close the issue as user error for now.

@rhuss
Copy link
Collaborator

rhuss commented Sep 3, 2015

btw, if you leave out the docker.host property the plugin will happily pickup the DOCKER_HOST env variable. The full URL is required because the port is needed to decided whether to use SSL or not and the schema is needed to decided whether to use TCP or the UNIX socket (in which case the rest of the URL is interpreted as a file path).

I added a better error message than a NPE, though ;-) Thanks for reporting this ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants