Jib: can not push to harbor

Created on 16 Jul 2018  ·  13Comments  ·  Source: GoogleContainerTools/jib

mvn compile jib:build is success, but there is no image existed in harbor.

environment

  1. os = mac
  2. ide = idea

plugin config

                <plugin>
                    <groupId>com.google.cloud.tools</groupId>
                    <artifactId>jib-maven-plugin</artifactId>
                    <version>0.9.6</version>
                    <configuration>
                        <allowInsecureRegistries>true</allowInsecureRegistries>
                        <from>
                            <image>harbor.test.ximalaya.com/test/jdk8-tomcat8</image>
                        </from>
                        <to>
                            <image>harbor.test.ximalaya.com/test/jib-demo</image>
                        </to>
                        <container>
                            <mainClass>org.apache.catalina.startup.Bootstrap</mainClass>
                            <args>
                                <arg>start</arg>
                            </args>
                        </container>

                    </configuration>
                </plugin>

maven settings

      <server>
        <id>harbor.test.ximalaya.com</id>
        <username>admin</username>
        <password>mypassword</password>
      </server>

mvn compile jib:build output

[INFO] Retrieving registry credentials for harbor.test.ximalaya.com...
[INFO] Getting base image harbor.test.ximalaya.com/test/jdk8-tomcat8...
[INFO] Building dependencies layer...
[INFO] Building resources layer...
[INFO] Building classes layer...
[INFO] Retrieving registry credentials for harbor.test.ximalaya.com...
[INFO] Finalizing...
[INFO] 
[INFO] Container entrypoint set to [java, -cp, /app/libs/*:/app/resources/:/app/classes/, org.apache.catalina.startup.Bootstrap]
[INFO] 
[INFO] Built and pushed image as harbor.test.ximalaya.com/test/jib-demo

Most helpful comment

@cai0329 looking at the logs and your configuration, I believe you are pulling/pushing to a private repo, serving at port 5000. We currently have a few relevant issues:

  1. If the port 5000 of the repo is HTTPS, the current design of Jib requires that the repo have a valid, trusted certificate. If you are using a self-signed certificate, you need a workaround for the moment: #543 UPDATE: #643 will fix this.
  2. If the port 5000 is HTTP and requires authenthication, there is no way to make it work at the moment, unfortunately. By the current design, Jib does not send the password over HTTP, where other parties in the network can see. UPDATE: #641 added the system property sendCredentialsOverHttp, with which you can force sending the password over HTTP.

We are discussing what would be the ideal ways to handle these scenarios.

All 13 comments

same as your maven config, I received this error. did you meet this?
image

@cai0329 I meet this, but the reason for that is the error password

@cai0329 do you happen to be storing your password in encrypted form in your Maven settings? If so, we're patching a fix for that: #592

@qiankunli Thanks for reporting this issue! We'll take a look at investigating this. @GoogleContainerTools/java-tools

@coollog either encrypted or not encrtpted it is the same error. the config is below:
image
image

I can login in that use username and password defined in the maven config:
image

@cai0329 looking at the logs and your configuration, I believe you are pulling/pushing to a private repo, serving at port 5000. We currently have a few relevant issues:

  1. If the port 5000 of the repo is HTTPS, the current design of Jib requires that the repo have a valid, trusted certificate. If you are using a self-signed certificate, you need a workaround for the moment: #543 UPDATE: #643 will fix this.
  2. If the port 5000 is HTTP and requires authenthication, there is no way to make it work at the moment, unfortunately. By the current design, Jib does not send the password over HTTP, where other parties in the network can see. UPDATE: #641 added the system property sendCredentialsOverHttp, with which you can force sending the password over HTTP.

We are discussing what would be the ideal ways to handle these scenarios.

@qiankunli's original issue was the user misconfiguration, but surprisingly, it seems like there was no error

@chanseokoh but i can not find image harbor.test.ximalaya.com/test/jib-demo in harbor, and there is not enough log to debug

@qiankunli oh, sorry, looks like I got it wrong. Now I see you encountered your original issue after you provided a correct password. Please disregard my comments above.

@chanseokoh You are right, when I use https it works correctly.

@cai0329 I saw you edited your comment. Is it all working now? What was the cause of the problem that you didn't see the image in the harbor repo?

@chanseokoh The harbor ui delayed show the image. I think it is the problem of harbor. Thank you again!

@cai0329 Glad your issue was solved!
@qiankunli Is your issue still occurring?

@coollog it works in 0.9.7 thank you!

Was this page helpful?
0 / 5 - 0 ratings