1、准备flink的docker-compse.yml
version: "2.2"
services:
jobmanager:
image: flink:latest
ports:
- "8081:8081"
command: jobmanager
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
taskmanager:
image: flink:latest
depends_on:
- jobmanager
command: taskmanager
scale: 1
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
taskmanager.numberOfTaskSlots: 2
sql-client:
image: flink:latest
command: bin/sql-client.sh
depends_on:
- jobmanager
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
rest.address: jobmanager
2、执行docker-compose 命令启动
docker-compose up -d
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/5ad106f75a021b840c942f1970c12865.png)
3、检查flink是否启动成功
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/0cb838180dc52bc5c3734f84c1f4c1e4.png)