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 .
还没有评论,来说两句吧...