A Dockerfile is a text-based build specification for creating a container image. Quarkus generates Dockerfiles because packaging applications into Docker or Podman images is a common cloud deployment task. The generated files are useful when a Dockerfile is required, although Quarkus extensions can provide other image-building and deployment approaches. section 2.6
A generated Quarkus project places Dockerfiles in src/main/docker for several packaging modes:
- Dockerfile.jvm packages the application in JVM fast-JAR mode, the default format. section 2.6
- Dockerfile.legacy-jar packages the application in the older JVM legacy-JAR format. section 2.6
- Dockerfile.native packages a Quarkus native executable. section 2.6
- Dockerfile.native-micro packages a native executable with a Quarkus-tuned micro base image to reduce the resulting image size. section 2.6
Build and run a native-micro image
Build the native application first with ./mvnw package -Dnative. Then build the image with docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/quarkus-in-action ., and run it with docker run -i --rm -p 8080:8080 quarkus/quarkus-in-action. The Dockerfile uses quay.io/quarkus/quarkus-micro-image:2.0 as its base, sets /work as the working directory, and configures ownership and permissions for the application files.

















