I can imagine this might be a Docker things rather...
# docker-commandbox
g
I can imagine this might be a Docker things rather than a commandbox-in-docker thing - but hopefully someone can help - nonetheless... Can I restart the CFML server, service in a container? I have tried to use
box server restart
but the container "ends" when the server stops running. Thanks!
b
I don't believe it's possible to restart the main process of a docker container since it is literally the container.
at least, I've never been able to get it to work
The "proper" docker flow that I'm aware of is to restart the docker container itself
j
I do something like this - it's not commandbox though:
Copy code
docker compose exec container-name /opt/ColdFusion/cfusion/bin/coldfusion restart
b
Yep, that restarts the entire container
j
Nope. That shells into it the container and just restarts CF. Again this is a vanilla install of CF in Docker, not CommandBox. https://docs.docker.com/reference/cli/docker/compose/exec/ With this subcommand, you can run arbitrary commands in your services It's the same as doing
docker exec -it container-name /bin/bash
and then manually going to that path and restarting CF
b
oh, interesting
That makes me wonder how adobe sets up their containers 🤔
What is PID 0?
Do they run some other management process in their container as the main process and then fork the actual CF process as a sub process?
Because to my knowledge, killing PID 0 ends the container
and PID 0 is typically your server daemon
j
FYI not an Adobe container either. It's just a Debian image where I install CF So that may explain the unexpected behavior LOL
j
The CommandBox Docker containers used to tail the output of the server log file, which may be how Adobe implements theirs. Now we generate a startup script and execute it directly - which provides the smallest resource footprint and also ensures that all
stdout
and
sterr
are captured.
👍 1
docker restart container-name
would accomplish the same thing as a server re-start in-container, though.