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

Simple example fails with "is not a valid repository/tag" #264

Closed
davidmichaelkarr opened this issue Aug 13, 2016 · 15 comments
Closed

Simple example fails with "is not a valid repository/tag" #264

davidmichaelkarr opened this issue Aug 13, 2016 · 15 comments

Comments

@davidmichaelkarr
Copy link

I originally filed this problem under #261 , but that was seen to be reporting a trivial problem that I don't care about, which had to do with passing full error information from docker to the plugin. I need to focus on my real problem that is causing the error, not with the plugin failing to report the full error message.

My current build is sort of like the example in the readme at "Use a Dockerfile", but even simpler than that.

My current 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://<enterprise registry host and port></registryUrl> <dockerDirectory>src/docker</dockerDirectory> <imageName>ordersImage</imageName> </configuration> </plugin> </plugins> </build> </project>

My src/docker/Dockerfile is just this:
FROM tomee:8-jdk-7.0.0-webprofile

When I run "mvn docker:build", I see the following in /var/log/messages:
Aug 13 09:23:23 wacdtl01dk068x dockerd: time="2016-08-13T09:23:23.364116278-07:00" level=error msg="Handler for POST /build returned error: Error parsing reference: \"ordersImage\" is not a valid repository/tag"

As you can see, comparing it to the example in the doc, my image name is "ordersImage", not "example", and I'm not copying any additional resources (yet).

Is the doc simply incorrect? What else could I be doing wrong?

@mattnworb
Copy link
Member

This sounds like it might be an issue with your version of Docker rather than the plugin. What version are you running?

For instance see

Do you get the same error if you create a Dockerfile and attempt to build and tag an image with the same name? This would rule out the plugin.

@davidmichaelkarr
Copy link
Author

I'm using Docker 1.12. No, I do not get the same error. As far as I remember, I don't get any error at all, although I don't know whether it succeeded, either. I can't check the results at this moment. I'll do that in a couple of hours and report back here.

@davidmichaelkarr
Copy link
Author

After getting my docker configuration working, I'm able to successfully build the image with "docker build", but "mvn docker:build" still fails with the same error.

@mattnworb
Copy link
Member

@davidmichaelkarr did you run just docker build or docker build -t orderImages to tag the image being built? Can you paste the full output from both your docker command and from the maven execution?

@davidmichaelkarr
Copy link
Author

Ah, I was only building the image, not tagging it. I then get the same error. This reminded me of something I read somewhere about the tag name not allowing uppercase characters. I changed the name to "ordersimage", and it worked perfectly fine. I need to review the details of that limitation. You'd think they would give you a TEENY bit more information about why it's invalid.

@mattnworb
Copy link
Member

Glad we at least figured out where the problem is coming from. I'll go ahead and close this then.

Layoric added a commit to NetCoreApps/Chat that referenced this issue Sep 22, 2016
@kisquish
Copy link

thanks for sharing.
It helped me solving the same pb

@dtzar
Copy link

dtzar commented Dec 22, 2016

Wow, yes I hit this too and this post helped me solve. IMO this is a bug. There should be a better error message or allow upper case letters! Perhaps even any documentation as such since https://docs.docker.com/engine/reference/commandline/tag/ says you can tag images with uppercase letters. build -t tags doesn't follow that same logic

@colynn
Copy link

colynn commented Aug 29, 2017

the tag name not allowing uppercase characters.

Or current docker version not support multiple stages build.

@forging2012
Copy link

UPDATE DOCKER to 17.05+ is ok.

@rustyx
Copy link

rustyx commented Jun 1, 2018

Also note that multistage builds (FROM xxx as yyy) are supported from Docker 17.05 onwards.

In an older dockerd that can also lead to a very similar error message. For example:

Error parsing reference: "golang:latest as builder" is not a valid repository/tag: invalid reference format

Source: https://docs.docker.com/engine/userguide/eng-image/multistage-build/

Multi-stage builds are a new feature requiring Docker 17.05 or higher on the daemon and client.

@zengguoqin
Copy link

zengguoqin commented Jun 3, 2018

Same problem, Update DOCKER to 17.05+ is ok.

@r3lik
Copy link

r3lik commented Aug 3, 2018

this is an issue on 1.13.1

See 'docker --help'
root@fullnode3:~/fullnodes/zec/docker# docker version
Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.6.2
 Git commit:   092cba3
 Built:        Thu Nov  2 20:40:23 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.6.2
 Git commit:   092cba3
 Built:        Thu Nov  2 20:40:23 2017
 OS/Arch:      linux/amd64
 Experimental: false

@nshampur
Copy link

observing the same

@veenalv
Copy link

veenalv commented Feb 13, 2019

this is an issue on 1.13.1

See 'docker --help'
root@fullnode3:~/fullnodes/zec/docker# docker version
Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.6.2
 Git commit:   092cba3
 Built:        Thu Nov  2 20:40:23 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.6.2
 Git commit:   092cba3
 Built:        Thu Nov  2 20:40:23 2017
 OS/Arch:      linux/amd64
 Experimental: false

yep, this was my issue!

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