Search code examples
ubuntudockerros

Host reboot while docker running


I have a ROS system on my Ubuntu OS, which runs in Docker. I have rebooted the system while the docker was still running. After which ROS stopped working. Whether the abrupt reboot would be a cause for this issue ?

Update: 1. No ros related commands were showing any output (It was just a blank line) 2. I have installed ROS separately on the host OS and tried roscore, it worked fine. I was able to see output for rostopic list. 3. I have re-installed OS, but issue persists inside docker.

Any suggestions?

Thank you.


Solution

  • Quick Answer:

    You can use unless-stopped or always option.

    $ docker run --restart unless-stopped ros
    

    unless-stopped --> Restart the container unless it is explicitly stopped or Docker itself is stopped or restarted.

    always --> Always restart the container if it stops.

    Reference