Jib Maven plugin build issue

165 Views Asked by At

I am trying to build a container image with jib-maven-plugin but with no success - every time i try to start container I get Error: Unable to access jarfile /app/<name>.jar

I have pom like below

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <to>
                        <image>10.0.0.24:8083/${project.artifactId}:${project.version}</image>
                        <auth>
                            <username>podman</username>
                            <password>podman123</password>
                        </auth>
                    </to>
                    <container>
                        <!--<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
                        <filesModificationTime>USE_CURRENT_TIMESTAMP</filesModificationTime>
                        <mainClass>pl.lab.registryservice.RegistryServiceApplication</mainClass>-->
                        <jvmFlags>
                            <jvmFlag>-Xms256m</jvmFlag>
                            <jvmFlag>-Xmx256m</jvmFlag>
                        </jvmFlags>
                        <ports>
                            <port>8761</port>
                            <port>8761/tcp</port>
                        </ports>
                        <entrypoint>java,-jar,/*/${project.artifactId}-${project.version}.jar</entrypoint>
                        <format>OCI</format>
                    </container>
                    <containerizingMode>packaged</containerizingMode>
                    <allowInsecureRegistries>true</allowInsecureRegistries>
                </configuration>
            </plugin>
        </plugins>
    </build>

Could someone advise what is wrong here ? I have no idea what I'm doing wrong.

Regards,

Correction of described error

0

There are 0 best solutions below