allow arbitrary workdir
This commit is contained in:
parent
60960d7853
commit
2b7556fe3a
|
@ -22,6 +22,7 @@ import Utility.SafeCommand
|
||||||
import Utility.Path
|
import Utility.Path
|
||||||
|
|
||||||
import Control.Concurrent.Async
|
import Control.Concurrent.Async
|
||||||
|
import System.Posix.Directory
|
||||||
|
|
||||||
dockercmd :: String
|
dockercmd :: String
|
||||||
dockercmd = "docker.io"
|
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
|
-- name the container in a predictable way so we
|
||||||
-- and the user can easily find it later
|
-- and the user can easily find it later
|
||||||
, name (fromContainerId cid)
|
, name (fromContainerId cid)
|
||||||
-- cd to propellor directory
|
|
||||||
, workdir localdir
|
|
||||||
]
|
]
|
||||||
|
|
||||||
chaincmd = ["./propellor", "--continue", show $ ChainDocker $ show ident]
|
chaincmd = ["./propellor", "--continue", show $ ChainDocker $ show ident]
|
||||||
|
@ -183,6 +182,7 @@ chain :: String -> IO ()
|
||||||
chain s = case readish s of
|
chain s = case readish s of
|
||||||
Nothing -> error $ "Invalid ContainerId: " ++ s
|
Nothing -> error $ "Invalid ContainerId: " ++ s
|
||||||
Just ident@(ContainerIdent _image hn cn _rp) -> do
|
Just ident@(ContainerIdent _image hn cn _rp) -> do
|
||||||
|
changeWorkingDirectory localdir
|
||||||
let cid = ContainerId hn cn
|
let cid = ContainerId hn cn
|
||||||
writeFile propellorIdent (show ident)
|
writeFile propellorIdent (show ident)
|
||||||
void $ async $ simpleSh $ namedPipe cid
|
void $ async $ simpleSh $ namedPipe cid
|
||||||
|
@ -294,7 +294,6 @@ volume :: String -> Containerized Property
|
||||||
volume = runProp "volume"
|
volume = runProp "volume"
|
||||||
|
|
||||||
-- | Work dir inside the container.
|
-- | Work dir inside the container.
|
||||||
-- Must contain ./propellor! (Normally set automatically.)
|
|
||||||
workdir :: String -> Containerized Property
|
workdir :: String -> Containerized Property
|
||||||
workdir = runProp "workdir"
|
workdir = runProp "workdir"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue