I have several running containers configured, and they are all running as intended, with one exception.
I need to start an application inside of the container, at container runtime.
If I start the container manually, removing the internal script execution at startup, I can then login to the container, and execute this script manually, without any issues.
But, when I attempt to run this same internal script, during startup, it always fails, and the container shuts down.
What is the proper way to execute an internal script, so that the application comes up at initial runtime?
Here is my Docker run command:
docker run -it
–publish=0.0.0.0:4810:4848
–publish=0.0.0.0:8810:8080
–publish=0.0.0.0:8110:8181
–publish=0.0.0.0:5010:5050
–publish=0.0.0.0:8210:5082
–publish=0.0.0.0:8310:5083
–publish=0.0.0.0:5810:5088
–publish=0.0.0.0:7110:7701
–publish=0.0.0.0:7210:7702
–publish=0.0.0.0:7310:7703
–mount type=bind,source=/Docker/GFTEST,target=/GLASSFISH
–hostname GFTEST --name=GFTEST
JCF/JCF:GLASSFISH_GFTEST /bin/bash
-c “/usr/local/bin/gftest”
The /usr/local/bin/gftest executes correctly if executed from within the container.
If executed during startup, it executes, but does not stay up and running.
It tries to start, but exits after restarting.
I thought about it being a permissions issue, where I need to source in the container root users .profile or .bashrc, but I have not actually tried that yet.
I know that this sometimes happens when running scripts via CRON, because the root .bashrc and .profile are not sourced through CRON, unless you specifically source in those hidden files inside of the script.
Could it be that simple?
I don’t want to make those changes to the startup script yet, without posting the question here first.
Maybe there’s a better way for me to invoke the internal script.
If there is a better way, please let me know here via this thread.
Thanks in advance, and have a very Happy New Year !!!