Adding restart policy unless-stopped to hp containers (#11)

This commit is contained in:
Savinda Senevirathne
2021-06-17 10:48:44 +05:30
committed by GitHub
parent 433a4a1e0a
commit 8e103fa80b

View File

@@ -168,13 +168,14 @@ namespace hp
*/
int run_container(const std::string &folder_name, const ports &assigned_ports)
{
// We instruct the demon to restart the container automatically once the container exits except manually stopping.
const std::string command = "docker run -t -i -d --network=hpnet --stop-signal=SIGINT --name=" + folder_name + " \
-p " +
std::to_string(assigned_ports.user_port) + ":" + std::to_string(assigned_ports.user_port) + " \
-p " +
std::to_string(assigned_ports.peer_port) + ":" + std::to_string(assigned_ports.peer_port) + " \
--device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined \
--mount type=bind,source=" +
--restart unless-stopped --mount type=bind,source=" +
conf::cfg.hp.instance_folder + "/" +
folder_name + ",target=/contract \
hpcore:latest run /contract";