参考 官方文档
https://ci.apache.org/projects/flink/flink-docs-release-1.11/zh/ops/deployment/docker.html
注意要点:
- 可以指定flink版本号及scala版本号
直接点,具体配置等说明看官方文档
docker-compose.yml
version: "2.2"
services:
jobmanager:
image: flink:1.11.2-scala_2.11
ports:
- "8081:8081"
command: jobmanager
container_name: jobmanager
volumes:
- ./flink/job/artifacts:/opt/flink/usrlib
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
parallelism.default: 2
taskmanager:
image: flink:1.11.2-scala_2.11
depends_on:
- jobmanager
command: taskmanager
container_name: taskmanager
scale: 1
volumes:
- ./flink/job/artifacts:/opt/flink/usrlib
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
taskmanager.numberOfTaskSlots: 2
parallelism.default: 2