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.
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 |
|---|---|---|
|
(Required) Name (and optionally tag) for the image to build. For example: |
|
|
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):
|
|
|
|
Include verbose output. |
|
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. |