anchor.diff: -FROM openjdk:8
  +ARG JAVA_VERSION=8
  +FROM openjdk:${JAVA_VERSION}
   
  -ENV KNOWAGE_VERSION 6_3_3
  -ENV KNOWAGE_EDITION CE
  -ENV KNOWAGE_RELEASE_DATE 20190307
  -ENV KNOWAGE_PACKAGE_SUFFIX bin-${KNOWAGE_VERSION}-${KNOWAGE_EDITION}-${KNOWAGE_RELEASE_DATE}
  -ENV FILEEXTENSION .war
  -ENV KNOWAGE_REPO_VERSION 6.3.3
  -ENV KNOWAGE_OW2_BASE_URL http://release.ow2.org/knowage/${KNOWAGE_REPO_VERSION}/Applications
  -ENV KNOWAGE_OW2_DDL_URL http://release.ow2.org/knowage/${KNOWAGE_REPO_VERSION}/Database%20scripts
  +ARG KNOWAGE_VERSION="6_4_0"
  +ARG KNOWAGE_REPO_VERSION="6.4.0"
  +ARG KNOWAGE_EDITION="CE"
  +ARG KNOWAGE_RELEASE_DATE="20190509"
  +ARG KNOWAGE_PACKAGE_SUFFIX="bin-${KNOWAGE_VERSION}-${KNOWAGE_EDITION}-${KNOWAGE_RELEASE_DATE}"
  +ARG FILEEXTENSION=".zip"
  +ARG KNOWAGE_OW2_BASE_URL="http://release.ow2.org/knowage/${KNOWAGE_REPO_VERSION}/Applications"
  +ARG KNOWAGE_OW2_DDL_URL="http://release.ow2.org/knowage/${KNOWAGE_REPO_VERSION}/Database%20scripts"
   
  -ENV KNOWAGE_CORE_ENGINE knowage
  -ENV KNOWAGE_CORE_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_CORE_ENGINE}${FILEEXTENSION}
   
  -ENV KNOWAGE_BIRTREPORT_ENGINE ${KNOWAGE_CORE_ENGINE}birtreportengine
  -ENV KNOWAGE_BIRTREPORT_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_BIRTREPORT_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_COCKPIT_ENGINE ${KNOWAGE_CORE_ENGINE}cockpitengine
  -ENV KNOWAGE_COCKPIT_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_COCKPIT_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_COMMONJ_ENGINE ${KNOWAGE_CORE_ENGINE}commonjengine
  -ENV KNOWAGE_COMMONJ_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_COMMONJ_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_DATAMINING_ENGINE ${KNOWAGE_CORE_ENGINE}dataminingengine
  -ENV KNOWAGE_DATAMINING_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_DATAMINING_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_GEOREPORT_ENGINE ${KNOWAGE_CORE_ENGINE}georeportengine
  -ENV KNOWAGE_GEOREPORT_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_GEOREPORT_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_JASPERREPORT_ENGINE ${KNOWAGE_CORE_ENGINE}jasperreportengine
  -ENV KNOWAGE_JASPERREPORT_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_JASPERREPORT_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_KPI_ENGINE ${KNOWAGE_CORE_ENGINE}kpiengine
  -ENV KNOWAGE_KPI_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_KPI_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_META_ENGINE ${KNOWAGE_CORE_ENGINE}meta
  -ENV KNOWAGE_META_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_META_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_NETWORK_ENGINE ${KNOWAGE_CORE_ENGINE}networkengine
  -ENV KNOWAGE_NETWORK_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_NETWORK_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_QBE_ENGINE ${KNOWAGE_CORE_ENGINE}qbeengine
  -ENV KNOWAGE_QBE_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_QBE_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_SVGVIEWER_ENGINE ${KNOWAGE_CORE_ENGINE}svgviewerengine
  -ENV KNOWAGE_SVGVIEWER_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_SVGVIEWER_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_TALEND_ENGINE ${KNOWAGE_CORE_ENGINE}talendengine
  -ENV KNOWAGE_TALEND_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_TALEND_ENGINE}${FILEEXTENSION}
  -
  -ENV KNOWAGE_WHATIF_ENGINE ${KNOWAGE_CORE_ENGINE}whatifengine
  -ENV KNOWAGE_WHATIF_URL ${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_WHATIF_ENGINE}${FILEEXTENSION}
  +ARG  KNOWAGE_CORE_ENGINE="knowage"
  +ARG  KNOWAGE_BIRTREPORT_ENGINE="${KNOWAGE_CORE_ENGINE}birtreportengine"
  +ARG  KNOWAGE_COCKPIT_ENGINE="${KNOWAGE_CORE_ENGINE}cockpitengine"
  +ARG  KNOWAGE_COMMONJ_ENGINE="${KNOWAGE_CORE_ENGINE}commonjengine"
  +ARG  KNOWAGE_DATAMINING_ENGINE="${KNOWAGE_CORE_ENGINE}dataminingengine"
  +ARG  KNOWAGE_GEOREPORT_ENGINE="${KNOWAGE_CORE_ENGINE}georeportengine"
  +ARG  KNOWAGE_JASPERREPORT_ENGINE="${KNOWAGE_CORE_ENGINE}jasperreportengine"
  +ARG  KNOWAGE_KPI_ENGINE="${KNOWAGE_CORE_ENGINE}kpiengine"
  +ARG  KNOWAGE_META_ENGINE="${KNOWAGE_CORE_ENGINE}meta"
  +ARG  KNOWAGE_NETWORK_ENGINE="${KNOWAGE_CORE_ENGINE}networkengine"
  +ARG  KNOWAGE_QBE_ENGINE="${KNOWAGE_CORE_ENGINE}qbeengine"
  +ARG  KNOWAGE_SVGVIEWER_ENGINE="${KNOWAGE_CORE_ENGINE}svgviewerengine"
  +ARG  KNOWAGE_TALEND_ENGINE="${KNOWAGE_CORE_ENGINE}talendengine"
  +ARG  KNOWAGE_WHATIF_ENGINE="${KNOWAGE_CORE_ENGINE}whatifengine"
  + 
  +ARG KNOWAGE_CORE_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_CORE_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_BIRTREPORT_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_BIRTREPORT_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_COCKPIT_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_COCKPIT_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_COMMONJ_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_COMMONJ_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_DATAMINING_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_DATAMINING_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_GEOREPORT_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_GEOREPORT_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_JASPERREPORT_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_JASPERREPORT_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_KPI_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_KPI_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_META_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_META_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_NETWORK_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_NETWORK_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_QBE_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_QBE_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_SVGVIEWER_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_SVGVIEWER_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_TALEND_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_TALEND_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_WHATIF_URL="${KNOWAGE_OW2_BASE_URL}/${KNOWAGE_WHATIF_ENGINE}-${KNOWAGE_PACKAGE_SUFFIX}${FILEEXTENSION}"
  +ARG KNOWAGE_MYSQL_SCRIPT_URL="${KNOWAGE_OW2_DDL_URL}/mysql-dbscripts-${KNOWAGE_VERSION}-${KNOWAGE_RELEASE_DATE}.zip"
   
   ENV APACHE_TOMCAT_VERSION 8.5.37
   ENV APACHE_TOMCAT_PACKAGE apache-tomcat-${APACHE_TOMCAT_VERSION}
   ENV APACHE_TOMCAT_URL https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.37/bin/${APACHE_TOMCAT_PACKAGE}.zip
   
   #location of mysql script to init knowage db
  -ENV KNOWAGE_MYSQL_SCRIPT_URL ${KNOWAGE_OW2_DDL_URL}/mysql-dbscripts-${KNOWAGE_VERSION}-${KNOWAGE_RELEASE_DATE}.zip
   
   ENV LIB_COMMONS_LOGGING_URL https://search.maven.org/remotecontent?filepath=commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
   ENV LIB_COMMONS_LOGGING_API_URL https://search.maven.org/remotecontent?filepath=commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
  
positive.code: WORKDIR ${KNOWAGE_DIRECTORY}/${APACHE_TOMCAT_PACKAGE}/webapps
  
  #download knowage engines and extract them
  RUN wget "${KNOWAGE_CORE_URL}" && \
         unzip ${KNOWAGE_CORE_ENGINE}.war -d ${KNOWAGE_CORE_ENGINE} && \
         rm ${KNOWAGE_CORE_ENGINE}.war
  
  RUN wget "${KNOWAGE_BIRTREPORT_URL}" && \
         unzip ${KNOWAGE_BIRTREPORT_ENGINE}.war -d ${KNOWAGE_BIRTREPORT_ENGINE} && \
         rm ${KNOWAGE_BIRTREPORT_ENGINE}.war
  
  RUN wget "${KNOWAGE_COCKPIT_URL}" && \
         unzip ${KNOWAGE_COCKPIT_ENGINE}.war -d ${KNOWAGE_COCKPIT_ENGINE} && \
         rm ${KNOWAGE_COCKPIT_ENGINE}.war
  
  RUN wget "${KNOWAGE_COMMONJ_URL}" && \
         unzip ${KNOWAGE_COMMONJ_ENGINE}.war -d ${KNOWAGE_COMMONJ_ENGINE} && \
         rm ${KNOWAGE_COMMONJ_ENGINE}.war
  
  RUN wget "${KNOWAGE_DATAMINING_URL}" && \
         unzip ${KNOWAGE_DATAMINING_ENGINE}.war -d ${KNOWAGE_DATAMINING_ENGINE} && \
         rm ${KNOWAGE_DATAMINING_ENGINE}.war
  
  RUN wget "${KNOWAGE_GEOREPORT_URL}" && \
         unzip ${KNOWAGE_GEOREPORT_ENGINE}.war -d ${KNOWAGE_GEOREPORT_ENGINE} && \
         rm ${KNOWAGE_GEOREPORT_ENGINE}.war
  
  RUN wget "${KNOWAGE_JASPERREPORT_URL}" && \
         unzip ${KNOWAGE_JASPERREPORT_ENGINE}.war -d ${KNOWAGE_JASPERREPORT_ENGINE} && \
         rm ${KNOWAGE_JASPERREPORT_ENGINE}.war
  
  RUN wget "${KNOWAGE_KPI_URL}" && \
         unzip ${KNOWAGE_KPI_ENGINE}.war -d ${KNOWAGE_KPI_ENGINE} && \
         rm ${KNOWAGE_KPI_ENGINE}.war
  
  RUN wget "${KNOWAGE_META_URL}" && \
         unzip ${KNOWAGE_META_ENGINE}.war -d ${KNOWAGE_META_ENGINE} && \
         rm ${KNOWAGE_META_ENGINE}.war
  
  RUN wget "${KNOWAGE_NETWORK_URL}" && \
         unzip ${KNOWAGE_NETWORK_ENGINE}.war -d ${KNOWAGE_NETWORK_ENGINE} && \
         rm ${KNOWAGE_NETWORK_ENGINE}.war
  
  RUN wget "${KNOWAGE_QBE_URL}" && \
         unzip ${KNOWAGE_QBE_ENGINE}.war -d ${KNOWAGE_QBE_ENGINE} && \
         rm ${KNOWAGE_QBE_ENGINE}.war
  
  RUN wget "${KNOWAGE_SVGVIEWER_URL}" && \
         unzip ${KNOWAGE_SVGVIEWER_ENGINE}.war -d ${KNOWAGE_SVGVIEWER_ENGINE} && \
         rm ${KNOWAGE_SVGVIEWER_ENGINE}.war
  
  RUN wget "${KNOWAGE_TALEND_URL}" && \
         unzip ${KNOWAGE_TALEND_ENGINE}.war -d ${KNOWAGE_TALEND_ENGINE} && \
         rm ${KNOWAGE_TALEND_ENGINE}.war
  
  RUN wget "${KNOWAGE_WHATIF_URL}" && \
         unzip ${KNOWAGE_WHATIF_ENGINE}.war -d ${KNOWAGE_WHATIF_ENGINE} && \
         rm ${KNOWAGE_WHATIF_ENGINE}.war
  
  #go to apache tomcat lib directory
  WORKDIR ${KNOWAGE_DIRECTORY}/${APACHE_TOMCAT_PACKAGE}/lib
  
negative.code: WORKDIR ${KNOWAGE_DIRECTORY}
  
  #install required packages and clean up to save space
  RUN apt-get update && apt-get upgrade -y && apt-get install -y wget coreutils unzip mysql-client  && rm -rf /var/lib/apt/lists/*
  
  #download mysql scripts
  RUN wget "${KNOWAGE_MYSQL_SCRIPT_URL}" -O mysql.zip && \
  