Coder Social home page Coder Social logo

Comments (6)

dmikusa avatar dmikusa commented on May 26, 2024

The first thing here, please try to build using pack and see if you encounter the same issue.

Second, please include any image config settings from your pom.xml/build.gradle file. These can impact how the build is executed, so we need to take them into account.

Third, include your full version of Spring Boot.

Fourth, include your Linux distro & version. In case we need to try and reproduce.

Thanks

from java.

rab2215 avatar rab2215 commented on May 26, 2024

I havent had a chance to try to use the pack command yet, but the same build does work using macOS.

Heres the full pom.xml:

`

4.0.0

<groupId>com.sample.test</groupId>
<artifactId>spring-native-demo</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <java.version>11</java.version>
    <spring.boot.version>2.5.4</spring.boot.version>
    <spring.native.version>0.10.3</spring.native.version>
    <docker-registry.host>*.*.com</docker-registry.host>
    <docker-maven-plugin.version>0.30.0</docker-maven-plugin.version>
</properties>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.5.4</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<repositories>
    <repository>
        <id>spring-release</id>
        <name>Spring release</name>
        <url>https://repo.spring.io/release</url>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>spring-release</id>
        <name>Spring release</name>
        <url>https://repo.spring.io/release</url>
    </pluginRepository>
</pluginRepositories>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.experimental</groupId>
        <artifactId>spring-native</artifactId>
        <version>${spring.native.version}</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.experimental</groupId>
            <artifactId>spring-aot-maven-plugin</artifactId>
            <version>${spring.native.version}</version>
            <executions>
                <execution>
                    <id>test-generate</id>
                    <goals>
                        <goal>test-generate</goal>
                    </goals>
                </execution>
                <execution>
                    <id>generate</id>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <image>
                    <builder>paketobuildpacks/builder:tiny</builder>
                    <name>${docker-registry.host}/${project.artifactId}:latest</name>
                    <pullPolicy>IF_NOT_PRESENT</pullPolicy>
                    <env>
                        <BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
                        <BP_NATIVE_IMAGE_BUILD_ARGUMENTS>-H:+ReportExceptionStackTraces --verbose</BP_NATIVE_IMAGE_BUILD_ARGUMENTS>
                    </env>
                </image>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>build-image</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

`

Linux Machine Info
NAME="Ubuntu" VERSION="18.04.2 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.2 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic

from java.

dmikusa avatar dmikusa commented on May 26, 2024

OK, thanks for that detail. Please update when you have a chance to run with pack.

It'll be something like pack build -e BP_NATIVE_IMAGE=true -e BP_NATIVE_IMAGE_BUILD_ARGUMENTS='-H:+ReportExceptionStackTraces --verbose' --pull-policy=if-not-present -B paketobuildpacks/builder:tiny -p target/your-jar-file <image-name>.

I know that there was a similar issue with permissions, but that should be fixed in your Spring Boot version, so I don't think that's it.

[INFO] [creator] unlinkat /workspace/BOOT-INF/lib/jackson-core-2.12.4.jar: permission denied

Could you also check to see if you have anything that might impact the permissions of that file? Check the original file permissions, but also check your /tmp directory and possibly umask settings on your machine. The build process is going to add the contents of your application JAR into the container, and it has to extract the files. I'm not 100% sure if it's using /tmp for storage as it does this, I'd need to check into it more, but if you can check for anything that might restrict permissions to be less than 644 for files and 755 for folders, that could give us some clues.

from java.

dmikusa avatar dmikusa commented on May 26, 2024

Just following up. Did you have a chance to run the command I suggested? Did you get this issue resolved? Thanks

from java.

rab2215 avatar rab2215 commented on May 26, 2024

Sorry for the late reply, but sudden priority changes have prevented me from troubleshooting this further. Unless anyone else has reported the problem I guess you can close the issue and I can re-open it later if necessary.

from java.

dmikusa avatar dmikusa commented on May 26, 2024

I will close. If you @rab2215 or anyone else encounter this, feel free to reopen. Thanks.

from java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.