google jib maven plugin, Build image failed初步解决

D:\source\guns\guns-admin>mvn compile jib:build

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building guns-admin 1.0.0

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ guns-admin ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 181 resources

[INFO] Copying 4 resources

[INFO] Copying 10 resources

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ guns-admin ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- jib-maven-plugin:0.9.8:build (default-cli) @ guns-admin ---

[WARNING] 'mainClass' is not a valid Java class : ${start-class}

[WARNING] Base image 'gcr.io/distroless/java' does not use a specific image digest - build may not be reproducible

[INFO]

[INFO] Containerizing application to XXXX.XXX.XX.XX:9981/spring/guns-admin:0.1...

[INFO]

[INFO] Retrieving registry credentials for XXXX.XXX.XX.XX:9981...

[INFO] Building classes layer...

[INFO] Building resources layer...

[INFO] Building dependencies layer...

[INFO] Getting base image gcr.io/distroless/java...

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 29.406 s

[INFO] Finished at: 2018-08-16T17:29:27+08:00

[INFO] Final Memory: 35M/321M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.8:build (default-cli) on project guns-admin: Build image failed: Connect to gcr.io/108.177.125.82:443 timed out -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException



通过设置代理的方法还是没有解决

用了设置代理 set HTTP_PROXY=http://127.0.0.1:1080

根据 Build image failed #544 的描述,from 镜像改用openjdk:8-jre-alpine,在auth设置hub.docker.com账户信息。

由于我配置的私有镜像仓库没有设置https,所以设置<allowInsecureRegistries>true</allowInsecureRegistries>


再重新运行mvn compile jib:build,即可build成功了。

D:\source\guns\guns-admin>mvn compile jib:build

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building guns-admin 1.0.0

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ guns-admin ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 181 resources

[INFO] Copying 4 resources

[INFO] Copying 10 resources

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ guns-admin ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- jib-maven-plugin:0.9.8:build (default-cli) @ guns-admin ---

[WARNING] 'mainClass' is not a valid Java class : ${start-class}

[INFO]

[INFO] Containerizing application to XXXX.XXX.XX.XX:9981/guns-admin:0.1...

[INFO]

[INFO] Retrieving registry credentials for XXXX.XXX.XX.XX:9981...

[INFO] Getting base image openjdk:8-jre-alpine...

[INFO] Building dependencies layer...

[INFO] Building classes layer...

[INFO] Building resources layer...

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/ over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256:0450804ad14e232495e648ac35e90c6ddb1ab5355ddbbe3dadfd77de1cd15af6 over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256

:0450804ad14e232495e648ac35e90c6ddb1ab5355ddbbe3dadfd77de1cd15af6

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256:01d060ececba83405757973c2f0c65c70eef1cac19f020f8f9e8b4d437d834d6 over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256

:01d060ececba83405757973c2f0c65c70eef1cac19f020f8f9e8b4d437d834d6

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/ over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/ over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256:ee8c19e4413e85cd4fc9f8c34870d66c1014d8294a6945e478d5ccd5cbdc088d over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256

:ee8c19e4413e85cd4fc9f8c34870d66c1014d8294a6945e478d5ccd5cbdc088d

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/ over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/

[INFO] The base image requires auth. Trying again for openjdk:8-jre-alpine...

[INFO] Retrieving registry credentials for registry.hub.docker.com...

[INFO] Finalizing...

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256:8e3ba11ec2a2b39ab372c60c16b421536e50e5ce64a0bc81765c2e38381bcff6 over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256

:8e3ba11ec2a2b39ab372c60c16b421536e50e5ce64a0bc81765c2e38381bcff6

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256:391a6a6b36513d84d55cbbe7e13bca7e92fbf257d910a5255f2b7bc9fcff4edf over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256

:391a6a6b36513d84d55cbbe7e13bca7e92fbf257d910a5255f2b7bc9fcff4edf

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256:311ad0da45338842480bf25c6e6b7bb133b7b8cf709c3470db171ec370da5539 over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256

:311ad0da45338842480bf25c6e6b7bb133b7b8cf709c3470db171ec370da5539

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/ over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/ over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/ over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256:eb147fcb3225e019310856d267dfc7e5f25e4708d9f438ab6f3189ced773451f over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/sha256

:eb147fcb3225e019310856d267dfc7e5f25e4708d9f438ab6f3189ced773451f

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/ over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/blobs/uploads/

[WARNING] Failed to connect to https://XXXX.XXX.XX.XX:9981/v2/guns-admin/manifests/0.1 over HTTPS. Attempting again with HTTP: http://XXXX.XXX.XX.XX:9981/v2/guns-admin/manifests/0.1

[INFO]

[INFO] Container entrypoint set to [java, -cp, /app/libs/*:/app/resources/:/app/classes/, ${start-class}]

[INFO]

[INFO] Built and pushed image as ?[36mXXXX.XXX.XX.XX:9981/guns-admin:0.1?[0m

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 28.296 s

[INFO] Finished at: 2018-08-17T15:27:36+08:00

[INFO] Final Memory: 44M/330M

[INFO] ------------------------------------------------------------------------




私有镜像仓库中信息




要点小结:

1. 由于gcr.io被墙,gcr.io/distroless/java镜像不得到,建议用openjdk:8-jre-alpine代替

2. 如果私有镜像仓库没有启用https,设置allowInsecureRegistries参数为true

我的jib maven plugin配置如下


©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,293评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,604评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,958评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,729评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,719评论 5 366
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,630评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,000评论 3 397
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,665评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,909评论 1 299
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,646评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,726评论 1 330
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,400评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,986评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,959评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,197评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 44,996评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,481评论 2 342

推荐阅读更多精彩内容

  • # Python 资源大全中文版 我想很多程序员应该记得 GitHub 上有一个 Awesome - XXX 系列...
    aimaile阅读 26,440评论 6 428
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,594评论 18 139
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,396评论 2 45
  • 【奇迹日记】第1天: 1.对于这个问题我的渴望解决程度是几分?10分 目前的把握度是几分?4分 2.我觉得当一个人...
    瑜缘阅读 413评论 0 2
  • 你期待遇见什么样的爱情?一见钟情还是日久生情?一见钟情。没有考虑过日久生情吗?不,我还是相信一见钟情。三年之后。你...
    漠郴江阅读 777评论 0 0