java - Sencha CMD 7 dockerfile 因非法反射访问而失败
问题描述
我试图为我的项目获取一个 docker 映像,但我在尝试让它运行时遇到了一些严重的问题。
我想知道是否有人可以共享使用 Sencha CMD 7 的 docker 设置。
我的代码如下;
FROM nginx:latest
RUN mkdir -p /usr/share/man/man1
RUN apt-get update -y && apt-get install -y \
unzip \
curl \
default-jre
WORKDIR /tmp
RUN curl http://cdn.sencha.com/cmd/7.0.0.40/no-jre/SenchaCmd-7.0.0.40-linux-amd64.sh.zip -o SenchaCmd-7.0.0.40-linux-amd64.sh.zip
RUN unzip SenchaCmd-7.0.0.40-linux-amd64.sh.zip
RUN /tmp/`find SenchaCmd*.sh` -q -dir "/opt/sencha"
RUN ln -s /opt/sencha/sencha /usr/local/bin/sencha
COPY . /opt/project
WORKDIR /opt/project
RUN sencha app build
RUN cp -r build/production/project/* /usr/share/nginx/html
启动安装程序时,返回以下错误;
Step 7/12 : RUN /tmp/`find SenchaCmd*.sh` -q -dir "/opt/sencha"
---> Running in f785977a8e37
Starting Installer ...
The installation directory has been set to /opt/sencha.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.install4j.runtime.util.ToolTipHelpLabel (file:/tmp/SenchaCmd-7.0.0.40-linux-amd64.sh.8.dir/i4jruntime.jar) to constructor javax.swing.ToolTipManager()
WARNING: Please consider reporting this to the maintainers of com.install4j.runtime.util.ToolTipHelpLabel
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Extracting files ...
/opt/sencha/../i4j838865445042160025.tmp (No such file or directory)
No such file or directory
然后它进入运行 sencha 应用程序构建步骤并返回以下问题
Step 11/12 : RUN sencha app build
---> Running in edffc4ea27be
java.io.FileNotFoundException: /opt/sencha/.install4j/6b5f63d9.lprop (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at com.install4j.runtime.launcher.UnixLauncher.readProperties(Unknown Source)
at com.install4j.runtime.launcher.UnixLauncher.main(Unknown Source)
Sencha Cmd v7.0.0.40
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.gson.internal.bind.ReflectiveTypeAdapterFactory (file:/opt/sencha/lib/closure-compiler-v20180610.jar) to field java.io.File.path
WARNING: Please consider reporting this to the maintainers of com.google.gson.internal.bind.ReflectiveTypeAdapterFactory
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INF] Processing Build Descriptor : classic (production environment)
Warning: Nashorn engine is planned to be removed from a future JDK release
Warning: Nashorn engine is planned to be removed from a future JDK release
Warning: Nashorn engine is planned to be removed from a future JDK release
我很想看到任何其他 sencha cmd 7 设置或一些帮助建立这个。
谢谢
解决方案
这是 Sencha CMD https://github.com/rockmagic/sencha-cmd的 Docker 镜像。我不认识维护者,但这是一个很好的起点。
这是使用此图像的工作示例。您只需将 替换为<AppName>
您的应用程序名称。
FROM rockmagicnet/sencha-cmd:7.0.0 AS builder
ENV OPENSSL_CONF=/dev/null
COPY . /app
RUN sencha app build production
FROM nginx:latest
COPY --from=builder /app/build/production/<AppName> /usr/share/nginx/html
注意:OPENSSL_CONF
需要环境变量,因为 Sencha CMD 依赖于未安装在容器中的旧 libssl
推荐阅读
- c - 如何在同一语句中使用地址运算符以及指针上的前缀增量?
- security - 有没有办法从外部连接到 Kubernetes pod 中未发布的套接字?
- laravel - 如何使用 PhpUnit 仅使用 Laravel 模拟一种方法
- ruby - Ruby 中最好的进程监视器
- .htaccess - 基本身份验证后重定向/重写
- c# - Unity TlsException:握手失败 UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED
- sql - SQL查询 - 如何用例?
- git - 什么是正确的合并方式?
- angular - 我应该在 NGXS 状态中使用/避免成员变量吗?
- gremlin - 在 Gremlin 中合并多个查询的结果