更新时间:2024-07-29 GMT+08:00
镜像制作
将jar文件打包成镜像文件,请参照制作镜像包或插件包。
dockerfile内容参照如下(具体可参考编写高效的Dockerfile )。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
FROM registry-cbu.huawei.com/csopenjdk/openjdk RUN mkdir -p /opt/iot/plugin / && chmod -R 777 /opt/ COPY iot-bridge-sample-tcp-protocol-1.1.3-with-deps.jar /opt/iot/plugin USER root CMD ["java", "-jar", "/opt/iot/plugin/iot-bridge-sample-tcp-protocol-1.1.3-with-deps.jar", "run"] #构造镜像 #docker build -t plugin_tcp_demo:1.0.0 ./ --no-cache #打标签 #docker tag plugin_tcp_demo:1.0.0 swr.cn-north-4.myhuaweicloud.com/iot_plugin_test/plugin_tcp_demo:1.0.0 #推送 #docker push swr.cn-north-4.myhuaweicloud.com/iot_plugin_test/plugin_tcp_demo:1.0.0 #打成镜像包 #docker save swr.cn-north-4.myhuaweicloud.com/iot_plugin_test/plugin_tcp_demo:1.0.0 > plugin_tcp_demo.tar |
父主题: 泛协议插件开发