티스토리 뷰

728x90
반응형
Testing Environment for clustered Wildfly using DNS (2)


Last post, I talked about test environment for clustered Wildfly using generated image files. This is a pretty easy way as you can see there are only 5 steps commands. On the other hands, the way is not flexible to be cope with even small changes. 

Suppose that new Wildfly 10 GA version come out and what if you want to try the version, what should you do?  In this case, there is no ways to meet this goal with generated images files from Docker Hub. You should build new docker images with the Wildfly 10. 

When it comes to building new images, sound like it is big deal but actually it depends on the line(location) of the command,which would be "ADD Wildfly image file" in this case, in Dockerfile. The lower line of command change, the faster docker image build. The reason why the time have dependency with the line of command or files in Dockerfile is that because docker use AuFS file system. Hence, Docker will retrieves the file system from its cache for a command if the command has already executed before like Git. I believe that you don't need to know about the internal logic deeply so I will skip it but if you want to know more detail, please refer this BLOG 

Therefore, I will elaborate how to build images here through 2 scenarios.
   

 * 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!


반응형
댓글
250x250
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함