Docker Community Forums

Share and learn in the Docker community.

Docker, image and Wildfly

dockerhub
build
docker

(Inkimar) #1

Hello,

I am running a docker project today.
My goal is to package this in an image and push to dockerhub, but I am facing problems.

my docker-compose.yml-file consists of
db:
image: mysql:5.6
env_file: .env

as:
build: ./wildfly-custom

db:
The mysql with a sql-file creates the database, database = mymedia

as:
The wildfly-custom directory contains.
Dockerfile with FROM jboss/wildfly:8.2.1.Final + customization/configuration (jdbc-jar + eclipse-jar + a datasource )

The war-file which i deploy to wildfly through a Makefile uses the mymedia-database.
this works and the order of things is important.
the database needs to be up and running so that my wildfly-datarsource can be created ( JNDI-names points to the database ).
if I forget to start the database before i start wildfly , the wildfly-datasource cannot be created.

Now I would like to create an image and push that image to dockerhub.
the image should contain my customization/configuration + the war file.

The question could be a wildfly-question, could I creata a ds without the database beeing present ?
data-source add --name=MedDS
–jndi-name=java:/MedDS
–driver-name=mysql-connector-java-5.1.38-bin.jar_com.mysql.jdbc.Driver_5_1
–connection-url=jdbc:mysql://dbmedia:3306/mymedia?useUnicode=true&characterEncoding=UTF-8
–user-name=mediaserver \
–password=mediaserver
–check-valid-connection-sql=“SELECT 1”
–background-validation=true
–background-validation-millis=60000
–flush-strategy=IdleConnections
–min-pool-size=10
–max-pool-size=50
–pool-prefill=false
–use-ccm=true
–blocking-timeout-wait-millis=5000
–enabled=true

or is there another way ?

regards