From 2b7556fe3afe7bed1346bef91c7669fbb7078975 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 1 Apr 2014 20:23:11 -0400 Subject: [PATCH] allow arbitrary workdir --- Propellor/Property/Docker.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Propellor/Property/Docker.hs b/Propellor/Property/Docker.hs index a16784f..d252900 100644 --- a/Propellor/Property/Docker.hs +++ b/Propellor/Property/Docker.hs @@ -22,6 +22,7 @@ import Utility.SafeCommand import Utility.Path import Control.Concurrent.Async +import System.Posix.Directory dockercmd :: String dockercmd = "docker.io" @@ -146,8 +147,6 @@ runningContainer cid@(ContainerId hn cn) image containerprops = containerDesc ci -- name the container in a predictable way so we -- and the user can easily find it later , name (fromContainerId cid) - -- cd to propellor directory - , workdir localdir ] chaincmd = ["./propellor", "--continue", show $ ChainDocker $ show ident] @@ -183,6 +182,7 @@ chain :: String -> IO () chain s = case readish s of Nothing -> error $ "Invalid ContainerId: " ++ s Just ident@(ContainerIdent _image hn cn _rp) -> do + changeWorkingDirectory localdir let cid = ContainerId hn cn writeFile propellorIdent (show ident) void $ async $ simpleSh $ namedPipe cid @@ -294,7 +294,6 @@ volume :: String -> Containerized Property volume = runProp "volume" -- | Work dir inside the container. --- Must contain ./propellor! (Normally set automatically.) workdir :: String -> Containerized Property workdir = runProp "workdir"