The recommended deployment mode for Stateful Functions applications is to build a Docker image.
This way, user code does not need to package any Apache Flink components.
The provided base image allows teams to package their applications with all the necessary runtime dependencies quickly.
Below is an example Dockerfile for building a Stateful Functions image with both an embedded module and a remote module for an application called statefun-example.
Attention: The Flink community does not publish images for snapshot versions.
You can build this version locally by cloning the repo and following
the instructions in
If you prefer to package your job to submit to an existing Flink cluster, simply include statefun-flink-distribution as a dependency to your application.
It includes all of Stateful Functions’ runtime dependencies and configures the application’s main entry-point.
Attention: The distribution must be bundled in your application fat JAR so that it is on Flink's user code class loader
The following configurations are strictly required for running StateFun application.