diff --git a/src/Stack/Docker.hs b/src/Stack/Docker.hs index b8b3ddc816..f65610870a 100644 --- a/src/Stack/Docker.hs +++ b/src/Stack/Docker.hs @@ -640,6 +640,8 @@ inspects :: (HasProcessContext env, HasLogFunc env) inspects [] = return Map.empty inspects images = do maybeInspectOut <- + -- not using 'readDockerProcess' as the error from a missing image + -- needs to be recovered. try (BL.toStrict . fst <$> proc "docker" ("inspect" : images) readProcess_) case maybeInspectOut of Right inspectOut -> @@ -844,11 +846,16 @@ removeDirectoryContents path excludeDirs excludeFiles = -- | Produce a strict 'S.ByteString' from the stdout of a -- process. Throws a 'ReadProcessException' exception if the --- process fails. Logs process's stderr using @logError@. +-- process fails. +-- +-- The stderr output is passed straight through, which is desirable for some cases +-- e.g. docker pull, in which docker uses stderr for progress output. +-- +-- Use 'readProcess_' directly to customize this. readDockerProcess :: (HasProcessContext env, HasLogFunc env) => [String] -> RIO env BS.ByteString -readDockerProcess args = BL.toStrict <$> proc "docker" args readProcessStdout_ -- FIXME stderr isn't logged with logError, should it be? +readDockerProcess args = BL.toStrict <$> proc "docker" args readProcessStdout_ -- | Name of home directory within docker sandbox. homeDirName :: Path Rel Dir