docker-maven-plugin icon indicating copy to clipboard operation
docker-maven-plugin copied to clipboard

User could be warned if an illegal image name is specified

Open michael-borkowski opened this issue 9 years ago • 2 comments
trafficstars

Description

I have struggled for some time now with a strange problem, where mvn docker:build failed; amongst the error output, "Connection Reset" was found. I finally figured out what caused the issue: My maven project's artifact ID had upper-case letters in it, and I am using ${myPrefix}/${project.artifactId} as the image name. However, docker seems to not allow upper-case letters for images names.

Not only was I aware of this limitation, I got a confusing error message. It would increase usability and reduce frustration if a check for the repository name was performed by the plug-in, or at least the error message coming from docker (which I see in the docker logs: Handler for POST /build returned error: Invalid repository name (myProject), only [a-z0-9-_.] are allowed) somehow shown in the output.

How to reproduce

  • Specify upper-case letters as an image name
  • mvn package docker:build

What do you expect

An error message notifying me of the fact hat docker does not allow upper-case letters as an image name, be it coming from the plugin or from docker itself.

What happened instead

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.3:build (default-cli) on project myProject: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.client.ClientProtocolException: Cannot retry request with a non-repeatable request entity: Connection reset by peer -> [Help 1]

Software:

  • docker version: client 1.6.2, server 1.6.2
  • docker-maven-plugin version: 0.4.3
  • maven version: 3.3.3

michael-borkowski avatar Mar 18 '16 11:03 michael-borkowski

I think this is more of an issue with https://github.com/spotify/docker-client/ than this plugin. The client checks if the name of a container is valid when creating or renaming a container, but doesn't have similar checks when building an image.

mattnworb avatar Mar 23 '16 19:03 mattnworb

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 11 '18 13:09 stale[bot]