@@ -271,6 +271,7 @@ runContainerAndExit getCmdArgs
271271 bamboo = lookup " bamboo_buildKey" env
272272 jenkins = lookup " JENKINS_HOME" env
273273 msshAuthSock = lookup " SSH_AUTH_SOCK" env
274+ muserEnv = lookup " USER" env
274275 isRemoteDocker = maybe False (isPrefixOf " tcp://" ) dockerHost
275276 image = dockerImage docker
276277 when (isRemoteDocker &&
@@ -322,10 +323,14 @@ runContainerAndExit getCmdArgs
322323 ," -e" ,platformVariantEnvVar ++ " =dk" ++ platformVariant
323324 ," -e" ," HOME=" ++ toFilePathNoTrailingSep sandboxHomeDir
324325 ," -e" ," PATH=" ++ T. unpack newPathEnv
326+ ," -e" ," PWD=" ++ toFilePathNoTrailingSep pwd
325327 ," -v" ,toFilePathNoTrailingSep stackRoot ++ " :" ++ toFilePathNoTrailingSep stackRoot
326328 ," -v" ,toFilePathNoTrailingSep projectRoot ++ " :" ++ toFilePathNoTrailingSep projectRoot
327329 ," -v" ,toFilePathNoTrailingSep sandboxHomeDir ++ " :" ++ toFilePathNoTrailingSep sandboxHomeDir
328330 ," -w" ,toFilePathNoTrailingSep pwd]
331+ ,case muserEnv of
332+ Nothing -> []
333+ Just userEnv -> [" -e" ," USER=" ++ userEnv]
329334 ,if sshDirExists
330335 then [" -v" ,toFilePathNoTrailingSep sshDir ++ " :" ++
331336 toFilePathNoTrailingSep (sandboxHomeDir </> sshRelDir)]
0 commit comments