mirror of https://github.com/docker/docs.git
Merge pull request #23328 from swernli/servicingFix
Fix postRunProcessing behavior during docker build
This commit is contained in:
commit
cc03a422aa
|
|
@ -16,7 +16,7 @@ func platformConstructExitStatus(e libcontainerd.StateInfo) *container.ExitStatu
|
||||||
|
|
||||||
// postRunProcessing perfoms any processing needed on the container after it has stopped.
|
// postRunProcessing perfoms any processing needed on the container after it has stopped.
|
||||||
func (daemon *Daemon) postRunProcessing(container *container.Container, e libcontainerd.StateInfo) error {
|
func (daemon *Daemon) postRunProcessing(container *container.Container, e libcontainerd.StateInfo) error {
|
||||||
if e.UpdatePending {
|
if e.ExitCode == 0 && e.UpdatePending {
|
||||||
spec, err := daemon.createSpec(container)
|
spec, err := daemon.createSpec(container)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
@ -29,6 +29,7 @@ func (daemon *Daemon) postRunProcessing(container *container.Container, e libcon
|
||||||
// Create a new servicing container, which will start, complete the update, and merge back the
|
// Create a new servicing container, which will start, complete the update, and merge back the
|
||||||
// results if it succeeded, all as part of the below function call.
|
// results if it succeeded, all as part of the below function call.
|
||||||
if err := daemon.containerd.Create((container.ID + "_servicing"), *spec, servicingOption); err != nil {
|
if err := daemon.containerd.Create((container.ID + "_servicing"), *spec, servicingOption); err != nil {
|
||||||
|
container.ExitCode = -1
|
||||||
return fmt.Errorf("Post-run update servicing failed: %s", err)
|
return fmt.Errorf("Post-run update servicing failed: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue