Closed mgparada closed 7 years ago
Thank you for reporting this issue @mgparada. I'll take a look into this today.
Update:
As @lordofthejars said, I tried to Docker-Compose file but still failing. The error is a bit different, but seems that is ignoring the dockerRegistry property. My arquillian.xml:
<extension qualifier="docker">
<property name="serverVersion">1.12</property>
<property name="dockerInsideDockerResolution">false</property>
<property name="serverUri">https://127.0.0.1:2376</property>
<property name="tlsVerify">DOCKER_CERT_PATH</property>
<property name="dockerRegistry">xx.yy.com:1234</property>
<property name="username">xx</property>
<property name="password">xx</property>
<property name="email">mauro@xx.com</property>
<property name="dockerContainersFile">src/test/resources/docker-compose.yml</property>
</extension>
and the error is like that:
Caused by: com.github.dockerjava.api.exception.UnauthorizedException: Get https://registry-1.docker.io/v2/library/null/manifests/latest: unauthorized: incorrect username or password
at com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter.filter(ResponseStatusExceptionFilter.java:45)
at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:140)
at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:128)
at org.glassfish.jersey.process.internal.Stages.process(Stages.java:171)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:257)
at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:701)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:697)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:448)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:349)
at com.github.dockerjava.jaxrs.async.POSTCallbackNotifier.response(POSTCallbackNotifier.java:29)
at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:50)
at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:24)
... 4 more
Starting with docker-compose works like a charm. I cannot figure out which could be the problem..
Dipak can you check if in DockerClientExecutor class in its constructor if this property is set?
El 15 mar. 2017 11:35 a. m., "Mauro Gómez Parada" notifications@github.com escribió:
Update:
As @lordofthejars https://github.com/lordofthejars said, I tried to Docker-Compose file but still failing. The error is a bit different, but seems that is ignoring the dockerRegistry property. My arquillian.xml:
1.12 false https://127.0.0.1:2376 DOCKER_CERT_PATH xx.yy.com:1234 xx xx mauro@xx.com src/test/resources/docker-compose.yml and the error is like that:
Caused by: com.github.dockerjava.api.exception.UnauthorizedException: Get https://registry-1.docker.io/v2/library/null/manifests/latest: unauthorized: incorrect username or password
at com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter.filter(ResponseStatusExceptionFilter.java:45) at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:140) at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:128) at org.glassfish.jersey.process.internal.Stages.process(Stages.java:171) at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:257) at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:701) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:228) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444) at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:697) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:448) at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:349) at com.github.dockerjava.jaxrs.async.POSTCallbackNotifier.response(POSTCallbackNotifier.java:29) at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:50) at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:24) ... 4 more
Starting with docker-compose works like a charm. I cannot figure out which could be the problem..
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arquillian/arquillian-cube/issues/632#issuecomment-286703479, or mute the thread https://github.com/notifications/unsubscribe-auth/ABcmYVZTRH0RBttMaN4el1CsPbZRm5UPks5rl78NgaJpZM4MdpvR .
@lordofthejars We are setting it inside DcokerClientExecutor class in it's constructor.
Ok, then maybe it is an error in docker-java library.
El 15 mar. 2017 11:50 a. m., "Dipak Pawar" notifications@github.com escribió:
@lordofthejars https://github.com/lordofthejars We are setting it inside DcokerClientExecutor class in it's constructor.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arquillian/arquillian-cube/issues/632#issuecomment-286706714, or mute the thread https://github.com/notifications/unsubscribe-auth/ABcmYaquQwdsOlke2xmgLYu4jMdqJQwvks5rl8JtgaJpZM4MdpvR .
I have found the bug. It is in our code. As a workaround you can do this https://github.com/docker-java/docker-java#properties-docker-javaproperties
wops, thanks @lordofthejars. Tomorrow I'll check it out.
Tomorrow I will also try to provide a PR with the fix.
@bartoszmajsak We should release alpha21 when this fixed since it is an important bug.
Any time you feel like it @lordofthejars
@mgparada I have pushed a new version of cube at https://github.com/lordofthejars/arquillian-cube/tree/issue-632 But the funny thing is that I have created an example of using another docker registry https://bintray.com/lordofthejars/continuous_delivery/lordofthejars%3Acomposer And I have not configured anything. I have not set the dockerRegistry
property and my docker-compose file just contained lordofthejars-docker-continuous_delivery.bintray.io/lordofthejars/composer:1.0.0-alpine
as the image to be used, and docker host automatically resolved to the other host and not docker.io.
Obviously your case is different since you are using a private repository. So what I would do is:
Clone https://github.com/lordofthejars/arquillian-cube Checkout the branch that is named issue-632. Run mvn install -DskipTests
and use this snapshot and setting dockerRegistry
, username
and password
of your private registry and of course using in docker compose the full path definition (host/namespace/container:version) form.
Thanks @lordofthejars! I'll check it out and i'll use this snapshot while the new release not coming out.
Basically before merging PR to upstream I want to validate that this fixes your problem since I have not been able to test exactly the same as your case
El 17 mar. 2017 9:55 a. m., "Mauro Gómez Parada" notifications@github.com escribió:
Thanks @lordofthejars https://github.com/lordofthejars! I'll check it out and i'll use this snapshot while the new release not coming out.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arquillian/arquillian-cube/issues/632#issuecomment-287300331, or mute the thread https://github.com/notifications/unsubscribe-auth/ABcmYYwrF8iJoiDHccsJoZ2ly68Ynk55ks5rmkqBgaJpZM4MdpvR .
Hi @lordofthejars, sorry for the delay! I'm trying this new version but still fails. I just find a problem parsing the image key, retrieved from the docker-compose file, and creating the Image object.
In Image.java class, inside the valueOf function, you're setting the image properties (nam & tag), but the switch does not contemplate some options.. in my case: my image url is something like:
registry.mauro.com:1234/my/custom/repo/myimage:latest
so as you are splitting by '/' this returns an array of 5 elements.. but there are no case for 5 elements.
Watching the code I see that you're assuming that the <organization_namespace>
is one word or something that does not contain /.. but i think that the common structure for the namespace is something like my/org/bucket
.
So, finally, the image, is creating with tag & name = null, the value which initializes these properties.
I have not seen any example like you mention before :) watching public docker repositories I have always seen the same pattern. Anyway, if it works on docker-machine
it means we need to add support as well. So from your previous example registry.mauro.com:1234
is the private host. my/custom/repo
is the organization, myimage
is the image name and latest
the tag right?
uhm.. yep, i'm watching and you're right! may be i should change my namespaces format... :)
Yes, in my case I using this format:
but i guess that version could be latest
or something like 1.2.3
, right?
yes, this is not a problem. But this format works on docker-machine right?
yep, it's working. I test it in docker > v1.12
ok, then we need to add this specific use case as well. Thank you so much.
Ok, perfect! Thank you so much for your work! ;-) If you need some test on it, just tell me something
@mgparada At https://github.com/arquillian/arquillian-cube/pull/640 you've got a version that works with multiple levels in organization name. Can you give it a try please? Tests passes, but what I would like to see is working with private registry :)
Yay! it's working now! Thx! ;)
Thank you very much for your patience and reporting the bug. Now it is merged and shipped in next release.
Issue Overview
I have an Arquillian Cube working building my own images, but some days ago I just config a private Registry (under ssl and with user&pass) and trying to pull the images from it, fails always.
PS: I can pull images from Registry manually ;-) So it's not a Registry misconfiguration or something like this.
Expected Behaviour
I expect that Arquillian downloads (pull) images from my own Registry, in order to use always a pre-build image.
Current Behaviour
When I execute the gradle task and the Arquillian Runner starts, configured to find the image from the Registry, it fails with some NullPointerExceptions.
Additional Information
The arquillian cube config:
I tried changing some parameters..
<property name="dockerRegistry">https://xx.yy.com:1234/v2</property>
,So, i've tried with some differents options but i cannot make it works.. The error is as follows:
Any kind of help would be appreciated! I didn't find many docs about it so I followed some examples to figure out how i should configure.
Thanks!