opencontainers / image-spec

OCI Image Format
https://www.opencontainers.org/
Apache License 2.0
3.34k stars 624 forks source link

Add gradle-oci to implementations.md #1156

Open SgtSilvio opened 5 months ago

SgtSilvio commented 5 months ago

As the author of the Gradle OCI plugin I want to ask if it can be included in the list of implementations.

It is a Gradle plugin to ease using and producing (multi-arch) OCI images without requiring external tools.

The plugin allows:

Please let me know if any additional information is required.

sudo-bmitch commented 5 months ago

Hi @SgtSilvio, I'm not a Java / Gradle / Kotlin dev, so this is out of my expertise. But that's not really needed to approve this. Do you have an example image created by this project on a public repo that we could review?

SgtSilvio commented 5 months ago

Thanks for your answer. The hivemq/hivemq-swarm is a public image that has been built with gralde-oci since December. (example tag: 4.23.0). The project source is private, but I can share the image definition below. In short,

Full Image Definition ```kotlin oci { imageDefinitions.register("main") { allPlatforms { parentImages { add("distroless:java11-debian11:latest") { isChanging = true } } config { entryPoint.add("java") entryPoint.addAll(application.applicationDefaultJvmArgs) entryPoint.addAll( "-XX:+UnlockExperimentalVMOptions", "-XX:+UseG1GC", "-XX:InitialRAMPercentage=60", "-XX:MaxRAMPercentage=70", "-XX:MinRAMPercentage=40", "-Dswarm.home=/", "-cp", "/app/classpath/*:/app/libs/*", ) entryPoint.add(application.mainClass) environment.put("LOG_LEVEL", "INFO") } layers { layer("libs") { contents { from(configurations.runtimeClasspath) into("app/libs") } } layer("jar") { contents { from(proguardJar.flatMap { it.inputOutputGroups[0].outputs[0].archiveFile }) into("app/classpath") rename(".*", "${project.name}-${project.version}.jar") } } layer("resources") { contents { from("src/distribution") from("src/main/resources/logback.xml") { into("config") } from(standardExtensions) { into("extensions") } filter.exclude("config/config.xml", "scenario/scenario.xml", "**/Readme.md") } } } } specificPlatform(platform("linux", "amd64")) specificPlatform(platform("linux", "arm64", "v8")) } } ```