I have a set of tests which I would like to run on docker container. In the middle of the tests I am changing me test data and I need to restart JETTY.
What is the best way to do that?
I can imagine some options:
With SSH - but for the docker ssh is not the best option.
Python agent on docker to listen sockets - expose one more port, connect and restart jetty.
Maybe there are better ideas for that?
Thanks
Restart the Docker daemon. On Linux, you can avoid a restart (and avoid any downtime for your containers) by reloading the Docker daemon. If you use systemd , then use the command systemctl reload docker . Otherwise, send a SIGHUP signal to the dockerd process.
Run Hub docker container Note that pressing `Ctrl+C` when the terminal is attached to a container output causes the container to shut down. Use `Ctrl+PQ` in order to detach the terminal from container output.
Sounds like the process you're trying to restart is the primary process for the docker container (ie. the one you set in your Dockerfile if you have one, and when you run 'ps -ef' inside the container you would see the PID for your process set to 1). If this is the case, then you cannot restart it from inside the container. You should just restart the container itself:
docker restart <container_id>
Enter the container and restart it.
Manual Way:
docker exec -it <containeridorname> /bin/bash
Or Automated Way:
docker exec -it <containeridorname> /restartjettycommand.sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With