Reputation: 15
Similar questions seem to exist but none of them with clear answer (at least not to me). I've an LDAP Server inside a container which comes with bin/start-ds
file. The problem is the container exits as soon as the shell script is finished. I'd understand the exit if script was simply printing a message, but in my case it starts a process. And since a process is running, i'd expect my container to run indefinitely as I started it in detach
mode. But this is not the case and it exits immediately. Any pointers would be really appreciated. Below is my simple Dockerfile
:
FROM unboundid-base:0.2
MAINTAINER helloworld
CMD ["/home/unboundid/UnboundID-DS/bin/start-ds"]
Upvotes: 1
Views: 662
Reputation: 11
I run all of the UnboundID server products in docker containers for dev/test/troubleshooting. My Dockerfile CMD line is:
CMD ${UBID_HOME}/bin/start-${UBID_PRODUCT};/bin/bash
As long as you leave a foreground process running the container will not exit and what better process to leave around than a shell to interact with the server.
Upvotes: 0
Reputation: 1666
There can be two reason:
CMD ["/home/unboundid/UnboundID-DS/bin/start-ds", "--nodetach"]
Hope this helps.
Upvotes: 2
Reputation: 8527
As I guess, you use: http://docs.oracle.com/cd/E19623-01/820-6171/startds.html
So according to documentation add: --nodetach option
CMD ["/home/unboundid/UnboundID-DS/bin/start-ds", "--nodetach"]
Upvotes: 1