Docker Image payara/server-full - no Debug mode?

460 views
Skip to first unread message

Ralph Soika

unread,
Mar 6, 2018, 5:47:20 AM3/6/18
to Payara Forum
Hi,
I am trying to setup a payara environment with docker. Therefore I use the official docker image payara/server-full form docker hub.


For several hours I try to start the payara container in debug mode with no success.

My first thought was to pass the debug option in the environment variable POSTBOOT_COMMANDS, but this did not work.

POSTBOOT_COMMANDS: "--debug=true"


Can anybody help me with this?

===
Ralph


Ondrej Mihályi

unread,
Mar 6, 2018, 8:43:31 AM3/6/18
to Ralph Soika, Payara Forum
Hi Ralph,

In order to run in debug, the --debug option has to be passed to the startInForeground.sh script. Currently, this can only be done by overwriting the default docker entrypoint and adding the --debug option, like this:

docker run -p 9080:8080 -p 9109:9009 --entrypoint '/bin/bash' payara/server-full -c '${PAYARA_PATH}/generate_deploy_commands.sh && ${PAYARA_PATH}/bin/startInForeground.sh --passwordfile=/opt/pwdfile -d --postbootcommandfile ${POSTBOOT_COMMANDS} ${PAYARA_DOMAIN}'

The debug port 9009 is bound to 9109.

This isn't very simple nor intuitive and I would like to simplify this scenario.

Ondro

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/dc0cf9f7-97fc-48af-9152-4266dea52b1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ralph Soika

unread,
Mar 6, 2018, 9:21:26 AM3/6/18
to Payara Forum
Hi Ondro,

thanks a lot. This looks good. It works if I use version 181 and later.

But I need again your help. I want to start the container as part of a docker-compose file. 
I tried the following:

version: "3.1"
services
:
  myapp
:
    image
: payara/server-full:181
    ports
:
     
- "8080:8080"
     
- "4848:4848"
     
- "8181:8181"
    entrypoint
: "'/bin/bash' payara/server-full -c '/opt/payara41/generate_deploy_commands.sh && /opt/payara41/bin/startInForeground.sh --passwordfile=/opt/pwdfile -d --postbootcommandfile ${POSTBOOT_COMMANDS} ${PAYARA_DOMAIN}'"
.....



But this seems to be nonsons. It results in

docker-compose up
WARNING
: The POSTBOOT_COMMANDS variable is not set. Defaulting to a blank string.
WARNING
: The PAYARA_DOMAIN variable is not set. Defaulting to a blank string.
Recreating myapp_1
nordic
-workflow_1  | /bin/bash: payara/server-full: No such file or directory
myapp_
_1 exited with code 127



 Can you give a hint how the entrypoint must look in a docker-compose.yml file?

Thanks for help

===
Ralph



Am Dienstag, 6. März 2018 14:43:31 UTC+1 schrieb Ondro Mihályi:
Hi Ralph,

In order to run in debug, the --debug option has to be passed to the startInForeground.sh script. Currently, this can only be done by overwriting the default docker entrypoint and adding the --debug option, like this:

docker run -p 9080:8080 -p 9109:9009 --entrypoint '/bin/bash' payara/server-full -c '${PAYARA_PATH}/generate_deploy_commands.sh && ${PAYARA_PATH}/bin/startInForeground.sh --passwordfile=/opt/pwdfile -d --postbootcommandfile ${POSTBOOT_COMMANDS} ${PAYARA_DOMAIN}'

The debug port 9009 is bound to 9109.

This isn't very simple nor intuitive and I would like to simplify this scenario.

Ondro
2018-03-06 11:47 GMT+01:00 Ralph Soika <atari...@gmail.com>:
Hi,
I am trying to setup a payara environment with docker. Therefore I use the official docker image payara/server-full form docker hub.


For several hours I try to start the payara container in debug mode with no success.

My first thought was to pass the debug option in the environment variable POSTBOOT_COMMANDS, but this did not work.

POSTBOOT_COMMANDS: "--debug=true"


Can anybody help me with this?

===
Ralph


--
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.

Ralph Soika

unread,
Mar 6, 2018, 9:43:14 AM3/6/18
to Payara Forum
Hi Ondro,

now I also solved the docker-compose.yml case.
A docker-compose-yml file must look like this to start payara in debug mode:


version: "3.1"
services
:


  myapp
:
    image
: payara/server-full:181
    ports
:
     
- "8080:8080"
     
- "4848:4848"
     
- "8181:8181"

     
- "9009:9009"
    entrypoint
: "/opt/payara41/bin/startInForeground.sh --passwordfile=/opt/pwdfile -d --postbootcommandfile glassfish/domains/domain1"



Thanks a lot for your help.

I think this to options to run payara in debug should be added into the readme.md file  - what do you think?

===
Ralph

Ondrej Mihályi

unread,
Mar 6, 2018, 10:34:51 AM3/6/18
to Ralph Soika, Payara Forum
Hi Ralph,

The "trick" is that the value of the entrypoint is just '/bin/bash'. Then it's followed by the image coordinates and the rest which starts with -c is the value of the exec property.

Dňa ut 6. 3. 2018, 15:21 Ralph Soika <atari...@gmail.com> napísal(a):

Allen Conquest

unread,
Feb 21, 2019, 10:19:11 AM2/21/19
to Payara Forum
Hi Ondro,

Is the issue that the entypoint.sh script doesn't pass any variables to the startInForeground.sh script? I need to run the entrypoint.sh script because it runs some scripts to prepare the container before the startInForeground.sh script.

I'll try updating the entrypoint.sh script. If that works then it might be a useful addition?

Allen

Allen Conquest

unread,
Feb 21, 2019, 12:47:54 PM2/21/19
to Payara Forum
Hi,

I have created a pull request on the docker-payaraserver-full github project. I think it could be useful for people. The one thing I forgot to do was update the documentation.
Reply all
Reply to author
Forward
0 new messages