diff --git a/src/Stack/Docker.hs b/src/Stack/Docker.hs index 4b5763690a..29f423df78 100644 --- a/src/Stack/Docker.hs +++ b/src/Stack/Docker.hs @@ -707,8 +707,8 @@ entrypoint config@Config{..} DockerEntrypoint{..} = do User.getUserEntryForName stackUserName -- Switch UID/GID if needed, and update user's home directory case deUidGid of - Nothing -> updateRootUser envOverride homeDir - Just (0,_) -> updateRootUser envOverride homeDir + Nothing -> return () + Just (0,_) -> return () Just (uid,gid) -> updateOrCreateStackUser envOverride estackUserEntry0 homeDir uid gid case estackUserEntry0 of Left _ -> return () @@ -744,13 +744,6 @@ entrypoint config@Config{..} DockerEntrypoint{..} = do copyFile srcIndex destIndex return True where - updateRootUser envOverride homeDir = do - -- Adjust the 'root' user's home directory to match HOME environment variable, - -- when running as root or no UID/GID provided - readProcessNull Nothing envOverride "usermod" - ["-o" - ,"--home",toFilePathNoTrailingSep homeDir - ,rootUserName] updateOrCreateStackUser envOverride estackUserEntry homeDir uid gid = do case estackUserEntry of Left _ -> do @@ -781,7 +774,6 @@ entrypoint config@Config{..} DockerEntrypoint{..} = do User.setGroupID gid User.setUserID uid stackUserName = "stack"::String - rootUserName = "root"::String -- | MVar used to ensure the Docker entrypoint is performed exactly once entrypointMVar :: MVar Bool