Docker Community Forums

Share and learn in the Docker community.

Script in Dockerfile not terminating


(Iiptyf) #1

Hi,

I’m currently trying to create a domain and modify its settings with a javascript-script. This script is already used for setting up domains on the developer computers, and also work on linux. I have Glassfish and JDK 8 installed. In a minimal version, which only creates the domain I found out little more. If I call asadmin, an executeable for glassfish management, just once, the script will never terminate. However, It keeps on going! The following commands like printing messages still get called and get printed. I also can’t use exit(0); anymore, which stop commands after exit though. Same for throwing an exception. Even if I start the script as somewhere else suggested with “RUN jjs -scripting myscript; exit 0”. If I don’t call asadmin, exit and throw work as expected, and the script terminates correctly.

After terminating the build process, a container remains started with command “”/bin/sh -c 'jjs -scr". I have to restart the docker-machine before I can remove the container, even with option -f

Using Docker Toolbox 1.9.1h

Thanks for taking your time to respond in advance.


(Jeff Anderson) #2

This sounds like your jjs process is, for some reason, refusing to exit. What happens if you try to kill it with signal 9?


(Iiptyf) #3

Thanks for your quick response.
If I cancel the build script, and try to kill the remaining container with “docker kill --signal=KILL high_gates” then nothing happens. The docker kill command will not terminate.
If I call $EXEC("kill -9 -1 "); from within javascript it will move on with other commands and also not terminate. Same with $EXEC(“kill -9 $$”);


(Iiptyf) #4

No updates from my side. Does anyone else have any idea?


(Iiptyf) #5

I would appreciate any input, as this issue is still unresolved and blocking quite much. Thanks.