标签:net-tools yun bash 1.2 ima col code ado images
1. 编辑相关脚本docker-entrypoint.sh
#!/bin/bash
set -e
exec "$@"
start.sh
#!/usr/bin/env bash
bin/start-cluster.sh
while true
do
echo "======="
sleep 60s
done
FROM lynn/jdk:1.8.0_172
LABEL maintainer="Lynn Yuan <longjianzhiyun@163.com>"
ENV FLINK_HOME /flink
ENV FLINK_VERSION 1.7.1
ENV HADOOP_VERSION 27
ENV TAR flink-${FLINK_VERSION}-bin-hadoop${HADOOP_VERSION}-scala_2.11.tgz
ENV TAR_URL http://mirrors.hust.edu.cn/apache/flink/flink-${FLINK_VERSION}/${TAR}
ENV PATH ${FLINK_HOME}/bin:$PATH
RUN 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.sh
ADD start.sh /start.sh
RUN set -x && chmod +x /docker-entrypoint.sh && chmod +x /start.sh
WORKDIR ${FLINK_HOME}
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/start.sh"]
EXPOSE 8081
EXPOSE 6123
docker build --rm -t lynn/flink:1.7.1 .
docker run -idt --name=flink -p 18081:8081 lynn/flink:1.7.1
在浏览器中输入如下Url:
http://localhost:18081/
截图如下:
基于Docker Container运行Flink1.7.1 Local Cluster模式
标签:net-tools yun bash 1.2 ima col code ado images
原文地址:http://blog.51cto.com/1196740/2335133