Gradle Native GraalVM build

I’m trying to build a native image for a simple Kotlin app using GraalVM, I’m using the com.palantir.graal gradle plugin which downloads and extracts GraalVM, but during the native image build I get the following error:

Error: Basic header file missing (<zlib.h>).

It seems this is missing on the circleci/openjdk:11.0.3-jdk-stretch image.

Has anyone tried to build a native image for a Java application using CircleCI?

My project:

Build result on CircleCI:

The quick fix is to change the Docker image to oracle/graalvm-ce:latest (see

With the JDK image, a simple sudo apt-get update && sudo apt-get install -y linux-libc-dev did not resolve the issue. Maybe, zlib1g-dev (see is required. I did not want to play around, because the above solution (using the GraalVM image), just works.