GoogleContainerTools / jib

🏗 Build container images for your Java applications.
Apache License 2.0
13.58k stars 1.43k forks source link

stuck at 40,0% complete #4289

Closed Christian-Lange-ext-deka closed 1 month ago

Christian-Lange-ext-deka commented 1 month ago

Environment:

Description of the issue:

execution of mvn compile jib:dockerBuild stucks at

[INFO] Executing tasks:
[INFO] [============                  ] 40,0% complete
[INFO] > building image to Docker daemon

Expected behavior:

build an image or at least finish with an error message

Steps to reproduce:

jib-maven-plugin Configuration:

<?xml version="1.0" encoding="UTF-8"?>

<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>cl</groupId>
    <artifactId>jib-example</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <mockito-version>5.12.0</mockito-version>
        <jib.version>3.4.3</jib.version>
        <jib.from.openjdk.version>17-jdk-alpine</jib.from.openjdk.version>
        <jib.from.prefix>openjdk</jib.from.prefix>
        <jib.to.prefix>cl-test</jib.to.prefix>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>${jib.version}</version>
                <configuration>
                    <from>
                        <image>${jib.from.prefix}/openjdk:${jib.from.openjdk.version}</image>
                    </from>
                    <to>
                        <image>${jib.to.prefix}/poc-cl:${project.version}</image>
                    </to>
                    <container>
                        <appRoot>/app</appRoot>
                        <user>1001</user>
                    </container>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Log output:

Additional Information:

with mvnDebug I've seen that I stuck in line of file ProcessImpl.java

  @Override
  public DockerInfoDetails info() throws IOException, InterruptedException {
    // Runs 'docker info'.
    Process infoProcess = docker("info", "-f", "{{json .}}");
    if (infoProcess.waitFor() != 0) { // here it waits forever
      throw new IOException(
          "'docker info' command failed with error: " + getStderrOutput(infoProcess));
    }
    return JsonTemplateMapper.readJson(infoProcess.getInputStream(), DockerInfoDetails.class);
  }
mpeddada1 commented 1 month ago

@Christian-Lange-ext-deka thank you for reporting this. Unfortunately, this is a known issue that was introduced in 3.4.3. Closing as duplicate of https://github.com/GoogleContainerTools/jib/issues/4267. Please follow the linked thread for updates on the fix and as a workaround please use 3.4.2 if this is blocking you. Apologies for the inconvenience!