Deploying via Docker
-
Hi All,
Has anyone done this yet?
I'm building a docker image for Mango as I wish to deploy Mango to a number of sites with this mechanism.
Is there a file schema or something that will tell me what files are user data (database, configuration, licence files etc) and what are the scripts/binaries/etc that are part of the distribution?
I'd like to stick all the user data in a docker volume so it will remain persistent across containers and permit upgrades of the deployed software by simply removing the container and running up a new one with a reference to the persistent volumes.
Secondary question; once licensed, how can I make sure the licence isn't invalidated by a re-deployment of the docker image where the user data is persistent? How is the uniqueness of the installation calculated for the licensing?
Cheers!
-Shaun -
Hi Shaun,
I don't know if you got this working but got a vagrant file going with Oracle VMBOX.
Cheers
Jon K -
@shaun @espedair
This is a quick Dockerfile I put together for our testing purposes, it might be useful to you. Note it uses openjdk which Mango does not officially support, you might want to base it on an Oracle JDK docker image.FROM openjdk:8-jdk MAINTAINER Jared Wiltshire <jared@infiniteautomation.com> RUN mkdir -p /opt/mango \ && wget -O /tmp/m2m2-fullCore-2.8.4.zip http://mangoautomation.net:9902/mangoBuilds/2.8.4/m2m2-fullCore-2.8.4.zip \ && unzip /tmp/m2m2-fullCore-2.8.4.zip -d /opt/mango \ && rm /tmp/m2m2-fullCore-2.8.4.zip ENV MA_HOME /opt/mango ENV MA_CP $MA_HOME/overrides/classes:$MA_HOME/classes:$MA_HOME/overrides/properties:$MA_HOME/overrides/lib/*:$MA_HOME/lib/* EXPOSE 8080 ENTRYPOINT exec java -server -cp $MA_CP -Dma.home=$MA_HOME -Djava.library.path=$MA_HOME/overrides/lib:$MA_HOME/lib:/usr/lib/jni/:$PATH com.serotonin.m2m2.Main
Regarding user data, it depends on what database you are using and can be configured in env.properties. The H2 and Mango NoSQL databases though are by default located in $MA_HOME/databases.
@shaun said in Deploying via Docker:
Secondary question; once licensed, how can I make sure the licence isn't invalidated by a re-deployment of the docker image where the user data is persistent? How is the uniqueness of the installation calculated for the licensing?
This is not something I'm not at liberty to share, Perhaps contact our support via email if you have any issues and we can sort something out.
-
Hi Jared,
I've not tried recently with the latest version, but previously I've had issues with applying the license to a docker image.
Joel and i tried a few things, but were unable to make the licence 'stick'.
What would happen is we would install the licence, the mango instance would restart, and in the logs it behaved as though the licence file wasn't created on disk.Does it work fine with your Dockerfile above?
Cheers!
-Shaun