Public | Automated Build

Last pushed: 10 months ago
Short Description
Wildfly 10.1.0.Final + on-startup script
Full Description

Wildfly 10.1.0.Final + on-startup script

Usage

  1. In order to use this image create your own Dockerfile and extend by typing:
    FROM swit3k/wildfly
    
  2. Then copy your deployables to $DEPLOYMENT_DIR like this:
    COPY mywar.war $DEPLOYMENT_DIR
    
  3. And optionally copy your on_startup.sh script to $SCRIPTS_DIR:
    COPY on_startup.sh $SCRIPTS_DIR
    

Once Wildfly's administration console is up & running your on_startup.sh will be triggered. You can use it to support CLI commands.

Example

Integration with external ActiveMQ instance via ActiveMQ Resource Adapter:

Directory structure

/your/dir/
   Dockerfile
   mdb.war
   activemq-rar-5.13.2.rar
   scripts/
       on_startup.sh
       activemq-resource-adapter.cli
  1. Dockerfile
    FROM swit3k/wildfly
    COPY mdb.war $DEPLOYMENT_DIR
    COPY activemq-rar-5.13.2.rar $DEPLOYMENT_DIR
    COPY ./scripts/* $SCRIPTS_DIR/
    
  2. scripts/on_startup.sh
    ./bin/jboss-cli.sh --file=./scripts/activemq-resource-adapter.cli
    
  3. scripts/activemq-resource-adapter.cli
    connect
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar:add(archive=activemq-rar-5.13.2.rar, transaction-support=XATransaction)
    /subsystem=ejb3:write-attribute(name="default-resource-adapter-name", value="activemq-5.13.rar")
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar/config-properties=UserName/:add(value=admin)
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar/config-properties=Password/:add(value=admin)
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar/config-properties=ServerUrl/:add(value="tcp://localhost:61616")
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar/config-properties=UseInboundSession/:add(value=false)
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar/connection-definitions=cfName:add(class-name=org.apache.activemq.ra.ActiveMQManagedConnectionFactory, jndi-name=java:/activemq/ConnectionFactory, enabled=true, use-java-context=true)
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar/admin-objects=queue1:add(class-name=org.apache.activemq.command.ActiveMQQueue, jndi-name=java:jboss/jms/activemq/queue/TestQueue, use-java-context=true)  
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar/admin-objects=queue1/config-properties=PhysicalName/:add(value=activemq/queue/TestQueue)
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar/admin-objects=topic1:add(class-name=org.apache.activemq.command.ActiveMQTopic, jndi-name=java:jboss/jms/activemq/topic/TestTopic, use-java-context=true)
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar/admin-objects=topic1/config-properties=PhysicalName/:add(value=activemq/topic/TestTopic)
    /subsystem=resource-adapters/resource-adapter=activemq-5.13.rar:activate
    
  4. Build your own image
    docker build -t your/image .
    
  5. Run it
    docker run -d your/image
    
Docker Pull Command
Owner
swit3k
Source Repository

Comments (0)