Couldn't docker:push image to OSEv3 (403 error)

51 views
Skip to first unread message

An N.

unread,
Jul 18, 2015, 12:46:33 PM7/18/15
to fab...@googlegroups.com
I'm trying to create a custom demo to illustrate the whole fabric8 build/deploy/run process to OSEv3 with 2 plugins docker-maven-plugins (org.jolokia)  & fabric8-maven-plugin (io.fabric8)

The build was complete successfully with below command 
# mvn clean install docker:build
where I can see the .zip created at /target/seminar-rest-1.0.0-image.zip

But I'm quite puzzled on the next step which is supposed to push the build to OSEv3's docker repository.
The 'mvn docker:push' doesn't seem to work for me ... it always shows me 403 error in regardless of docker.username & docker.password given. (log attached)

Caused by: org.apache.maven.plugin.MojoExecutionException: Error: Status 403 trying to push repository demo/seminar-rest: "{\n  \"kind\": \"Status\",\n  \"apiVersion\": \"v1\",\n  \"metadata\": {},\n  \"status\": \"Failure\",\n  \"message\": \"User \\\"system:anonymous\\\" cannot \\\"put\\\" on \\\"/v1/repositories/demo/seminar-rest/\\\"\",\n  \"reason\": \"Forbidden\",\n  \"details\": {},\n  \"code\": 403\n}" 
at org.jolokia.docker.maven.AbstractDockerMojo.execute(AbstractDockerMojo.java:137)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: org.jolokia.docker.maven.access.DockerAccessException: Error: Status 403 trying to push repository demo/seminar-rest: "{\n  \"kind\": \"Status\",\n  \"apiVersion\": \"v1\",\n  \"metadata\": {},\n  \"status\": \"Failure\",\n  \"message\": \"User \\\"system:anonymous\\\" cannot \\\"put\\\" on \\\"/v1/repositories/demo/seminar-rest/\\\"\",\n  \"reason\": \"Forbidden\",\n  \"details\": {},\n  \"code\": 403\n}" 
at org.jolokia.docker.maven.access.chunked.PullOrPushResponseHandler.process(PullOrPushResponseHandler.java:39)
at org.jolokia.docker.maven.access.chunked.PullOrPushResponseHandler.process(PullOrPushResponseHandler.java:7)
at org.jolokia.docker.maven.access.chunked.TextToJsonBridgeCallback.process(TextToJsonBridgeCallback.java:23)
at org.jolokia.docker.maven.access.chunked.TextToJsonBridgeCallback.process(TextToJsonBridgeCallback.java:9)
at org.jolokia.docker.maven.access.chunked.ChunkedResponseReader.process(ChunkedResponseReader.java:25)
at org.jolokia.docker.maven.access.hc.DockerAccessWithHcClient.processChunkedResponse(DockerAccessWithHcClient.java:472)
at org.jolokia.docker.maven.access.hc.DockerAccessWithHcClient.pushImage(DockerAccessWithHcClient.java:243)
at org.jolokia.docker.maven.PushMojo.executeInternal(PushMojo.java:30)
at org.jolokia.docker.maven.AbstractDockerMojo.execute(AbstractDockerMojo.java:135)
... 22 more


** Due to this, the 'mvn fabric8:json fabric8:apply' couldn't start the application properly with error 
Failed to pull image "demo/seminar-rest:1.0.0": Error: image demo/seminar-rest:1.0.0 not found

I'm pretty sure that I'm missing some things, but perhaps I'm not experienced enough with the 2 plugins.
Much appreciate if someone can shed some lights on this.

Thank you in advance.

Regards,
-An






push.log

An N.

unread,
Jul 18, 2015, 9:23:49 PM7/18/15
to fab...@googlegroups.com
I've made some changes to Docker's & Kubernetes's setting at environment


It now shows some progress, but got stuck at resolving fabric8/tomcat-8.0 image.
[INFO] DOCKER> ... Pulling repository docker.io/fabric8/tomcat-8.0
[DEBUG] http-outgoing-0 << "7f[\r][\n]"
[DEBUG] http-outgoing-0 << "{"errorDetail":{"message":"Error: image fabric8/tomcat-8.0: not found"},"error":"Error: image fabric8/tomcat-8.0: not found"}[\r][\n]"
[DEBUG] http-outgoing-0 << "[\r][\n]"
[DEBUG] http-outgoing-0 << "0[\r][\n]"
[DEBUG] http-outgoing-0 << "[\r][\n]"
[ERROR] DOCKER> Error: image fabric8/tomcat-8.0: not found
[DEBUG] Connection [id: 0][route: {}->unix://127.0.0.1:1] can be kept alive indefinitely
[DEBUG] Connection released: [id: 0][route: {}->unix://127.0.0.1:1][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]

Even though, the image has been pulled to the host successfully
$ docker images | grep fabric8
fabric8/tomcat-8.0                 latest              7788957928f1        4 weeks ago         1.046 GB

Any idea ?

An N.

unread,
Jul 19, 2015, 4:47:25 AM7/19/15
to fab...@googlegroups.com
Managed to workaround the issue by running docker's registry (i.e. docker run -p 5000:5000 registry)

The build and push images built, before it's getting pulled by OpenShift v3
mvn clean install docker:build
mvn -Ddocker.registry=127.0.0.1:5000 docker:push
Reply all
Reply to author
Forward
0 new messages