[Docker] Testing Environment for clustered Wildfly using DNS (2)
* Building image with Dockerfile
Among following images, Wildfly is the most changable. Because, as you may know, there are many version of wildfly you can test and a lot of different configurations can be applied. Therefore, I am going to describe how to build Wildfly.
- DNS
- Apache
- Wildfly
0. Go to wildfly git folder.
# cd /home/git/sample-docker/wildfly |
1. Download Wildfly image file
As of today(8.5), wildfly 8.1.0 Final is latest. It can be downloaded from wildfly_home.
2. Pull base image from index repository(docker hub)
# docker pull ljhiyh/centos65 |
3. Execute `docker-builder.sh`
[jooho:/ext02/Git/JhouseGit/sample-docker/wildfly]# ./docker-builder.sh previous script.tar will be uploaded Sending build context to Docker daemon 129.9 MB Sending build context to Docker daemon Step 0 : FROM ljhiyh/centos65 ---> 8fc079626ddc Step 1 : ADD epel-release-6-8.noarch.rpm /etc/yum.repos.d/ ---> Using cache ---> 9f04667b31b4 Step 2 : RUN rpm -ivh /etc/yum.repos.d/epel-release-6-8.noarch.rpm ---> Using cache ---> 0d0727aa2134 Step 3 : RUN yum update -y ---> Using cache ---> 7ea9f7c8046c Step 4 : RUN yum install -y java-1.7.0-openjdk ---> Using cache ---> 24bc48a70e55 Step 5 : RUN yum install -y unzip ---> Using cache ---> b8792a7a40a9 Step 6 : RUN yum install -y openssh-server ---> Using cache ---> a8560b92d6d4 Step 7 : RUN yum install -y openssh-clients ---> Using cache ---> 091cf68c34fa Step 8 : RUN yum install -y supervisor ---> Using cache ---> 192954a410c0 Step 9 : ADD supervisord.conf /home/supervisord.conf ---> Using cache ---> 6f2f6750846c Step 10 : RUN cat /home/supervisord.conf > /etc/supervisord.conf ---> Using cache ---> 042912a9ff97 Step 11 : ADD bashrc /home/bashrc ---> Using cache ---> f3640dc8b1fd Step 12 : RUN cat /home/bashrc >> /etc/profile ---> Using cache ---> 502f0ec452cf Step 13 : RUN echo 'root:redhat' | chpasswd ---> Using cache ---> bb7954053539 Step 14 : ADD wildfly-8.1.0.Final.zip /home/ ---> Using cache ---> 75e11abd3967 Step 15 : RUN unzip -q /home/wildfly-8.1.0.Final.zip -d /home ---> Using cache ---> 5981ee1a0f8a Step 16 : ADD scripts.tar /home/wildfly-8.1.0.Final ---> 7490a17e274a Removing intermediate container 18fc2e963c1c Step 17 : ADD env_vm.sh /home/ ---> 2c8a2ca48cb1 Removing intermediate container c2664eecba5e Step 18 : RUN /home/env_vm.sh ---> Running in e762151bcd26 sed -e 58s/remote/jboss/g /home/wildfly-8.1.0.Final/domain/configuration/host-slave.xml ---> 01dfec886072 Removing intermediate container e762151bcd26 Step 19 : WORKDIR /home/wildfly-8.1.0.Final ---> Running in 11da80b61e4a ---> 7b07164e9212 Removing intermediate container 11da80b61e4a Step 20 : RUN bin/add-user.sh -s jboss !qaz2wsx ---> Running in ba39620d7997 ---> 1623f3ead045 Removing intermediate container ba39620d7997 Step 21 : USER root ---> Running in 1a35aa76bb65 ---> 94333f759486 Removing intermediate container 1a35aa76bb65 Step 22 : WORKDIR /home ---> Running in f61efeaef477 ---> f457ea4f2bb9 Removing intermediate container f61efeaef477 Step 23 : EXPOSE 22 8080 9990 9999 ---> Running in 8476a060dcc1 ---> e17127d6afc8 Removing intermediate container 8476a060dcc1 Step 24 : CMD ["/usr/bin/supervisord"] ---> Running in f733732f2ef2 ---> 4468c92746f2 Removing intermediate container f733732f2ef2 Successfully built 4468c92746f2 |
OK! That's it. Now, you finished to build docker image for wildfly. Pretty easy?!
From now on, you can refer this blog to start Wildfly.
THANKS for Reading!