Docker 安装

Docker is a popular container runtime.
There are Docker images for Apache Flink available on Docker Hub which can be used to deploy a session cluster.
The Flink repository also contains tooling to create container images to deploy a job cluster.

Docker images

Images for each supported combination of Hadoop and Scala are available, and tag aliases are provided for convenience.

Beginning with Flink 1.5, image tags that omit a Hadoop version (e.g.
-hadoop28) correspond to Hadoop-free releases of Flink that do not include a
bundled Hadoop distribution.

For example, the following aliases can be used: (1.5.y indicates the latest
release of Flink 1.5)

flink:latest → flink:<latest-flink>-scala_<latest-scala>

flink:1.5 → flink:1.5.y-scala_2.11

flink:1.5-hadoop27 → flink:1.5.y-hadoop27-scala_2.11

Note: The Docker images are provided as a community project by individuals
on a best-effort basis. They are not official releases by the Apache Flink PMC.

Flink job cluster

A Flink job cluster is a dedicated cluster which runs a single job.
The job is part of the image and, thus, there is no extra job submission needed.

Docker images

The Flink job cluster image needs to contain the user code jars of the job for which the cluster is started.
Therefore, one needs to build a dedicated container image for every job.
The flink-container module contains a build.sh script which can be used to create such an image.
Please see the instructions for more details.

Using plugins

As described in the plugins documentation page: in order to use plugins they must be
copied to the correct location in the Flink installation for them to work.

When running Flink from one of the provided Docker images by default no plugins have been activated.
The simplest way to enable plugins is to modify the provided official Flink docker images by adding
an additional layer. This does however assume you have a docker registry available where you can push images to and
that is accessible by your cluster.

As an example assume you want to enable the S3 plugins in your installation.