使用docker拉取镜像
docker pull flink
镜像拉取好之后,检查一下:
iie4bu@swarm-manager:~/ddy/docker-flink$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
flink latest 10a60ef23105 7 days ago 574MB
新建文件夹docker-flink,文件夹下新建文件docker-compose.yml,内容如下:
version: "2.1"
services:
jobmanager:
image: flink
expose:
- "6123"
ports:
- "8081:8081"
command: jobmanager
environment:
- JOB_MANAGER_RPC_ADDRESS=jobmanager
taskmanager:
image: flink
expose:
- "6121"
- "6122"
depends_on:
- jobmanager
command: taskmanager
links:
- "jobmanager:jobmanager"
environment:
- JOB_MANAGER_RPC_ADDRESS=jobmanager
启动docker-compose
docker-compose up -d
浏览器打开 http://127.0.0.1:8081 可以看到dashboard
这样环境就搭建好了.
进入容器中可以查看flink版本:flink --version