mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #13479 from Microsoft/10662-fixcontaineragain
Windows: Fix up container again
This commit is contained in:
commit
fc679bebb9
3 changed files with 24 additions and 20 deletions
|
@ -1087,26 +1087,6 @@ func (container *Container) shouldRestart() bool {
|
||||||
(container.hostConfig.RestartPolicy.Name == "on-failure" && container.ExitCode != 0)
|
(container.hostConfig.RestartPolicy.Name == "on-failure" && container.ExitCode != 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (container *Container) UnmountVolumes(forceSyscall bool) error {
|
|
||||||
for _, m := range container.MountPoints {
|
|
||||||
dest, err := container.GetResourcePath(m.Destination)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if forceSyscall {
|
|
||||||
syscall.Unmount(dest, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
if m.Volume != nil {
|
|
||||||
if err := m.Volume.Unmount(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (container *Container) copyImagePathContent(v volume.Volume, destination string) error {
|
func (container *Container) copyImagePathContent(v volume.Volume, destination string) error {
|
||||||
rootfs, err := symlink.FollowSymlinkInScope(filepath.Join(container.basefs, destination), container.basefs)
|
rootfs, err := symlink.FollowSymlinkInScope(filepath.Join(container.basefs, destination), container.basefs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -954,3 +954,23 @@ func (container *Container) DisableLink(name string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (container *Container) UnmountVolumes(forceSyscall bool) error {
|
||||||
|
for _, m := range container.MountPoints {
|
||||||
|
dest, err := container.GetResourcePath(m.Destination)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if forceSyscall {
|
||||||
|
syscall.Unmount(dest, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Volume != nil {
|
||||||
|
if err := m.Volume.Unmount(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
|
@ -165,3 +165,7 @@ func disableAllActiveLinks(container *Container) {
|
||||||
|
|
||||||
func (container *Container) DisableLink(name string) {
|
func (container *Container) DisableLink(name string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (container *Container) UnmountVolumes(forceSyscall bool) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue