arconia image build dockerfile

The arconia image build dockerfile command packages your Spring Boot application as a container image using a Dockerfile or a Containerfile. Unlike the buildpacks approach, this command gives you full control over the image build process through a custom Dockerfile/Containerfile.

Prerequisites

  • An OCI container runtime (Podman or Docker) must be installed and running on your machine.

Usage

Basic usage (a Dockerfile or Containerfile must be located at src/main/docker/, src/main/podman/, or in the project root):

arconia image build dockerfile --image-name ghcr.io/arconia-io/configuration-service

With a custom Dockerfile/Containerfile path:

arconia image build dockerfile --image-name ghcr.io/arconia-io/configuration-service --dockerfile config/Dockerfile

Explicitly use Podman as the OCI runtime:

arconia image build dockerfile --image-name ghcr.io/arconia-io/configuration-service --oci-runtime podman

Explicitly use Docker as the OCI runtime:

arconia image build dockerfile --image-name ghcr.io/arconia-io/configuration-service --oci-runtime docker

Options

The following options are available:

Option Default Description

--image-name or -t

(Required) Name (and optionally tag) for the image to build. For example: ghcr.io/arconia-io/configuration-service:1.0.0.

--dockerfile, --containerfile, or -f

The path to the Dockerfile or Containerfile to use for building the container image. If not specified, the command looks in these locations (in order):

  1. Containerfile (project root)

  2. Dockerfile (project root)

  3. src/main/podman/Containerfile

  4. src/main/podman/Dockerfile

  5. src/main/docker/Containerfile

  6. src/main/docker/Dockerfile

--oci-runtime

(auto-detected)

The OCI runtime to use for building the container image. Supported values: docker, podman. If not specified, the CLI checks for Podman first, then falls back to Docker.

--verbose or -v

false

Include verbose output.

--help or -h

Display help information for the command.

Example Dockerfile/Containerfile

The following is a minimal multi-stage Dockerfile/Containerfile suitable for a Spring Boot application. It uses Spring Boot’s layered JAR support to separate dependencies (which change rarely) from application code (which often changes), resulting in better OCI image layer caching and faster incremental builds:

FROM docker.io/library/eclipse-temurin:25-noble AS builder
WORKDIR /builder
# Adjust this to 'target/*.jar' if you're using Maven
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=tools -jar application.jar extract --layers --destination extracted

FROM docker.io/library/eclipse-temurin:25-jre-noble
RUN useradd spring
USER spring
WORKDIR /application
COPY --from=builder /builder/extracted/dependencies/ ./
COPY --from=builder /builder/extracted/spring-boot-loader/ ./
COPY --from=builder /builder/extracted/snapshot-dependencies/ ./
COPY --from=builder /builder/extracted/application/ ./
ENTRYPOINT ["java", "-jar", "application.jar"]
The multi-stage build pattern above keeps the final image small by only including the JRE and the extracted application layers, not the full build toolchain.