Payara and Docker : Starting deployment groups and/or instances

85 views
Skip to first unread message

theirman

unread,
Jul 22, 2020, 10:25:31 AM7/22/20
to Payara Forum
Hello,

I am currently customizing the payara image for docker to configure it to the requirements of my users.

I have created two deployment groups (group-production and group-recette) and assigned 4 and 2 instances to them respectively. I then start my instances in the image so that everything is ready as soon as the image is deployed in docker. 




The instances of the groups start correctly when I build the image :



But when I deploy the image my instances are stopped. 





How can I keep them started between the construction of the image and its deployment?

Thanks
Thierry

theirman

unread,
Jul 23, 2020, 8:26:37 AM7/23/20
to Payara Forum
I've tried several things to solve this problem:
- I tried starting my instances manually and restarting docker... it didn't work.
- replace the start-deployment-group by n start-instance ... it didn't work any more
- use create-service on my n instances ... it didn't work any better

Finally, I used a postboot command file that I discovered this early afternoon ... and this time it works !

dockerfile : 



postboot-commands.asadmin :



results : 




Ondro Mihályi

unread,
Jul 24, 2020, 1:42:43 PM7/24/20
to theirman, Payara Forum
Hi, Thierry,

I think you don't understand how docker works when you build images and run containers.
You can't expect that you start a process when building a docker image and then it runs when you start a container based on the image.

During the build phase, if you want to configure the server using asadmin commands, you need to start the server and run asadmin commands against it.
But after the build phase, all processes are stopped as if the OS was shut down.

When you start a container, you need to indicate which processes to start. The default launch sequence given by the entry point and CMD command starts a single DAS.
You can launch additional asadmin commands if you pass a post-boot command file to the container. This file can even include asadmin commands to start other
preconfigured instances in existing deployment groups, or even can first create everything at boot and then launch the instances.

Follow the documentation on how to use the post-boot command file: https://hub.docker.com/r/payara/server-full/ (Search for "Custom commands at startup time")

Ondro



št 23. 7. 2020 o 14:26 theirman <thierry...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/aa6446c8-cbdc-4122-9525-77a3d9b7e40co%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages