Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exec /app: exec format error #1022

Open
anandjaisy opened this issue Aug 17, 2024 · 0 comments
Open

exec /app: exec format error #1022

anandjaisy opened this issue Aug 17, 2024 · 0 comments

Comments

@anandjaisy
Copy link

anandjaisy commented Aug 17, 2024

build.gradle.kts

plugins {
    id("com.github.johnrengelman.shadow") version "8.1.1"
    id("io.micronaut.application") version "4.4.2"
    id("io.micronaut.aot") version "4.4.2"
}

version = "0.1"
group = "fete.bird"

repositories {
    mavenCentral()
}

dependencies {
    ....
}


application {
    mainClass = "fete.bird.Assessment"
}
java {
    sourceCompatibility = JavaVersion.toVersion("21")
    targetCompatibility = JavaVersion.toVersion("21")
}


graalvmNative.toolchainDetection = false

micronaut {
    runtime("netty")
    testRuntime("junit5")
    processing {
        incremental(true)
        annotations("fete.bird.*")
    }
    aot {
        // Please review carefully the optimizations enabled below
        // Check https://micronaut-projects.github.io/micronaut-aot/latest/guide/ for more details
        optimizeServiceLoading = false
        convertYamlToJava = false
        precomputeOperations = true
        cacheEnvironment = true
        optimizeClassLoading = true
        deduceEnvironment = true
        optimizeNetty = true
        replaceLogbackXml = true
    }
}

graalvmNative {
    binaries {
        named("main") {
            buildArgs.add("-H:+StaticExecutableWithDynamicLibC")
        }
    }
}

docker file

FROM gcr.io/distroless/java-base-debian12
COPY build/native/nativeCompile/assessment app
ENTRYPOINT ["/app"]

docker-compose

version: '3.8'

services:
  assessment:
    build:
      context: ./assessment
      dockerfile: Dockerfile
    container_name: assessment
    ports:
      - 8082:8082
    networks:
      - fetebird-uni
networks:
  fetebird-uni:
    driver: bridge

Exception
exec /app: exec format error

Environment Information

macos
jdk 21

Version

4.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant