mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
49c72506ac
Signed-off-by: Doug Davis <dug@us.ibm.com>
31 lines
503 B
Go
31 lines
503 B
Go
package daemon
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
|
|
"github.com/docker/docker/engine"
|
|
)
|
|
|
|
func (daemon *Daemon) ContainerChanges(job *engine.Job) error {
|
|
if n := len(job.Args); n != 1 {
|
|
return fmt.Errorf("Usage: %s CONTAINER", job.Name)
|
|
}
|
|
name := job.Args[0]
|
|
|
|
container, err := daemon.Get(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
changes, err := container.Changes()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if err = json.NewEncoder(job.Stdout).Encode(changes); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|