Run Flink1.7.1 based on Docker Container
1. Edit related script 1.1 access Point script
Docker-entrypoint.sh
#! / bin/bashset-eexec "$@" 1.2 startup script
Start.sh
#! / usr/bin/env bashbin/start-cluster.shwhile truedo echo "=" sleep 60sdone1.3 DockerfileFROM lynn/jdk:1.8.0_172LABEL maintainer= "Lynn Yuan" ENV FLINK_HOME / flinkENV FLINK_VERSION 1.7.1ENV HADOOP_VERSION 27ENV TAR flink-$ {FLINK_VERSION}-bin-hadoop$ {HADOOP_VERSION}-scala_2.11.tgzENV TAR_URL http://mirrors.hust.edu.cn/apache/flink/flink-${FLINK_VERSION}/${TAR} ENV PATH ${FLINK_HOME} / bin:$PATHRUN set-x\ & & apt-get update\ & & apt-get install-y wget vim curl net-tools telnet procps nmap\ & & wget ${TAR_URL} RUN set-x\ & & mkdir ${FLINK_HOME}\ & & tar zxvf ${TAR}-C ${FLINK_HOME}\ & & mv ${FLINK_HOME} / flink- ${FLINK_VERSION} / * ${FLINK_HOME}\ & & rm-rf ${FLINK_HOME} / flink-$ {FLINK_VERSION}\ & & rm-rf ${TAR} ADD docker-entrypoint.sh / docker-entrypoint.shADD start.sh / start.shRUN set-x & & chmod + x / docker-entrypoint.sh\ & & chmod + x / start.shWORKDIR ${FLINK_HOME} ENTRYPOINT ["/ docker-entrypoint.sh"] CMD ["/ start.sh"] EXPOSE 8081EXPOSE 61232. Use Dockerfile build imagedocker build-- rm-t lynn/flink:1.7.1. 3. Run container docker run-idt-- name=flink-- hostname flink-node-p 18081 name=flink 8081 lynn/flink:1.7.1
Enter the following Url in the browser:
Http://localhost:18081/
The screenshot is as follows: