Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Get 500 error building image from Dockerfile, internally reports "not a valid repository/tag" #261

Closed
davidmichaelkarr opened this issue Aug 10, 2016 · 2 comments

Comments

@davidmichaelkarr
Copy link

I have a very simple Dockerfile, along with a very simple POM. I'm using a private enterprise registry.

The Dockerfile (in "src/docker") is just the following:
FROM tomee:8-jdk-7.0.0-webprofile
(Obviously, more will be added when I work through infrastructure issues.)

The POM is just this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>orderProcessingDashboard</groupId> <artifactId>ordersImage</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <build> <plugins> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <configuration> <registryUrl>http://<host>:5000</registryUrl> <dockerDirectory>src/docker</dockerDirectory> <imageName>ordersImage</imageName> </configuration> </plugin> </plugins> </build> </project>

When I run "mvn docker:build", I get this:

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.11:build (default-cli) on project ordersImage: Exception caught: Request error: POST unix://localhost:80/build?t=ordersImage: 500: HTTP 500 Internal Server Error -> [Help 1]

I then looked at /var/log/messages and found this line:

Aug 10 17:36:21 dockerd: time="2016-08-10T17:36:21.395888585-04:00" level=error msg="Handler for POST /build returned error: Error parsing reference: "ordersImage" is not a valid repository/tag"

It's definitely a problem that the Maven build didn't report the full error message. I don't know whether that's a problem with docker or the plugin. The bigger problem is understanding why it thinks the name I'm trying to create the image with is invalid.

@mattnworb
Copy link
Member

Hey @davidmichaelkarr thanks for the report. It is an issue within the plugin - I don't think it passes on the response body of the error response from Docker. I believe this is already captured in #119 so I will close this issue.

@davidmichaelkarr
Copy link
Author

Well, thanks, but it was pretty obvious to me that it wasn't passing on the response body. That should obviously be fixed, but that's not why I created this issue. My problem is WHY is it saying that "ordersImage" is an invalid image name? It says "is not a valid repository/tag". Even in your own docs you have a sample that uses an imageName value of "example". I'm fairly certain that if I set my imageName to "example" I would get a similar error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants