12

I am trying to build my image using this plugin: https://github.com/spotify/docker-maven-plugin#use-a-dockerfile

When I run mvn clean package docker:build

I get this error:

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.2.3:build (defa
ult-cli) on project demo: Exception caught: Request error: POST https://192.168.
99.100:2376/v1.12/build?t=DevOpsClient: 500: HTTP 500 Internal Server Error -> [
Help 1]

When I check the docker daemon logs, I see this:

Handler for POST /build returned error: repository name component must match \"[a-z0-9]+(?:[._-][a-z0-9]+)*\"" statusCode=500

Here is the doc for the naming convention: https://docs.docker.com/registry/spec/api/

Apparently you cannot have any upper case letters.

I am trying to build using Spring boot my following this guide: https://spring.io/guides/gs/spring-boot-docker/

I am using a SNAPSHOT release of spring boot and I have a directory named demo-0.1.1-SNAPSHOT. I believe this may be causing the problem.

Also I am working on windows and my project directory path is like:

C:\Users\myname\UserRegistrationClient\git\..... etc

Would this also affect the repository naming convention?

And how would I change it?

Rico
  • 58,485
  • 12
  • 111
  • 141
Kingamere
  • 9,496
  • 23
  • 71
  • 110
  • What did you specify as the docker image name? Usually docker images are identified by tags in the format [/]/:. So if docker complains about the repository name I do assume you have some issues with the repo which should not be necessary as long as you don't want to push it to a central location. – daniel.eichten Aug 14 '15 at 16:52
  • I just called the image DevOpsClient, you think thats the problem? – Kingamere Aug 14 '15 at 17:39
  • Oh no I am actually not trying to push it anywhere. In fact, this problem occurs when trying to BUILD the image. – Kingamere Aug 14 '15 at 17:46
  • 1
    Yes makes sense cause the build is being tagged during build. Which also includes the name. If you check the images in the public registry youll see that these dont have any uppercase names. Just rename to devopsclient or dev-ops-client and you are good. – daniel.eichten Aug 14 '15 at 17:57

1 Answers1

24

So this regular expression: [a-z0-9]+(?:[._-][a-z0-9]+)* doesn't include any upper case letters. So you should change your image name to devopsclient

Rico
  • 58,485
  • 12
  • 111
  • 141
  • Oh wow thanks to both of you this solution worked. But how did you know it was the image name and not the actual path that was the problem? – Kingamere Aug 14 '15 at 18:10
  • 1
    @Ikshvaku the error shows repository name. The repository name matches the image name. – Rico Aug 14 '15 at 18:33
  • 1
    I did not get the same error message. But the solution was to change all letters to lowercase inside the tag. Thanks a lot. – Avec Oct 01 '16 at 02:31