# 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.

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

## Declare an image

```pkl
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"
  }
}
```

```bash
elide build
```

## Fields

| Property | Values | Default |
| --- | --- | --- |
| `from` | Exactly one `Jvm.Jar` (JVM image) or `NativeImage` (executable image). | — |
| `image` | Target image coordinate. | — |
| `base` | Base image coordinate. | — |
| `tags` | Image tags. | none |
| `output` | `"daemon"` (local Docker daemon) or `"tarball"` (importable archive). | `"daemon"` |
| `format` | `"docker"` (manifest v2) or `"oci"`. | `"docker"` |
| `dependsOn` | Artifacts to build first. | none |

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