【发布时间】:2021-02-27 02:54:11
【问题描述】:
使用 Spring Boot 2.4.0,我正在尝试配置 spring-boot:build-image 任务以将图像推送到我的私有 GitHub 容器注册表。
我使用these instructions来配置我的POM如下:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<name>ghcr.io/abc/${project.artifactId}:${project.version}</name>
<publish>true</publish>
</image>
<docker>
<publishRegistry>
<username>abc</username>
<token>mytoken</token>
<url>https://ghcr.io</url>
</publishRegistry>
</docker>
</configuration>
</plugin>
当我执行spring-boot:build-image 任务时,它会构建图像,但在尝试推送时出现以下错误:
[INFO] Successfully built image 'ghcr.io/abc/def:1.5.0'
[INFO]
[INFO] > Pushing image 'ghcr.io/abc/def:1.5.0' 100%
Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.4.0:build-image failed: Error response received when pushing image: error parsing HTTP 405 response body: unexpected end of JSON input: "" -> [Help 1]
我可以使用docker push 手动推送图像,并且我尝试过使用docker login 也无济于事。我也不在任何防火墙或代理后面。
【问题讨论】:
标签: spring-boot docker spring-boot-maven-plugin