mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Create the working directory on container creation
if create a container with -w to specify the working directory and the directory does not exist in the container rootfs, the directory will be created until the container start. It make docker export of a created container and a running container inconsistent. Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
parent
af6c6dbf87
commit
cde0ed67a1
3 changed files with 14 additions and 2 deletions
|
@ -22,6 +22,10 @@ func (daemon *Daemon) createContainerPlatformSpecificSettings(container *contain
|
|||
}
|
||||
defer daemon.Unmount(container)
|
||||
|
||||
if err := container.SetupWorkingDirectory(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for spec := range config.Volumes {
|
||||
name := stringid.GenerateNonCryptoID()
|
||||
destination := filepath.Clean(spec)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue