1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Clarify what docker diff shows

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
This commit is contained in:
Misty Stanley-Jones 2016-12-20 11:47:54 -08:00
parent b1cb897998
commit 4497801c8a
3 changed files with 74 additions and 45 deletions

View file

@ -21,7 +21,7 @@ func NewDiffCommand(dockerCli *command.DockerCli) *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "diff CONTAINER", Use: "diff CONTAINER",
Short: "Inspect changes on a container's filesystem", Short: "Inspect changes to files or directories on a container's filesystem",
Args: cli.ExactArgs(1), Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
opts.container = args[0] opts.container = args[0]

View file

@ -13,36 +13,53 @@ keywords: "list, changed, files, container"
will be rejected. will be rejected.
--> -->
# diff ## diff
```markdown ```markdown
Usage: docker diff CONTAINER Usage: docker diff CONTAINER
Inspect changes on a container's filesystem Inspect changes to files or directories on a container's filesystem
Options: Options:
--help Print usage --help Print usage
``` ```
List the changed files and directories in a container᾿s filesystem. List the changed files and directories in a container᾿s filesystem since the
There are 3 events that are listed in the `diff`: container was created. Three different types of change are tracked:
1. `A` - Add | Symbol | Description |
2. `D` - Delete |--------|---------------------------------|
3. `C` - Change | `A` | A file or directory was added |
| `D` | A file or directory was deleted |
| `C` | A file or directory was changed |
For example: You can use the full or shortened container ID or the container name set using
`docker run --name` option.
$ docker diff 7bb0e258aefe ## Examples
C /dev Inspect the changes to an `nginx` container:
A /dev/kmsg
C /etc ```bash
A /etc/mtab $ docker diff 1fdfd1f54c1b
A /go
A /go/src C /dev
A /go/src/github.com C /dev/console
A /go/src/github.com/docker C /dev/core
A /go/src/github.com/docker/docker C /dev/stdout
A /go/src/github.com/docker/docker/.git C /dev/fd
.... C /dev/ptmx
C /dev/stderr
C /dev/stdin
C /run
A /run/nginx.pid
C /var/lib/nginx/tmp
A /var/lib/nginx/tmp/client_body
A /var/lib/nginx/tmp/fastcgi
A /var/lib/nginx/tmp/proxy
A /var/lib/nginx/tmp/scgi
A /var/lib/nginx/tmp/uwsgi
C /var/log/nginx
A /var/log/nginx/access.log
A /var/log/nginx/error.log
```

View file

@ -2,7 +2,7 @@
% Docker Community % Docker Community
% JUNE 2014 % JUNE 2014
# NAME # NAME
docker-diff - Inspect changes on a container's filesystem docker-diff - Inspect changes to files or directories on a container's filesystem
# SYNOPSIS # SYNOPSIS
**docker diff** **docker diff**
@ -10,8 +10,16 @@ docker-diff - Inspect changes on a container's filesystem
CONTAINER CONTAINER
# DESCRIPTION # DESCRIPTION
Inspect changes on a container's filesystem. You can use the full or List the changed files and directories in a container᾿s filesystem since the
shortened container ID or the container name set using container was created. Three different types of change are tracked:
| Symbol | Description |
|--------|---------------------------------|
| `A` | A file or directory was added |
| `D` | A file or directory was deleted |
| `C` | A file or directory was changed |
You can use the full or shortened container ID or the container name set using
**docker run --name** option. **docker run --name** option.
# OPTIONS # OPTIONS
@ -19,28 +27,32 @@ shortened container ID or the container name set using
Print usage statement Print usage statement
# EXAMPLES # EXAMPLES
Inspect the changes to on a nginx container:
# docker diff 1fdfd1f54c1b Inspect the changes to an `nginx` container:
C /dev
C /dev/console ```bash
C /dev/core $ docker diff 1fdfd1f54c1b
C /dev/stdout
C /dev/fd C /dev
C /dev/ptmx C /dev/console
C /dev/stderr C /dev/core
C /dev/stdin C /dev/stdout
C /run C /dev/fd
A /run/nginx.pid C /dev/ptmx
C /var/lib/nginx/tmp C /dev/stderr
A /var/lib/nginx/tmp/client_body C /dev/stdin
A /var/lib/nginx/tmp/fastcgi C /run
A /var/lib/nginx/tmp/proxy A /run/nginx.pid
A /var/lib/nginx/tmp/scgi C /var/lib/nginx/tmp
A /var/lib/nginx/tmp/uwsgi A /var/lib/nginx/tmp/client_body
C /var/log/nginx A /var/lib/nginx/tmp/fastcgi
A /var/log/nginx/access.log A /var/lib/nginx/tmp/proxy
A /var/log/nginx/error.log A /var/lib/nginx/tmp/scgi
A /var/lib/nginx/tmp/uwsgi
C /var/log/nginx
A /var/log/nginx/access.log
A /var/log/nginx/error.log
```
# HISTORY # HISTORY