From 0f8ceca2fbf7f18c36a8e227ceec15054af2d13c Mon Sep 17 00:00:00 2001 From: Olaf Reineke Date: Thu, 24 Jul 2014 16:47:47 +0200 Subject: [PATCH 1/2] Docker container for Wildfly 8.1.0-Final --- wildfly/8.1/Dockerfile | 29 +++++++++++++++++++++++++++++ wildfly/8.1/README.md | 23 +++++++++++++++++++++++ wildfly/8.1/deploy-and-run.sh | 14 ++++++++++++++ wildfly/8.1/mgmt-groups.properties | 21 +++++++++++++++++++++ wildfly/8.1/mgmt-users.properties | 26 ++++++++++++++++++++++++++ 5 files changed, 113 insertions(+) create mode 100644 wildfly/8.1/Dockerfile create mode 100644 wildfly/8.1/README.md create mode 100755 wildfly/8.1/deploy-and-run.sh create mode 100644 wildfly/8.1/mgmt-groups.properties create mode 100644 wildfly/8.1/mgmt-users.properties diff --git a/wildfly/8.1/Dockerfile b/wildfly/8.1/Dockerfile new file mode 100644 index 0000000..59162a3 --- /dev/null +++ b/wildfly/8.1/Dockerfile @@ -0,0 +1,29 @@ +FROM dockerfile/java + +MAINTAINER zb@consol.de olafr@consol.de + +EXPOSE 8080 + +ENV WILDFLY_VERSION 8.1.0.Final +ENV DEPLOY_DIR /maven + +ENV http_proxy http://proxy.consol.de:8001 + +RUN wget http://download.jboss.org/wildfly/${WILDFLY_VERSION}/wildfly-${WILDFLY_VERSION}.tar.gz -O /tmp/wildfly.tar.gz + +# Unpack +RUN tar xzf /tmp/wildfly.tar.gz -C /opt +RUN ln -s /opt/wildfly-${WILDFLY_VERSION} /opt/wildfly +RUN rm /tmp/wildfly.tar.gz + +# Add roles +ADD mgmt-groups.properties /opt/wildfly-${WILDFLY_VERSION}/standalone/configuration/ +ADD mgmt-users.properties /opt/wildfly-${WILDFLY_VERSION}/standalone/configuration/ + +# Startup script +ADD deploy-and-run.sh /opt/wildfly-${WILDFLY_VERSION}/bin/ + +ENV WILDFLY_HOME /opt/wildfly +ENV PATH $PATH:$WILDFLY_HOME/bin + +CMD /opt/wildfly-${WILDFLY_VERSION}/bin/deploy-and-run.sh diff --git a/wildfly/8.1/README.md b/wildfly/8.1/README.md new file mode 100644 index 0000000..3e747bf --- /dev/null +++ b/wildfly/8.1/README.md @@ -0,0 +1,23 @@ +## JBoss Wildfly 8.1.0-Final + +A simple docker build for installing a vanilla Wildfly 8.1 below +*/opt/wildfly*. It comes out of the box and is intended for use for +integration testing. + +During startup a directory /maven is checked for .war files. If there +are any, they are linked into Wildfly's standalone/deployments/ directory for automatic +deployment. This plays nicely with the Docker maven plugin from +https://github.com/rhuss/docker-maven-plugin/ and its 'assembly' mode which +can automatically can create Docker data container with Maven artefacts +exported from a directory "/maven". + +Features: + +* Wildfly Version: **8.1.0-Final** +* Java Version: **Oracle 1.7.0_51-b13** (base image: *dockerfile/java*) +* Port: **8080** +* User **admin** (Password: **admin**) has been added to access the Wildfly admin console +* Command: `/opt/wildfly/bin/deploy-and-run.sh` which links .war files from */maven* to + */opt/wildfly/standalone/deployments* and then calls `standalone.sh` +* Sets `-Djava.security.egd=file:/dev/./urandom` for faster startup times + (though a bit less secure) diff --git a/wildfly/8.1/deploy-and-run.sh b/wildfly/8.1/deploy-and-run.sh new file mode 100755 index 0000000..0787618 --- /dev/null +++ b/wildfly/8.1/deploy-and-run.sh @@ -0,0 +1,14 @@ +#!/bin/sh +DIR=${DEPLOY_DIR:-/maven} +APPSRVHOME="/opt/wildfly" +echo "Checking *.war in $DIR" +if [ -d $DIR ]; then + for i in $DIR/*.war; do + file=$(basename $i) + dest="$APPSRVHOME/standalone/deployments/$file" + echo "Linking $i --> $dest" + ln -s $i $dest + done +fi +# start app server with fast but unsecure random number generator +JAVA_OPTS="$JAVA_OPTS -Djava.security.egd=file:/dev/./urandom" $APPSRVHOME/bin/standalone.sh diff --git a/wildfly/8.1/mgmt-groups.properties b/wildfly/8.1/mgmt-groups.properties new file mode 100644 index 0000000..35549e3 --- /dev/null +++ b/wildfly/8.1/mgmt-groups.properties @@ -0,0 +1,21 @@ +# +# Properties declaration of users groups for the realm 'ManagementRealm'. +# +# This is used for domain management, users groups membership information is used to assign the user +# specific management roles. +# +# Users can be added to this properties file at any time, updates after the server has started +# will be automatically detected. +# +# The format of this file is as follows: - +# +# A utility script is provided which can be executed from the bin folder to add the users: - +# - Linux +# bin/add-user.sh +# +# - Windows +# bin\add-user.bat +# +# The following illustrates how an admin user could be defined. +# +admin= diff --git a/wildfly/8.1/mgmt-users.properties b/wildfly/8.1/mgmt-users.properties new file mode 100644 index 0000000..f4f9230 --- /dev/null +++ b/wildfly/8.1/mgmt-users.properties @@ -0,0 +1,26 @@ +# +# Properties declaration of users for the realm 'ManagementRealm' which is the default realm +# for new installations. Further authentication mechanism can be configured +# as part of the in standalone.xml. +# +# Users can be added to this properties file at any time, updates after the server has started +# will be automatically detected. +# +# By default the properties realm expects the entries to be in the format: - +# +# A utility script is provided which can be executed from the bin folder to add the users: - +# - Linux +# bin/add-user.sh +# +# - Windows +# bin\add-user.bat +# On start-up the server will also automatically add a user $local - this user is specifically +# for local tools running against this AS installation. +# +# The following illustrates how an admin user could be defined, this +# is for illustration only and does not correspond to a usable password. +# +admin=c22052286cd5d72239a90fe193737253 +# +#$REALM_NAME=ManagementRealm$ This line is used by the add-user utility to identify the realm name already used in this file. +# From aede1bec4bfa621036a9a39ddda76070c058890f Mon Sep 17 00:00:00 2001 From: Olaf Reineke Date: Thu, 24 Jul 2014 17:19:36 +0200 Subject: [PATCH 2/2] Removed proxy from wildfly/8.1/Dockerfile --- wildfly/8.1/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/wildfly/8.1/Dockerfile b/wildfly/8.1/Dockerfile index 59162a3..75f79a0 100644 --- a/wildfly/8.1/Dockerfile +++ b/wildfly/8.1/Dockerfile @@ -7,8 +7,6 @@ EXPOSE 8080 ENV WILDFLY_VERSION 8.1.0.Final ENV DEPLOY_DIR /maven -ENV http_proxy http://proxy.consol.de:8001 - RUN wget http://download.jboss.org/wildfly/${WILDFLY_VERSION}/wildfly-${WILDFLY_VERSION}.tar.gz -O /tmp/wildfly.tar.gz # Unpack