Result of the quarkus.io getting started - slightly extended so
- a GraalVM native image can be built using a "self-contained"
Dockerfile
that does not require to build or install anything locally and - to be compiled statically so a minimal (
scratch
) docker base image can be used.
To build just run
docker build -t quarkus/getting-started .
Then start the container with
docker run -i --rm -p 8080:8080 quarkus/getting-started
As of April 2019, the quarkus.io getting started uses the fedora image to pack the final image. This repo provides a couple of other base images that compare as follows
Base Image | Size | Shell | Package Manager | libc | Basic Linux Folders | Static Binary | Dockerfile |
---|---|---|---|---|---|---|---|
fedora | ☒ | ☒ | ☒ | ☒ | ☐ | 📄 | |
debian | ☒ | ☒ | ☒ | ☒ | ☐ | 📄 | |
alpine-glibc | ☒ | ☒ | ☒ | ☒ | ☐ | 📄 | |
distroless-base | ☐ | ☐ | ☒ | ☒ | ☒ | 📄 | |
busybox | ☒ | ☐ | ☒ | ☒ | ☒ | 📄 | |
distroless-static | ☐ | ☐ | ☐ | ☒ | ☒ | 📄 | |
scratch | ☐ | ☐ | ☐ | ☐ | ☒ | 📄 |
Note that
- size is the compressed size within the DockerHub registry,
- if a shell is needed
- distroless images offer a
debug
tag (e.g.)gcr.io/distroless/base:debug
that includes a shell. That is, the image can easily be built with a shell if necessary, - for
scratch
or in general at runtime you could just copy a statically compiled shell into the container, if needed for debugging (except, of course, you're using a read-only filesystem):
- distroless images offer a
docker run --rm --name quarkus-getting-started schnatterer/quarkus-getting-started
docker create --name busybox busybox
docker cp busybox:/bin/busybox busybox
docker cp busybox quarkus-getting-started:/busybox
docker exec -it quarkus-getting-started /busybox sh