Search code examples
mavendockerspring-bootmicroservicesmaven-docker-plugin

Docker mvn plugin make {}->unix://localhost:80: Broken pipe


I implement application using spring-boot and try to build docker image using this mvn plugin.

<plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>dockerfile-maven-plugin</artifactId>
                <version>1.3.6</version>
                <executions>
                    <execution>
                        <id>default</id>
                        <phase>install</phase>
                        <goals>
                            <goal>build</goal>
                            <!-- <goal>push</goal> -->
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <repository>${docker.image.prefix}/${project.artifactId}</repository>

                    <buildArgs>
                        <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
                    </buildArgs>
                </configuration>
            </plugin>

If i try to build this using mvn clean install and it make below error.

    Caused by: java.io.IOException: Broken pipe
    at jnr.enxio.channels.NativeSocketChannel.write(NativeSocketChannel.java:93)
    at java.nio.channels.Channels.writeFullyImpl(Channels.java:78)
    at java.nio.channels.Channels.writeFully(Channels.java:98)
    at java.nio.channels.Channels.access$000(Channels.java:61)
    at java.nio.channels.Channels$1.write(Channels.java:174)
    at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:124)
    at org.apache.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:136)
    at org.apache.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:167)
    at ……………………..
org.apache.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:179)
        at 
    [INFO] Building Docker context /Users/thamira/ProjectFolder/finalresearch/cloud-microservice-projet-eureka
    [INFO] 
    [INFO] Image will be built as springio/cloud-microservice-projet-Eureka:latest
    [INFO] 
    Apr 18, 2018 6:56:20 PM org.apache.http.impl.execchain.RetryExec execute
    INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Broken pipe

how can i solve this problem.


Solution

  • check ${project.artifactId} name. it contain capital words."Eureka" it make error for you.

    [INFO] Image will be built as springio/cloud-microservice-projet-Eureka:latest
    

    change it to cloud-microservice-projet-eureka

    problem in here is image name, was in capital letter and docker doesnt allow image names having caps