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

can not push to harbor #625

Closed
qiankunli opened this issue Jul 16, 2018 · 13 comments
Closed

can not push to harbor #625

qiankunli opened this issue Jul 16, 2018 · 13 comments

Comments

@qiankunli
Copy link

qiankunli commented Jul 16, 2018

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
@cai0329
Copy link

cai0329 commented Jul 16, 2018

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

@qiankunli
Copy link
Author

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

@coollog
Copy link
Contributor

coollog commented Jul 16, 2018

@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

@cai0329
Copy link

cai0329 commented Jul 17, 2018

@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

@chanseokoh
Copy link
Member

chanseokoh commented Jul 17, 2018

@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: Support for self signed certificates #543 UPDATE: Make allowInsecureRegistries follow Docker semantics for use-insecure-registries #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: Allow authentication over HTTP using system property #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.

@chanseokoh
Copy link
Member

chanseokoh commented Jul 17, 2018

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

@qiankunli
Copy link
Author

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

@chanseokoh
Copy link
Member

@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.

@cai0329
Copy link

cai0329 commented Jul 18, 2018

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

@chanseokoh
Copy link
Member

@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?

@cai0329
Copy link

cai0329 commented Jul 20, 2018

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

@coollog
Copy link
Contributor

coollog commented Jul 20, 2018

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

@coollog coollog closed this as completed Jul 20, 2018
@qiankunli
Copy link
Author

@coollog it works in 0.9.7 thank you!

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

4 participants