arconia image build dockerfile

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

Prerequisites

  • A container runtime (Docker, Podman, or compatible) must be running on your machine.

Usage

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

arconia image build dockerfile --image-name ghcr.io/my-org/my-app:1.0.0

With a custom Dockerfile path:

arconia image build dockerfile --image-name ghcr.io/my-org/my-app:1.0.0 --dockerfile config/Dockerfile

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/my-org/my-app:1.0.0.

--dockerfile or -f

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

  1. src/main/docker/Dockerfile

  2. Dockerfile (project root)

--verbose or -v

false

Include verbose output.

--help or -h

Display help information for the command.

Example Dockerfile

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

FROM docker.io/library/eclipse-temurin:25-noble AS builder
WORKDIR /builder
ARG JAR_FILE=target/*.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.