Maven: docker-maven-plugin — Exception caught: Request error: POST HTTP 500 Internal Server Error

Автор: | 21/10/2016
 

apache_maven_logoВо время сборки проекта — билд образа с помощью плагина docker-maven-plugin падает с ошибкой:

 


[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 19.379 s
[INFO] Finished at: 2016-10-21T09:31:31+00:00
[INFO] Final Memory: 76M/562M
[INFO] ————————————————————————
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.10:build (default) on project oauth2-authserver: Exception caught: Request error: POST unix://localhost:80/build?t=project.jfrog.io/project-oauth2-authserver:stg-hotfix/LTHS-116-79: 500: HTTP 500 Internal Server Error -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.spotify:docker-maven-plugin:0.4.10:build (default) on project oauth2-authserver: Exception caught

Лог Docker сообщает:

time=»2016-10-21T11:25:52.722984400Z» level=error msg=»Handler for POST /build returned error: Error parsing reference: \»project-tag-docker.jfrog.io/project-oauth2-authserver:stg-hotfix/LTHS-116-80\» *is not a valid repository/tag*»

Причина в теге образа — stg-hotfix/LTHS-116-80, а именно — в наличии слеша в его имени.

Тег подставляется во время сборки автоматически, из имени бранча:

...
-Ddocker.image.tag=\"stg-${BRANCH}-${env.BUILD_NUMBER}\"
...

После того, как бранч перенесли из hotfix/FLTHS-116 в корень — FLTHS-116 — билд поднялся.