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

DockerClientException: Could not build image: null when building from dockerfile #829

Closed
mbrasier opened this Issue Oct 18, 2017 · 7 comments

Comments

Projects
None yet
2 participants
@mbrasier

mbrasier commented Oct 18, 2017

Issue Overview

When building a docker image from a dockerfile, a DockerClientException: Could not build image: null is thrown, this appears to be caused by using an old version of docker-java, as it is a fixed bug in the latest versions.

Expected Behaviour

No exception is thrown

Current Behaviour
Caused by: com.github.dockerjava.api.exception.DockerClientException: Could not build image: null
	at com.github.dockerjava.core.command.BuildImageResultCallback.getImageId(BuildImageResultCallback.java:71)
	at com.github.dockerjava.core.command.BuildImageResultCallback.awaitImageId(BuildImageResultCallback.java:48)
	at org.arquillian.cube.docker.impl.docker.DockerClientExecutor.buildImage(DockerClientExecutor.java:738)
Steps To Reproduce

Use a dockerfile to build an image:

        <property name="dockerContainers">
            unit-test:
                buildImage:
                    dockerfileLocation: src/test/docker/unit-test
                    noCache: true
                    remove: true
                await:
                    strategy: sleeping
                    sleepTime: 30 s
                portBindings: [1090->1080/tcp, 9999/tcp, 8080/tcp]
                restartPolicy:
                    name: failure
                    maximumRetryCount: 1
                manual: false
Additional Information

See docker-java/docker-java#860 for related docker-java issue

@lordofthejars

This comment has been minimized.

Show comment
Hide comment
@lordofthejars

lordofthejars Oct 19, 2017

Member

Can you provide a github project so we can take a look?

Member

lordofthejars commented Oct 19, 2017

Can you provide a github project so we can take a look?

@mbrasier

This comment has been minimized.

Show comment
Hide comment
@mbrasier

mbrasier Oct 19, 2017

I will put something together next week.

mbrasier commented Oct 19, 2017

I will put something together next week.

@lordofthejars

This comment has been minimized.

Show comment
Hide comment
@lordofthejars

lordofthejars Oct 20, 2017

Member

Great, thank you very much, since I am not sure what is happening because we have tested this use case as well (or at least with the description) then I am not sure what is happening. Then with an example I will be able to debug, fix it in cube or provide you a solution on your example

Member

lordofthejars commented Oct 20, 2017

Great, thank you very much, since I am not sure what is happening because we have tested this use case as well (or at least with the description) then I am not sure what is happening. Then with an example I will be able to debug, fix it in cube or provide you a solution on your example

@mbrasier

This comment has been minimized.

Show comment
Hide comment
@mbrasier

mbrasier Oct 20, 2017

It seems to be an issue with the latest version of docker, which doesn't work with the older version of docker-java that arquillian-cube (at least the version in the latest arquillian-universe BOM) uses. Tracing through, docker outputs a string "Successfully tagged" when the image is created, but docker-java is looking for the string "Successfully created" and so assumes that creation of the container failed. It may be you start seeing the issue if you updated to the latest docker release.

mbrasier commented Oct 20, 2017

It seems to be an issue with the latest version of docker, which doesn't work with the older version of docker-java that arquillian-cube (at least the version in the latest arquillian-universe BOM) uses. Tracing through, docker outputs a string "Successfully tagged" when the image is created, but docker-java is looking for the string "Successfully created" and so assumes that creation of the container failed. It may be you start seeing the issue if you updated to the latest docker release.

@lordofthejars

This comment has been minimized.

Show comment
Hide comment
@lordofthejars

lordofthejars Oct 20, 2017

Member

Then assuming that latest docker-java has fixed, you can update the version on your pom and try it.

Member

lordofthejars commented Oct 20, 2017

Then assuming that latest docker-java has fixed, you can update the version on your pom and try it.

@mbrasier

This comment has been minimized.

Show comment
Hide comment
@mbrasier

mbrasier Oct 20, 2017

Yes that works, but this ticket is to ensure that arquillian-cube updates its dependency (having a dependency on docker-java in our project isn't great, because we don't depend on it, other than to fix arquillian-cube).

mbrasier commented Oct 20, 2017

Yes that works, but this ticket is to ensure that arquillian-cube updates its dependency (having a dependency on docker-java in our project isn't great, because we don't depend on it, other than to fix arquillian-cube).

@lordofthejars

This comment has been minimized.

Show comment
Hide comment
@lordofthejars

lordofthejars Oct 20, 2017

Member

ok, then it is easy, thanks:) I'll do it now.

Member

lordofthejars commented Oct 20, 2017

ok, then it is easy, thanks:) I'll do it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment