3

I am trying to create a Docker image that runs draw.io (https://www.draw.io/).

I recently did download the draw.io git repository from https://github.com/jgraph/draw.io (version 5.6.0.3) and spend quite some time building draw.war (which can be deployed in a web container), without any luck so far. I did read all the draw.io documentation that is provided in the repository and searched the internet for hours to find out how to build draw.war, but I couldn't find an answer.

The root directory of the repository is /tmp/draw.io-master/ and the ANT build file (build.xml) and related propery file (build.properties) can be found in /tmp/draw.io-master/etc/build

When I run 'ant' from /tmp/draw.io-master/etc/build I get the following error:

Buildfile: /tmp/draw.io-master/etc/build/build.xml
   [jscomp] Compiling 1 file(s) with 40 extern(s)
   [jscomp] ERROR - Cannot read: /tmp/draw.io-master/etc/build/${desktop.dir}/Desktop-Init.js
   [jscomp] 1 error(s), 0 warning(s)

BUILD FAILED
/tmp/draw.io-master/etc/build/build.xml:451: Compilation failed.

Total time: 0 seconds

When I run 'ant war -buildfile /tmp/draw.io-master/etc/build/build.xml -propertyfile /tmp/draw.io-master/etc/build/build.properties -Dbasedir=/tmp/draw.io-master/etc/build -Ddesktop.dir=/tmp' I get the following error:

Buildfile: /tmp/draw.io-master/etc/build/build.xml
   [jscomp] Compiling 1 file(s) with 40 extern(s)
   [jscomp] ERROR - Cannot read: /tmp/Desktop-Init.js
   [jscomp] 1 error(s), 0 warning(s)

BUILD FAILED
/tmp/draw.io-master/etc/build/build.xml:451: Compilation failed.

Total time: 0 seconds

I don't know what the right value of 'desktop.dir' is and I also don't know how to obtain / create Desktop-Init.js.

Any suggestions?

  • Both the JS build and war build should now work. Note that draw.io is mostly a client-side app. Apart from a few server parts, you can build the JS, point a web server at the root folder and navigate to the index.html. – Frodo Baggins Sep 13 '16 at 16:15
  • Thanks a lot @David and I'll let you know if I was able to build and run it. – DockerEverything Sep 13 '16 at 16:40
  • It seems like some servlets are missing which are defined in web.xml: java.lang.ClassNotFoundException: com.mxgraph.online.ConnectRenderServlet java.lang.ClassNotFoundException: com.google.api.server.spi.SystemServiceServlet javax.servlet.UnavailableException: com.mxgraph.online.ConnectImageServlet javax.servlet.UnavailableException: com.mxgraph.online.EmailServlet javax.servlet.UnavailableException: com.mxgraph.online.LicenseInitServlet javax.servlet.UnavailableException: com.mxgraph.online.LicenseServlet javax.servlet.UnavailableException: com.mxgraph.online.EmbedServlet. – DockerEverything Sep 13 '16 at 23:43
  • I've removed the references in web.xml. We don't use the war internally, so if there are changes needed, you're welcome to submit a PR with fixes. – Frodo Baggins Sep 14 '16 at 16:09
  • I had to make some additional changes to web.xml. The war now builds correctly and starts in my Docker container. However, I assume that some of the JS and/or HMTL files refer to HTTPS rather than HTTP. So I have to setup HTTPS in my Jetty web container which is challenging. – DockerEverything Sep 17 '16 at 15:34
  • Can't you do a reverse proxy using nginx or something "simpler" than Jetty? Did you finish up your Dockerfile? I'm about to start the same journey.. – xeor Nov 08 '16 at 10:21
  • It doesn't directly answer your question, but I've built a Dockerfile for draw.io here: https://github.com/andrewferrier/misc-scripts/tree/master/draw.io-offline-docker. – Andrew Ferrier Nov 28 '16 at 14:32
  • @AndrewFerrier the repository doesn't exist anymore on GutHub, can we find it somewhere else? Besides this could anyone make use of the _lightbox_ when cloning/building the GitHub repository? Instead of https://www.draw.io/?p=ex&lightbox=1&..., I would like to make it accessible via https://www.mydomain.io/drawio/src/main/webapp/index.html/?chrome=0&p=ex&lightbox=1&... as possible for the editor as available on https://www.mydomain.io/drawio/src/main/webapp/index.html (https://jgraph.github.io/drawio/src/main/webapp/index.html) and https://www.draw.io. – Stefan Apr 29 '19 at 17:03
  • @Stefan that's right, you can now download draw.io for the Desktop (https://about.draw.io/integrations/#integrations_offline), so I removed that Dockerfile. – Andrew Ferrier May 07 '19 at 17:16
  • @AndrewFerrier, thx for the update, any experience with building draw.io, doc is [driving me insane](https://stackoverflow.com/questions/56048543/hot-to-build-draw-io-to-have-lightbox-viewer) – Stefan May 08 '19 at 20:26
  • 1
    @Stefan well you can find the last version of the Dockerfile in the repo before I deleted it here: https://github.com/andrewferrier/misc-scripts/tree/83b27476ba6da7b40e05499aea197e28ec59bd23/draw.io-offline-docker. I didn't spend long on this so that's really all I know, but if it's helpful to you... – Andrew Ferrier May 10 '19 at 08:01

1 Answers1

0

To fallback to http instead of https, you could use a redirection in Jetty, and add the url parameter "https=0", see https://support.draw.io/pages/viewpage.action?pageId=12878136.

Any place where you could share the resulting war, if successful?