1

Im trying to get a docker image going for my project, but im having some serious issues trying to get it going.

I was wondering if anyone had a docker setup that uses Sencha CMD 7 they could share.

My code is as follows;

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

When it goes to start the installer, the following errors are returned;

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

It then gets to the run sencha app build step and returns the following issues

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

I would love to see any other sencha cmd 7 setups or some help building this one up.

Thank you

CodeSauce
  • 255
  • 3
  • 19
  • 39
  • 1
    this question lacks one relevant detail: the version of JRE you run this with... simply installing locally, zipping and then unzipping again remotely should also circumvent the issue... what is `default-jre` ?? – Martin Zeitler Oct 02 '19 at 14:19
  • I've noticed install4j has a problem with the newer version of Java. Something we're looking at fixing. I'm guessing you can install Java 8 and it'll work. Once it's installed you could use Java 11 too with Cmd. – Brandon Oct 03 '19 at 15:31

2 Answers2

2

Here is a Docker image for Sencha CMD https://github.com/rockmagic/sencha-cmd. I don't know the maintainer but it's a good starting point.

This is a working example by using this image. You'll just need to replace the <AppName> with your application name.

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

Note: the OPENSSL_CONF environment variable is needed because Sencha CMD depends on an older libssl that is not installed in the container

Federico Baron
  • 967
  • 6
  • 15
0

Install4J, has problems with newer JRE's. I'd try installing Java 8 so install4j works.

Another option, you could possibly install sencha cmd through npm. I haven't tried this yet, but we do it locally on projects all the time and use npx sencha ....

Brandon
  • 2,034
  • 20
  • 25