spotify / docker-maven-plugin

INACTIVE: A maven plugin for Docker
Apache License 2.0
2.66k stars 575 forks source link

I am using docker maven plugin and I made intentionally error in application (bean creation exception) but always I am getting error in generic was saying Docker IO error [ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.32.0:start (docker-start) on project captcha-validator-integration-test: I/O Error: [***.azurecr.io/ssib/captcha-validator-service:1.2.0-SNAPSHOT] "service-captcha-validator": Timeout after 120460 ms while waiting on log out 'Started CaptchaValidatorApplication' -> [Help 1] [ERROR] [ERROR] How to display actual error in logs? #463

Open amarsha opened 2 years ago

amarsha commented 2 years ago
<profile>
            <id>docker</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>docker-random-ports</id>
                                <goals>
                                    <goal>reserve-network-port</goal>
                                </goals>
                                <phase>process-resources</phase>
                                <configuration>
                                    <portNames>
                                        <portName>api.port</portName>
                                        <portName>hcaptcha.port</portName>
                                    </portNames>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <configuration>
                            <autoCreateCustomNetworks>true</autoCreateCustomNetworks>
                            <images>
                                <image>
                                    <name>${container.registry}/${container.repositorybase}/captcha-validator-service:${project.version}</name>
                                    <alias>service-${docker-container-unique-tag}</alias>
                                    <run>
                                        <network>
                                            <name>network-${docker-container-unique-tag}</name>
                                            <alias>service</alias>
                                        </network>
                                        <namingStrategy>alias</namingStrategy>
                                        <ports>
                                            <port>${api.port}:8080</port>
                                        </ports>
                                        <wait>
                                            <log>Started CaptchValidatorApplication
                                            </log>
                                            <time>120000</time>
                                        </wait>
                                        <dependsOn>
                                            <dependsOn>wiremock-hcaptcha-${docker-container-unique-tag}</dependsOn>
                                        </dependsOn>
                                        <env>
                                            <HCAPTCHASERVICEHOST>http://wiremock-hcaptcha:8080</HCAPTCHASERVICEHOST>
                                        </env>
                                        <log>
                                            <color>blue</color>
                                        </log>
                                    </run>
                                </image>
                                <image>
                                    <name>${container.registry}/rodolpheche/wiremock:latest</name>
                                    <alias>wiremock-hcaptcha-${docker-container-unique-tag}</alias>
                                    <run>
                                        <network>
                                            <name>network-${docker-container-unique-tag}</name>
                                            <alias>wiremock-hcaptcha</alias>
                                        </network>
                                        <namingStrategy>alias</namingStrategy>
                                        <ports>
                                            <port>${hcaptcha.port}:8080</port>
                                        </ports>
                                        <volumes>
                                            <bind>
                                                <volume>${project.basedir}/src/test/resources/:/home/wiremock</volume>
                                            </bind>
                                        </volumes>
                                        <hostname>localhost</hostname>
                                        <wait>
                                            <time>5000</time>
                                        </wait>
                                        <log>
                                            <prefix>%a</prefix>
                                            <color>magenta</color>
                                        </log>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                        <executions>
                            <execution>
                                <id>docker-start</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>docker-stop</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <!--suppress MavenModelInspection property exposed by docker-maven-plugin-->
                                <api.root>http://localhost:${api.port}</api.root>
                                <api.wiremock-hcaptcha-port>${hcaptcha.port}</api.wiremock-hcaptcha-port>
                                <management.root>http://localhost:${management.port}</management.root>
                                <api.use-local-wiremocks>false</api.use-local-wiremocks>
                            </systemPropertyVariables>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>