Skip to content

JVM containers

Build a Docker or OCI container image from a JAR or native executable as an Elide project artifact, loaded into the local daemon or written as a tarball.

On this page

Container images are project artifacts; there is no elide container subcommand.

Declare an image

amends "elide:project.pkl"
import "elide:Jvm.pkl" as Jvm
import "elide:Container.pkl" as Container

artifacts {
  ["app"] = new Jvm.Jar {
    sources { "main" }
  }

  ["image"] = new Container.ContainerImage {
    from { "app" }
    image = "my-app"
    base = "eclipse-temurin:25-jre"
    tags { "latest" }
    output = "daemon"
  }
}
elide build

Fields

PropertyValuesDefault
fromExactly one Jvm.Jar (JVM image) or NativeImage (executable image).—
imageTarget image coordinate.—
baseBase image coordinate.—
tagsImage tags.none
output"daemon" (local Docker daemon) or "tarball" (importable archive)."daemon"
format"docker" (manifest v2) or "oci"."docker"
dependsOnArtifacts to build first.none

An empty from, two distinct entries, or any other artifact type (including a WebImage) fails before the build.

Was this page helpful?