I have the following code fragment:
withContainer :: String -> (String -> Action a) -> Action a
cid <= cmd "docker" [ "run" , "--rm", "-d", my_image ]
...
actionFinally (action containerName) $ do
cmd_ "docker" [ "rm", "-f", filter (/= '\n') cid ]
which supposedly kill containers whether or not the action succeeds. However I noticed containers are still left up and running when the action fails, which is annoying. What am I doing wrong?