-
Notifications
You must be signed in to change notification settings - Fork 490
Error building image #25
Comments
does |
Yes there is a Dockerfile sitting in ${project.basedir} , this is the reason why building the image using docker works ok. |
I'm seeing the same thing as well: EnvironmentOS: MacOS Sierra 10.12.5 Maven config<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven.version}</version>
<configuration>
<repository>cordiance-config-admin</repository>
<tag>${project.version}</tag>
<contextDirectory>${project.basedir}</contextDirectory>
<verbose>true</verbose>
<writeTestMetadata>false</writeTestMetadata>
<contextDirectory>${project.basedir}</contextDirectory>
</configuration>
<executions>
<execution>
<id>default</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin> Test Output$ curl -v --unix-socket /var/run/docker.sock "http:/v1.24/_ping"
* Unwillingly accepted illegal URL using 1 slash!
* Trying /var/run/docker.sock...
* Connected to v1.24 (/Users/mustafa/Library/Containers/com.docker.) port 80 (#0)
> GET /_ping HTTP/1.1
> Host: v1.24
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Api-Version: 1.27
< Content-Length: 2
< Content-Type: text/plain; charset=utf-8
< Date: Mon, 19 Jun 2017 16:16:23 GMT
< Docker-Experimental: true
< Server: Docker/17.03.1-ce (linux)
<
* Curl_http_done: called premature == 0
* Connection #0 to host v1.24 left intact
OK
$ curl -v --unix-socket /var/run/docker.sock http:/_ping
* Unwillingly accepted illegal URL using 1 slash!
* Rebuilt URL to: http://_ping/
* Trying /var/run/docker.sock...
* Connected to _ping (/Users/mustafa/Library/Containers/com.docker.) port 80 (#0)
> GET / HTTP/1.1
> Host: _ping
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Length: 29
< Content-Type: application/json
< Date: Mon, 19 Jun 2017 16:17:20 GMT
<
{"message":"page not found"}
* Curl_http_done: called premature == 0
* Connection #0 to host _ping left intact |
Is there any current workaround to this issue ? or any rollback version that doesnt run to this issue? |
Is it possible to create a minimal repo that would reproduce this error? It is not really clear what the cause is - the docker daemon error message seems to indicate there is no Dockerfile in the context directory. |
I created a sample repo at https://github.com/mashurex/dockerfile-maven-issue-repro that reproduces the issues I'm seeing. |
@mashurex in that repo your
and thus the Dockerfile in the project root is not sent in the Docker context. If you remove that line from the .dockerignore then the image is built fine for me. Are you expecting the @osvacaneljr @ganeshm25 what does your |
The ** entry was an artifact as I was trying to quickly make a sample repo. However, if you run EDIT: I didn't read your previous comment close enough. |
Right, it seems like But, do you need Just to be clear, I am not able to reproduce the error if I remove the
Building fine with no .dockerignore:
With the original .dockerignore:
|
@mattnworb I didn't need the |
@mattnworb I just updated the readme on the repro repo to explain what you found and describe the situation. Thanks for your help in figuring this out- I was definitely in the 'we need a new pair of eyes' phase of figuring it out. |
Just for one more datapoint, the commit at mashurex/dockerfile-maven-issue-repro@9f54b77 builds fine for me via |
This is how the .dockerignore file looked #some comments By removing the second line, everything worked as expected. |
I had the following problem at my end. In my dockerfile, the maintainer was mis-spelled. |
Environemnt
Docker for Mac, v 17.0.3.1
Maven, v 3.5.0
Java, v 1.8.0_131
pom.xml,
Building the image from the console using,
docker -D build -t xxxxx:1.x.x-SNAPSHOT . --> OK
mvn -X dockerfile:build --> ERROR
i think it is the same issue as this one,
spotify/docker-client#479
but setting the $DOCKER_HOST environment variable to unix:///var/run/docker.sock does not fix the problem,
ran the following command,
but ran this other one
curl --unix-socket /var/run/docker.sock "http:/v1.24/_ping" --> OK
Any idea on how to fix the issue?
The text was updated successfully, but these errors were encountered: