Browse Source

setup module

master
Richard Shih 6 years ago
parent
commit
bc3a425e45
6 changed files with 248 additions and 0 deletions
  1. 56
      wildfly/Dockerfile
  2. 42
      wildfly/modules/make_modules.sh
  3. 26
      wildfly/modules/module_zk.xml
  4. 57
      wildfly/modules/module_zk7.xml
  5. 57
      wildfly/modules/module_zk8.xml
  6. 10
      wildfly/startwf-ha.sh

56
wildfly/Dockerfile

@ -0,0 +1,56 @@
FROM jboss/wildfly
# Environment variable with default value
ARG WAR_FILE_FROM=appfile.war
ARG WAR_FILE_DEPLOY=${WAR_FILE_FROM}
#RUN echo ${APP_FILE}
USER root
# RUN yum install net-tools -y
#prepare tmp dir
COPY modules/*.xml /tmp/modules
#create additional modules
RUN /tml/modules/make_module.sh
#setup zk module(8.0.2.2)
RUN mkdir -p /zk_lib && \
mkdir -p /opt/jboss/wildfly/modules/system/layers/base/org/zkoss/zk/main && \
curl -#L https://www.zkoss.org/zkdownload/downloadEvalFile?id=1884780989 | bsdtar -xf- -C /zk_lib && \
find /zk_lib/zk-bin-8.0.2.2/dist/lib -name '*.jar' | xargs -I{} cp {} /opt/jboss/wildfly/modules/system/layers/base/org/zkoss/zk/main && \
rm -rf ./zk_lib
COPY module_zk8.xml /opt/jboss/wildfly/modules/system/layers/base/org/zkoss/zk/main/module.xml
#setup zk module(7.0.3)
RUN mkdir -p /zk_lib && cd /zk_lib && \
curl -o zcommon.jar http://central.maven.org/maven2/org/zkoss/common/zcommon/7.0.3/zcommon-7.0.3.jar && \
curl -o zweb.jar http://central.maven.org/maven2/org/zkoss/common/zweb/7.0.3/zweb-7.0.3.jar && \
curl -o zul.jar http://central.maven.org/maven2/org/zkoss/zk/zul/7.0.3/zul-7.0.3.jar && \
curl -o zk.jar http://central.maven.org/maven2/org/zkoss/zk/zk/7.0.3/zk-7.0.3.jar && \
curl -o zkplus.jar http://central.maven.org/maven2/org/zkoss/zk/zkplus/7.0.3/zkplus-7.0.3.jar && \
curl -o zhtml.jar http://central.maven.org/maven2/org/zkoss/zk/zhtml/7.0.3/zhtml-7.0.3.jar && \
curl -o zkbind.jar http://central.maven.org/maven2/org/zkoss/zk/zkbind/7.0.3/zkbind-7.0.3.jar && \
curl -o zel.jar http://central.maven.org/maven2/org/zkoss/common/zel/7.0.3/zel-7.0.3.jar && \
curl -o silvertail.jar http://central.maven.org/maven2/org/zkoss/theme/silvertail/7.0.3/silvertail-7.0.3.jar && \
curl -o sapphire.jar http://central.maven.org/maven2/org/zkoss/theme/sapphire/7.0.3/sapphire-7.0.3.jar && \
curl -o zsoup.jar http://mavensync.zkoss.org/maven2/org/zkoss/zsoup/1.8.2.5/zsoup-1.8.2.5.jar && \
curl -o bsh.jar http://central.maven.org/maven2/org/apache-extras/beanshell/bsh/2.0b6/bsh-2.0b6.jar && \
curl -o slf4j-api.jar http://central.maven.org/maven2/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar && \
curl -o slf4j-jdk14.jar http://central.maven.org/maven2/org/slf4j/slf4j-jdk14/1.7.5/slf4j-jdk14-1.7.5.jar && \
COPY module_zk7.xml /opt/jboss/wildfly/modules/system/layers/base/org/zkoss/zk/main/module.xml
# Add your application to the deployment folder
COPY ${WAR_FILE_FROM} /opt/jboss/wildfly/standalone/deployments/${WAR_FILE_DEPLOY}
COPY standalone-ha.xml /opt/jboss/wildfly/standalone/configuration/standalone-ha.xml
COPY startwf-ha.sh /opt/jboss/wildfly/bin/startwf-ha.sh
# Add user for adminstration purpose
RUN /opt/jboss/wildfly/bin/add-user.sh admin admin123 --silent
USER jboss
EXPOSE 8080 9990
CMD ["sh","-c","/opt/jboss/wildfly/bin/startwf-ha.sh"]

42
wildfly/modules/make_modules.sh

@ -0,0 +1,42 @@
#variablies
WF_MODULE_PATH='/opt/jboss/wildfly/modules/system/layers/base'
ZK8_VER='8.0.2.2'
ZK7_VER='7.0.3'
#setup zk module(7.0.3)
mkdir -p ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER} && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/zcommon.jar http://central.maven.org/maven2/org/zkoss/common/zcommon/$ZK7_VER/zcommon-$ZK7_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/zweb.jar http://central.maven.org/maven2/org/zkoss/common/zweb/$ZK7_VER/zweb-$ZK7_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/zul.jar http://central.maven.org/maven2/org/zkoss/zk/zul/$ZK7_VER/zul-$ZK7_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/zk.jar http://central.maven.org/maven2/org/zkoss/zk/zk/$ZK7_VER/zk-$ZK7_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/zkplus.jar http://central.maven.org/maven2/org/zkoss/zk/zkplus/$ZK7_VER/zkplus-$ZK7_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/zhtml.jar http://central.maven.org/maven2/org/zkoss/zk/zhtml/$ZK7_VER/zhtml-$ZK7_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/zkbind.jar http://central.maven.org/maven2/org/zkoss/zk/zkbind/$ZK7_VER/zkbind-$ZK7_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/zel.jar http://central.maven.org/maven2/org/zkoss/common/zel/$ZK7_VER/zel-$ZK7_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/silvertail.jar http://central.maven.org/maven2/org/zkoss/theme/silvertail/$ZK7_VER/silvertail-$ZK7_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/sapphire.jar http://central.maven.org/maven2/org/zkoss/theme/sapphire/$ZK7_VER/sapphire-$ZK7_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/zsoup.jar http://mavensync.zkoss.org/maven2/org/zkoss/zsoup/1.8.2.5/zsoup-1.8.2.5.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/bsh.jar http://central.maven.org/maven2/org/apache-extras/beanshell/bsh/2.0b6/bsh-2.0b6.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/slf4j-api.jar http://central.maven.org/maven2/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/slf4j-jdk14.jar http://central.maven.org/maven2/org/slf4j/slf4j-jdk14/1.7.5/slf4j-jdk14-1.7.5.jar && \
cp ./module_zk7.xml ${WF_MODULE_PATH}/org/zkoss/zk/${ZK7_VER}/module.xml
#setup zk module(8.0.2.2)
mkdir -p ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER} && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/zcommon.jar http://central.maven.org/maven2/org/zkoss/common/zcommon/$ZK8_VER/zcommon-$ZK8_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/zweb.jar http://central.maven.org/maven2/org/zkoss/common/zweb/$ZK8_VER/zweb-$ZK8_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/zul.jar http://central.maven.org/maven2/org/zkoss/zk/zul/$ZK8_VER/zul-$ZK8_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/zk.jar http://central.maven.org/maven2/org/zkoss/zk/zk/$ZK8_VER/zk-$ZK8_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/zkplus.jar http://central.maven.org/maven2/org/zkoss/zk/zkplus/$ZK8_VER/zkplus-$ZK8_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/zhtml.jar http://central.maven.org/maven2/org/zkoss/zk/zhtml/$ZK8_VER/zhtml-$ZK8_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/zkbind.jar http://central.maven.org/maven2/org/zkoss/zk/zkbind/$ZK8_VER/zkbind-$ZK8_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/zel.jar http://central.maven.org/maven2/org/zkoss/common/zel/$ZK8_VER/zel-$ZK8_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/silvertail.jar http://central.maven.org/maven2/org/zkoss/theme/silvertail/$ZK8_VER/silvertail-$ZK8_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/sapphire.jar http://central.maven.org/maven2/org/zkoss/theme/sapphire/$ZK8_VER/sapphire-$ZK8_VER.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/zsoup.jar http://mavensync.zkoss.org/maven2/org/zkoss/zsoup/1.8.2.5/zsoup-1.8.2.5.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/bsh.jar http://central.maven.org/maven2/org/apache-extras/beanshell/bsh/2.0b6/bsh-2.0b6.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/slf4j-api.jar http://central.maven.org/maven2/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar && \
curl -o ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/slf4j-jdk14.jar http://central.maven.org/maven2/org/slf4j/slf4j-jdk14/1.7.5/slf4j-jdk14-1.7.5.jar && \
cp ./module_zk8.xml ${WF_MODULE_PATH}/org/zkoss/zk/${ZK8_VER}/module.xml

26
wildfly/modules/module_zk.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2011, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<module-alias xmlns="urn:jboss:module:1.3" name="org.zkoss.zk" target-name="org.zkoss.zk" target-slot="8.0.2.2">
</module-alias>

57
wildfly/modules/module_zk7.xml

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2011, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<module xmlns="urn:jboss:module:1.3" name="org.zkoss.zk" slot="7.0.3">
<resources>
<resource-root path="zcommon.jar"/>
<resource-root path="zel.jar"/>
<resource-root path="zhtml.jar"/>
<resource-root path="zk.jar"/>
<resource-root path="zkbind.jar"/>
<resource-root path="zkplus.jar"/>
<resource-root path="zsoup.jar"/>
<resource-root path="zul.jar"/>
<resource-root path="zweb.jar"/>
<resource-root path="sapphire.jar"/>
<resource-root path="silvertail.jar"/>
<resource-root path="slf4j-api.jar"/>
<resource-root path="slf4j-jdk14.jar"/>
<resource-root path="bsh.jar"/>
<!-- <resource-root path="commons-codec.jar"/>
<resource-root path="commons-fileupload.jar"/>
<resource-root path="commons-io.jar"/> -->
<!-- <resource-root path="javassist.jar"/> -->
</resources>
<dependencies>
<module name="javax.servlet.api"/>
<module name="org.javassist"/>
<module name="org.apache.commons.codec"/>
<module name="org.apache.commons.fileupload"/>
<module name="org.apache.commons.io"/>
<module name="org.jboss.vfs"/>
<module name="org.apache.commons.logging"/>
<module name="javaee.api"/>
</dependencies>
</module>

57
wildfly/modules/module_zk8.xml

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2011, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<module xmlns="urn:jboss:module:1.3" name="org.zkoss.zk" slot="8.0.2.2">
<resources>
<resource-root path="zcommon.jar"/>
<resource-root path="zel.jar"/>
<resource-root path="zhtml.jar"/>
<resource-root path="zk.jar"/>
<resource-root path="zkbind.jar"/>
<resource-root path="zkplus.jar"/>
<resource-root path="zsoup.jar"/>
<resource-root path="zul.jar"/>
<resource-root path="zweb.jar"/>
<resource-root path="sapphire.jar"/>
<resource-root path="silvertail.jar"/>
<resource-root path="slf4j-api.jar"/>
<resource-root path="slf4j-jdk14.jar"/>
<resource-root path="bsh.jar"/>
<!-- <resource-root path="commons-codec.jar"/>
<resource-root path="commons-fileupload.jar"/>
<resource-root path="commons-io.jar"/> -->
<!-- <resource-root path="javassist.jar"/> -->
</resources>
<dependencies>
<module name="javax.servlet.api"/>
<module name="org.javassist"/>
<module name="org.apache.commons.codec"/>
<module name="org.apache.commons.fileupload"/>
<module name="org.apache.commons.io"/>
<module name="org.jboss.vfs"/>
<module name="org.apache.commons.logging"/>
<module name="javaee.api"/>
</dependencies>
</module>

10
wildfly/startwf-ha.sh

@ -0,0 +1,10 @@
# IPADDRESS=$(ifconfig | grep -A 1 'eth0' | tail -1 | awk -F ' ' '{print $2}')
IPADDRESS=$(hostname -i)
# MCASTADDRESS=234.0.0.4
/opt/jboss/wildfly/bin/standalone.sh -c standalone.xml -b ${IPADDRESS}
# -u ${MCASTADDRESS} \
# -Djboss.bind.address=${IPADDRESS} \
# -Djboss.bind.address.management=${IPADDRESS} \
# -Djboss.bind.address.private=${IPADDRESS} \
# -Djboss.node.name=$(hostname) \
# -u=${MCASTADDRESS}
Loading…
Cancel
Save