container_diff.go 599 B

123456789101112131415161718192021222324
  1. package client
  2. import (
  3. "encoding/json"
  4. "net/url"
  5. "github.com/docker/engine-api/types"
  6. "golang.org/x/net/context"
  7. )
  8. // ContainerDiff shows differences in a container filesystem since it was started.
  9. func (cli *Client) ContainerDiff(ctx context.Context, containerID string) ([]types.ContainerChange, error) {
  10. var changes []types.ContainerChange
  11. serverResp, err := cli.get(ctx, "/containers/"+containerID+"/changes", url.Values{}, nil)
  12. if err != nil {
  13. return changes, err
  14. }
  15. err = json.NewDecoder(serverResp.body).Decode(&changes)
  16. ensureReaderClosed(serverResp)
  17. return changes, err
  18. }