Building Docker Images from Local Files

71 views
Skip to first unread message

Brian Hansen Stewart

unread,
Jun 24, 2024, 6:38:25 PMJun 24
to Kill Bill users mailing-list
Hi, relatively new to Docker here so sorry if I'm making any simple mistakes.  I have been looking into making my own Docker images of Killbill and Kaui, as a way to double check that any changes I make in the code will work on container.  However, I am struggling to figure out what scripts and commands to do this.  I've been looking into the scripts in the killbill-cloud and the killbill-cloud/docker repos, but I worry I am missing something.  What scripts should I be using or modifying to make new images for Killbill and Kaui that reflect local changes made? If the scripts in the kill bill-cloud/docker repo can do this task, where should I be making changes towards this end?  To be clear, my goal is to take changes made in the killbill and kaui repositories locally and make new images that reflect those changes, so using any existing Docker Hub images for killbill/kaui will not work.

Thank you for your time.
-Brian H. Stewart

karan bansal

unread,
Jun 26, 2024, 3:14:06 PMJun 26
to Kill Bill users mailing-list
Hi Brian,

Usually the best way to test local changes/Dev work would be via Jetty server. The instructions are mentioned here. It is also possible to generate War file and deploy them via Tomcat server. Any particular reason to use docker?

Regards
Karan

Brian Hansen Stewart

unread,
Jun 27, 2024, 12:55:44 PMJun 27
to Kill Bill users mailing-list
I'm focusing on Docker since it is the target environment for my team.  I plan to setup a Tomcat or Jetty environment for testing changes as well, but I want to make sure I have a way to push out a working Docker image first since that is what my team will want to test on.  I'm focusing on the Kaui module first. I've been looking through the scripts and configuration in the killbill-cloud repo, and while everything works fine when I'm using images and libraries from the cloud via KPM, I'm not sure how to change the dockerfile in killbill-cloud/docker/templates/kaui to use a locally built Kaui gem instead.  I may be missing a step in the process or a script somewhere, I'm new to Ruby.  So any guidance on what I'm missing is appreciated.  If there are any details that would be helpful for me to provide let me know.  

Thanks again for your time, 
Brian

Brian Hansen Stewart

unread,
Jun 27, 2024, 12:55:46 PMJun 27
to Kill Bill users mailing-list
I'm focusing on Docker for now as that is the target environment my team will want to verify all our changes on.  I want to make sure we can test our changes in the target environment before we get too far into the process.  I have tested some changes locally already and I am planning on setting up a Jetty or Tomcat server locally as well once I have this resolved.  My problem for now is that when I try to create Docker images out of my local changes, it does not display expected behavior.  I'm focusing on Kaui for now, and trying to have KPM load a copy of my locally build gem causes either the routes to break or an error with the environment configs (such as secret keys) despite the fact that these errors are not happening when I run the gem locally.  I'm assuming this has to do with a misunderstanding of the way the scripts in kill bill-cloud/docker work, or KPM itself.  Any guidance on how to adapt these scripts to work with local builds would be appreciated.  Sorry for the slow response, I thought I responded to this yesterday until I checked it this morning.  

Thank you again for your time,
Brian

On Wednesday, June 26, 2024 at 1:14:06 PM UTC-6 karan bansal wrote:

karan bansal

unread,
Jun 28, 2024, 2:54:47 PMJun 28
to Kill Bill users mailing-list
Hi Brian,

This is the Kaui specific ansible task that is used to download and install Kaui war. You will need to generate the war file for your local code and then swap the war file that the above task downloads.

Regards
Karan

Brian Hansen Stewart

unread,
Jun 30, 2024, 3:27:47 AMJun 30
to Kill Bill users mailing-list
Sorry if I'm misunderstanding something here, but I'm not sure what you mean. When Ansible triggers KPM install, it downloads the .war into a temp folder and installs it to tomcat in the same command.  I'm not sure how to redirect the KPM install to a different .war, since I have not found an example of that.  I have tried unpacking the .war into tomcat myself but since it conflicts with the Ansible/KPM flow it causes problems with the deployment.  Is there a way to redirect KPM to a specific local .war that I should know about?  

Regards,
Brian
Reply all
Reply to author
Forward
0 new messages