Merge pull request #423 from mrunalp/set_default_cwd
Set default working directory to /
This commit is contained in:
commit
bbe2dea0a6
1 changed files with 8 additions and 5 deletions
|
@ -520,13 +520,16 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
|
||||||
|
|
||||||
// Set working directory
|
// Set working directory
|
||||||
// Pick it up from image config first and override if specified in CRI
|
// Pick it up from image config first and override if specified in CRI
|
||||||
|
containerCwd := "/"
|
||||||
imageCwd := containerInfo.Config.Config.WorkingDir
|
imageCwd := containerInfo.Config.Config.WorkingDir
|
||||||
specgen.SetProcessCwd(imageCwd)
|
if imageCwd != "" {
|
||||||
|
containerCwd = imageCwd
|
||||||
cwd := containerConfig.WorkingDir
|
|
||||||
if cwd != "" {
|
|
||||||
specgen.SetProcessCwd(cwd)
|
|
||||||
}
|
}
|
||||||
|
runtimeCwd := containerConfig.WorkingDir
|
||||||
|
if runtimeCwd != "" {
|
||||||
|
containerCwd = runtimeCwd
|
||||||
|
}
|
||||||
|
specgen.SetProcessCwd(containerCwd)
|
||||||
|
|
||||||
// Setup user and groups
|
// Setup user and groups
|
||||||
if linux != nil {
|
if linux != nil {
|
||||||
|
|
Loading…
Reference in a new issue