1

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?

insitu
  • 4,488
  • 3
  • 25
  • 42

1 Answers1

0

This sample of code looks correct, and testing variations of it in isolation does indeed work. A bug has been raised to figure out the precise reason it doesn't work in your case at https://github.com/ndmitchell/shake/issues/731.

Neil Mitchell
  • 9,090
  • 1
  • 27
  • 85