Flink Kylinv10 java8 Flink镜像制作

Flink Kylinv10 java8 Flink镜像制作

码农世界 2024-05-23 前端 70 次浏览 0个评论

1)基于麒麟v10版本制作JDK8基础镜像在这里插入代码片

FROM kylinv10/kylin:b09
RUN set -ex; \
    dnf install -y wget java-1.8.0-openjdk java-1.8.0-openjdk-devel tar; \
    yum clean all
RUN java -version
CMD ["echo", "kylinv10 + JDK 8 image is ready!"]

执行build镜像

docker build -t kylin:kylinv10-1.8 .

2)基于kylin:kylinv10-1.8 构建flink本地镜像

FROM kylin:kylinv10-1.8
# Install dependencies
RUN set -ex; \
    dnf install -y  tar; \
    yum clean all
ENV GOSU_VERSION 1.17
ENV ARCH=arm64
COPY gosu /usr/local/bin/
COPY flink-1.17.2-bin-scala_2.12.tgz /tmp/flink.tgz
RUN set -ex; \
  export GNUPGHOME="$(mktemp -d)"; \
  chmod +x /usr/local/bin/gosu; \
  gosu nobody true
# Prepare environment
ENV FLINK_HOME=/opt/flink
ENV PATH=$FLINK_HOME/bin:$PATH
RUN groupadd --system --gid=9999 flink && \
    useradd --system --home-dir $FLINK_HOME --uid=9999 --gid=flink flink
WORKDIR $FLINK_HOME
# Install Flink
RUN set -ex; \
  \
  tar -xf /tmp/flink.tgz --strip-components=1; \
  rm /tmp/flink.tgz; \
  \
  chown -R flink:flink .; \
  \
  # Replace default REST/RPC endpoint bind address to use the container's network interface \
  sed -i 's/rest.address: localhost/rest.address: 0.0.0.0/g' $FLINK_HOME/conf/flink-conf.yaml; \
  sed -i 's/rest.bind-address: localhost/rest.bind-address: 0.0.0.0/g' $FLINK_HOME/conf/flink-conf.yaml; \
  sed -i 's/jobmanager.bind-host: localhost/jobmanager.bind-host: 0.0.0.0/g' $FLINK_HOME/conf/flink-conf.yaml; \
  sed -i 's/taskmanager.bind-host: localhost/taskmanager.bind-host: 0.0.0.0/g' $FLINK_HOME/conf/flink-conf.yaml; \
  sed -i '/taskmanager.host: localhost/d' $FLINK_HOME/conf/flink-conf.yaml;
# Configure container
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 6123 8081
CMD ["help"]

需要下载所需的gosu本地文件,地址:https://github.com/tianon/gosu/releases/download/1.17/gosu-arm64和flink二进制文件

然后执行镜像打包

jiangzhongzhou@ZBMac-C02CW08SM scala_2.12-java8-kylin-local % docker build -t flink:1.17-scala_2.12-kylin10-java8 .

转载请注明来自码农世界,本文标题:《Flink Kylinv10 java8 Flink镜像制作》

百度分享代码,如果开启HTTPS请参考李洋个人博客
每一天,每一秒,你所做的决定都会改变你的人生!

发表评论

快捷回复:

评论列表 (暂无评论,70人围观)参与讨论

还没有评论,来说两句吧...

Top