@@ -78,7 +78,7 @@ getCmdArgs
78
78
getCmdArgs docker imageInfo isRemoteDocker = do
79
79
config <- view configL
80
80
deUser <-
81
- if fromMaybe (not isRemoteDocker) (dockerSetUser docker)
81
+ if fromMaybe (not isRemoteDocker) (dockerSetUser docker) && not osIsWindows
82
82
then liftIO $ do
83
83
duUid <- User. getEffectiveUserID
84
84
duGid <- User. getEffectiveGroupID
@@ -244,7 +244,7 @@ runContainerAndExit = do
244
244
liftIO
245
245
(Files. fileExist
246
246
(toFilePathNoTrailingSep (sandboxHomeDir </> sshRelDir)))
247
- when (sshDirExists && not sshSandboxDirExists)
247
+ when (sshDirExists && not sshSandboxDirExists && not osIsWindows )
248
248
(liftIO
249
249
(Files. createSymbolicLink
250
250
(toFilePathNoTrailingSep sshDir)
@@ -254,16 +254,16 @@ runContainerAndExit = do
254
254
(concat
255
255
[[" create"
256
256
," -e" ,inContainerEnvVar ++ " =1"
257
- ," -e" ,stackRootEnvVar ++ " =" ++ toFilePathNoTrailingSep stackRoot
257
+ ," -e" ,stackRootEnvVar ++ " =" ++ toLinuxStylePath ( toFilePathNoTrailingSep stackRoot)
258
258
," -e" ,platformVariantEnvVar ++ " =dk" ++ platformVariant
259
- ," -e" ," HOME=" ++ toFilePathNoTrailingSep sandboxHomeDir
259
+ ," -e" ," HOME=" ++ toLinuxStylePath ( toFilePathNoTrailingSep sandboxHomeDir)
260
260
," -e" ," PATH=" ++ T. unpack newPathEnv
261
- ," -e" ," PWD=" ++ toFilePathNoTrailingSep pwd
262
- ," -v" ,toFilePathNoTrailingSep homeDir ++ " :" ++ toFilePathNoTrailingSep homeDir ++ mountSuffix
263
- ," -v" ,toFilePathNoTrailingSep stackRoot ++ " :" ++ toFilePathNoTrailingSep stackRoot ++ mountSuffix
264
- ," -v" ,toFilePathNoTrailingSep projectRoot ++ " :" ++ toFilePathNoTrailingSep projectRoot ++ mountSuffix
265
- ," -v" ,toFilePathNoTrailingSep sandboxHomeDir ++ " :" ++ toFilePathNoTrailingSep sandboxHomeDir ++ mountSuffix
266
- ," -w" ,toFilePathNoTrailingSep pwd]
261
+ ," -e" ," PWD=" ++ toLinuxStylePath ( toFilePathNoTrailingSep pwd)
262
+ ," -v" ,toFilePathNoTrailingSep homeDir ++ " :" ++ toLinuxStylePath ( toFilePathNoTrailingSep homeDir ++ mountSuffix)
263
+ ," -v" ,toFilePathNoTrailingSep stackRoot ++ " :" ++ toLinuxStylePath ( toFilePathNoTrailingSep stackRoot ++ mountSuffix)
264
+ ," -v" ,toFilePathNoTrailingSep projectRoot ++ " :" ++ toLinuxStylePath ( toFilePathNoTrailingSep projectRoot ++ mountSuffix)
265
+ ," -v" ,toFilePathNoTrailingSep sandboxHomeDir ++ " :" ++ toLinuxStylePath ( toFilePathNoTrailingSep sandboxHomeDir ++ mountSuffix)
266
+ ," -w" , toLinuxStylePath ( toFilePathNoTrailingSep pwd) ]
267
267
,case dockerNetwork docker of
268
268
Nothing -> [" --net=host" ]
269
269
Just name -> [" --net=" ++ name]
@@ -340,6 +340,13 @@ runContainerAndExit = do
340
340
mountArg mountSuffix (Mount host container) =
341
341
[" -v" ,host ++ " :" ++ container ++ mountSuffix]
342
342
sshRelDir = relDirDotSsh
343
+ toLinuxStylePath s | osIsWindows =
344
+ T. pack s
345
+ & T. replace " :\\ " " /"
346
+ & T. replace " \\ " " /"
347
+ & T. unpack
348
+ & (" /" ++ )
349
+ | otherwise = s
343
350
344
351
-- | Inspect Docker image or container.
345
352
inspect :: (HasProcessContext env , HasLogFunc env )
0 commit comments