Signed-off-by: Daniel Nephin <dnephin@docker.com>
| ... | ... |
@@ -12,7 +12,6 @@ func NewVolumeCommand(dockerCli *command.DockerCli) *cobra.Command {
|
| 12 | 12 |
cmd := &cobra.Command{
|
| 13 | 13 |
Use: "volume COMMAND", |
| 14 | 14 |
Short: "Manage volumes", |
| 15 |
- Long: volumeDescription, |
|
| 16 | 15 |
Args: cli.NoArgs, |
| 17 | 16 |
RunE: dockerCli.ShowHelp, |
| 18 | 17 |
} |
| ... | ... |
@@ -25,21 +24,3 @@ func NewVolumeCommand(dockerCli *command.DockerCli) *cobra.Command {
|
| 25 | 25 |
) |
| 26 | 26 |
return cmd |
| 27 | 27 |
} |
| 28 |
- |
|
| 29 |
-var volumeDescription = ` |
|
| 30 |
-The **docker volume** command has subcommands for managing data volumes. A data |
|
| 31 |
-volume is a specially-designated directory that by-passes storage driver |
|
| 32 |
-management. |
|
| 33 |
- |
|
| 34 |
-Data volumes persist data independent of a container's life cycle. When you |
|
| 35 |
-delete a container, the Docker daemon does not delete any data volumes. You can |
|
| 36 |
-share volumes across multiple containers. Moreover, you can share data volumes |
|
| 37 |
-with other computing resources in your system. |
|
| 38 |
- |
|
| 39 |
-To see help for a subcommand, use: |
|
| 40 |
- |
|
| 41 |
- docker volume COMMAND --help |
|
| 42 |
- |
|
| 43 |
-For full details on using docker volume visit Docker's online documentation. |
|
| 44 |
- |
|
| 45 |
-` |
| ... | ... |
@@ -29,7 +29,6 @@ func newCreateCommand(dockerCli *command.DockerCli) *cobra.Command {
|
| 29 | 29 |
cmd := &cobra.Command{
|
| 30 | 30 |
Use: "create [OPTIONS] [VOLUME]", |
| 31 | 31 |
Short: "Create a volume", |
| 32 |
- Long: createDescription, |
|
| 33 | 32 |
Args: cli.RequiresMaxArgs(1), |
| 34 | 33 |
RunE: func(cmd *cobra.Command, args []string) error {
|
| 35 | 34 |
if len(args) == 1 {
|
| ... | ... |
@@ -70,42 +69,3 @@ func runCreate(dockerCli *command.DockerCli, opts createOptions) error {
|
| 70 | 70 |
fmt.Fprintf(dockerCli.Out(), "%s\n", vol.Name) |
| 71 | 71 |
return nil |
| 72 | 72 |
} |
| 73 |
- |
|
| 74 |
-var createDescription = ` |
|
| 75 |
-Creates a new volume that containers can consume and store data in. If a name |
|
| 76 |
-is not specified, Docker generates a random name. You create a volume and then |
|
| 77 |
-configure the container to use it, for example: |
|
| 78 |
- |
|
| 79 |
- $ docker volume create hello |
|
| 80 |
- hello |
|
| 81 |
- $ docker run -d -v hello:/world busybox ls /world |
|
| 82 |
- |
|
| 83 |
-The mount is created inside the container's **/src** directory. Docker doesn't |
|
| 84 |
-not support relative paths for mount points inside the container. |
|
| 85 |
- |
|
| 86 |
-Multiple containers can use the same volume in the same time period. This is |
|
| 87 |
-useful if two containers need access to shared data. For example, if one |
|
| 88 |
-container writes and the other reads the data. |
|
| 89 |
- |
|
| 90 |
-## Driver specific options |
|
| 91 |
- |
|
| 92 |
-Some volume drivers may take options to customize the volume creation. Use the |
|
| 93 |
-**-o** or **--opt** flags to pass driver options: |
|
| 94 |
- |
|
| 95 |
- $ docker volume create --driver fake --opt tardis=blue --opt timey=wimey |
|
| 96 |
- |
|
| 97 |
-These options are passed directly to the volume driver. Options for different |
|
| 98 |
-volume drivers may do different things (or nothing at all). |
|
| 99 |
- |
|
| 100 |
-The built-in **local** driver on Windows does not support any options. |
|
| 101 |
- |
|
| 102 |
-The built-in **local** driver on Linux accepts options similar to the linux |
|
| 103 |
-**mount** command: |
|
| 104 |
- |
|
| 105 |
- $ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 |
|
| 106 |
- |
|
| 107 |
-Another example: |
|
| 108 |
- |
|
| 109 |
- $ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 |
|
| 110 |
- |
|
| 111 |
-` |
| ... | ... |
@@ -20,7 +20,6 @@ func newInspectCommand(dockerCli *command.DockerCli) *cobra.Command {
|
| 20 | 20 |
cmd := &cobra.Command{
|
| 21 | 21 |
Use: "inspect [OPTIONS] VOLUME [VOLUME...]", |
| 22 | 22 |
Short: "Display detailed information on one or more volumes", |
| 23 |
- Long: inspectDescription, |
|
| 24 | 23 |
Args: cli.RequiresMinArgs(1), |
| 25 | 24 |
RunE: func(cmd *cobra.Command, args []string) error {
|
| 26 | 25 |
opts.names = args |
| ... | ... |
@@ -45,11 +44,3 @@ func runInspect(dockerCli *command.DockerCli, opts inspectOptions) error {
|
| 45 | 45 |
|
| 46 | 46 |
return inspect.Inspect(dockerCli.Out(), opts.names, opts.format, getVolFunc) |
| 47 | 47 |
} |
| 48 |
- |
|
| 49 |
-var inspectDescription = ` |
|
| 50 |
-Returns information about one or more volumes. By default, this command renders |
|
| 51 |
-all results in a JSON array. You can specify an alternate format to execute a |
|
| 52 |
-given template is executed for each result. Go's https://golang.org/pkg/text/template/ |
|
| 53 |
-package describes all the details of the format. |
|
| 54 |
- |
|
| 55 |
-` |
| ... | ... |
@@ -34,7 +34,6 @@ func newListCommand(dockerCli *command.DockerCli) *cobra.Command {
|
| 34 | 34 |
Use: "ls [OPTIONS]", |
| 35 | 35 |
Aliases: []string{"list"},
|
| 36 | 36 |
Short: "List volumes", |
| 37 |
- Long: listDescription, |
|
| 38 | 37 |
Args: cli.NoArgs, |
| 39 | 38 |
RunE: func(cmd *cobra.Command, args []string) error {
|
| 40 | 39 |
return runList(dockerCli, opts) |
| ... | ... |
@@ -73,19 +72,3 @@ func runList(dockerCli *command.DockerCli, opts listOptions) error {
|
| 73 | 73 |
} |
| 74 | 74 |
return formatter.VolumeWrite(volumeCtx, volumes.Volumes) |
| 75 | 75 |
} |
| 76 |
- |
|
| 77 |
-var listDescription = ` |
|
| 78 |
- |
|
| 79 |
-Lists all the volumes Docker manages. You can filter using the **-f** or |
|
| 80 |
-**--filter** flag. The filtering format is a **key=value** pair. To specify |
|
| 81 |
-more than one filter, pass multiple flags (for example, |
|
| 82 |
-**--filter "foo=bar" --filter "bif=baz"**) |
|
| 83 |
- |
|
| 84 |
-The currently supported filters are: |
|
| 85 |
- |
|
| 86 |
-* **dangling** (boolean - **true** or **false**, **1** or **0**) |
|
| 87 |
-* **driver** (a volume driver's name) |
|
| 88 |
-* **label** (**label=<key>** or **label=<key>=<value>**) |
|
| 89 |
-* **name** (a volume's name) |
|
| 90 |
- |
|
| 91 |
-` |
| 92 | 76 |
deleted file mode 100644 |
| ... | ... |
@@ -1,99 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-attach - Attach to a running container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker attach** |
|
| 9 |
-[**--detach-keys**[=*[]*]] |
|
| 10 |
-[**--help**] |
|
| 11 |
-[**--no-stdin**] |
|
| 12 |
-[**--sig-proxy**[=*true*]] |
|
| 13 |
-CONTAINER |
|
| 14 |
- |
|
| 15 |
-# DESCRIPTION |
|
| 16 |
-The **docker attach** command allows you to attach to a running container using |
|
| 17 |
-the container's ID or name, either to view its ongoing output or to control it |
|
| 18 |
-interactively. You can attach to the same contained process multiple times |
|
| 19 |
-simultaneously, screen sharing style, or quickly view the progress of your |
|
| 20 |
-detached process. |
|
| 21 |
- |
|
| 22 |
-To stop a container, use `CTRL-c`. This key sequence sends `SIGKILL` to the |
|
| 23 |
-container. You can detach from the container (and leave it running) using a |
|
| 24 |
-configurable key sequence. The default sequence is `CTRL-p CTRL-q`. You |
|
| 25 |
-configure the key sequence using the **--detach-keys** option or a configuration |
|
| 26 |
-file. See **config-json(5)** for documentation on using a configuration file. |
|
| 27 |
- |
|
| 28 |
-It is forbidden to redirect the standard input of a `docker attach` command while |
|
| 29 |
-attaching to a tty-enabled container (i.e.: launched with `-t`). |
|
| 30 |
- |
|
| 31 |
-# OPTIONS |
|
| 32 |
-**--detach-keys**="" |
|
| 33 |
- Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. |
|
| 34 |
- |
|
| 35 |
-**--help** |
|
| 36 |
- Print usage statement |
|
| 37 |
- |
|
| 38 |
-**--no-stdin**=*true*|*false* |
|
| 39 |
- Do not attach STDIN. The default is *false*. |
|
| 40 |
- |
|
| 41 |
-**--sig-proxy**=*true*|*false* |
|
| 42 |
- Proxy all received signals to the process (non-TTY mode only). SIGCHLD, SIGKILL, and SIGSTOP are not proxied. The default is *true*. |
|
| 43 |
- |
|
| 44 |
-# Override the detach sequence |
|
| 45 |
- |
|
| 46 |
-If you want, you can configure an override the Docker key sequence for detach. |
|
| 47 |
-This is useful if the Docker default sequence conflicts with key sequence you |
|
| 48 |
-use for other applications. There are two ways to define your own detach key |
|
| 49 |
-sequence, as a per-container override or as a configuration property on your |
|
| 50 |
-entire configuration. |
|
| 51 |
- |
|
| 52 |
-To override the sequence for an individual container, use the |
|
| 53 |
-`--detach-keys="<sequence>"` flag with the `docker attach` command. The format of |
|
| 54 |
-the `<sequence>` is either a letter [a-Z], or the `ctrl-` combined with any of |
|
| 55 |
-the following: |
|
| 56 |
- |
|
| 57 |
-* `a-z` (a single lowercase alpha character ) |
|
| 58 |
-* `@` (at sign) |
|
| 59 |
-* `[` (left bracket) |
|
| 60 |
-* `\\` (two backward slashes) |
|
| 61 |
-* `_` (underscore) |
|
| 62 |
-* `^` (caret) |
|
| 63 |
- |
|
| 64 |
-These `a`, `ctrl-a`, `X`, or `ctrl-\\` values are all examples of valid key |
|
| 65 |
-sequences. To configure a different configuration default key sequence for all |
|
| 66 |
-containers, see **docker(1)**. |
|
| 67 |
- |
|
| 68 |
-# EXAMPLES |
|
| 69 |
- |
|
| 70 |
-## Attaching to a container |
|
| 71 |
- |
|
| 72 |
-In this example the top command is run inside a container, from an image called |
|
| 73 |
-fedora, in detached mode. The ID from the container is passed into the **docker |
|
| 74 |
-attach** command: |
|
| 75 |
- |
|
| 76 |
- # ID=$(sudo docker run -d fedora /usr/bin/top -b) |
|
| 77 |
- # sudo docker attach $ID |
|
| 78 |
- top - 02:05:52 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 |
|
| 79 |
- Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie |
|
| 80 |
- Cpu(s): 0.1%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st |
|
| 81 |
- Mem: 373572k total, 355560k used, 18012k free, 27872k buffers |
|
| 82 |
- Swap: 786428k total, 0k used, 786428k free, 221740k cached |
|
| 83 |
- |
|
| 84 |
- PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
|
| 85 |
- 1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top |
|
| 86 |
- |
|
| 87 |
- top - 02:05:55 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 |
|
| 88 |
- Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie |
|
| 89 |
- Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st |
|
| 90 |
- Mem: 373572k total, 355244k used, 18328k free, 27872k buffers |
|
| 91 |
- Swap: 786428k total, 0k used, 786428k free, 221776k cached |
|
| 92 |
- |
|
| 93 |
- PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
|
| 94 |
- 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top |
|
| 95 |
- |
|
| 96 |
-# HISTORY |
|
| 97 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 98 |
-based on docker.com source material and internal work. |
|
| 99 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 100 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,71 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-commit - Create a new image from a container's changes |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker commit** |
|
| 9 |
-[**-a**|**--author**[=*AUTHOR*]] |
|
| 10 |
-[**-c**|**--change**[=\[*DOCKERFILE INSTRUCTIONS*\]]] |
|
| 11 |
-[**--help**] |
|
| 12 |
-[**-m**|**--message**[=*MESSAGE*]] |
|
| 13 |
-[**-p**|**--pause**[=*true*]] |
|
| 14 |
-CONTAINER [REPOSITORY[:TAG]] |
|
| 15 |
- |
|
| 16 |
-# DESCRIPTION |
|
| 17 |
-Create a new image from an existing container specified by name or |
|
| 18 |
-container ID. The new image will contain the contents of the |
|
| 19 |
-container filesystem, *excluding* any data volumes. Refer to **docker-tag(1)** |
|
| 20 |
-for more information about valid image and tag names. |
|
| 21 |
- |
|
| 22 |
-While the `docker commit` command is a convenient way of extending an |
|
| 23 |
-existing image, you should prefer the use of a Dockerfile and `docker |
|
| 24 |
-build` for generating images that you intend to share with other |
|
| 25 |
-people. |
|
| 26 |
- |
|
| 27 |
-# OPTIONS |
|
| 28 |
-**-a**, **--author**="" |
|
| 29 |
- Author (e.g., "John Hannibal Smith <hannibal@a-team.com>") |
|
| 30 |
- |
|
| 31 |
-**-c** , **--change**=[] |
|
| 32 |
- Apply specified Dockerfile instructions while committing the image |
|
| 33 |
- Supported Dockerfile instructions: `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`LABEL`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` |
|
| 34 |
- |
|
| 35 |
-**--help** |
|
| 36 |
- Print usage statement |
|
| 37 |
- |
|
| 38 |
-**-m**, **--message**="" |
|
| 39 |
- Commit message |
|
| 40 |
- |
|
| 41 |
-**-p**, **--pause**=*true*|*false* |
|
| 42 |
- Pause container during commit. The default is *true*. |
|
| 43 |
- |
|
| 44 |
-# EXAMPLES |
|
| 45 |
- |
|
| 46 |
-## Creating a new image from an existing container |
|
| 47 |
-An existing Fedora based container has had Apache installed while running |
|
| 48 |
-in interactive mode with the bash shell. Apache is also running. To |
|
| 49 |
-create a new image run `docker ps` to find the container's ID and then run: |
|
| 50 |
- |
|
| 51 |
- # docker commit -m="Added Apache to Fedora base image" \ |
|
| 52 |
- -a="A D Ministrator" 98bd7fc99854 fedora/fedora_httpd:20 |
|
| 53 |
- |
|
| 54 |
-Note that only a-z0-9-_. are allowed when naming images from an |
|
| 55 |
-existing container. |
|
| 56 |
- |
|
| 57 |
-## Apply specified Dockerfile instructions while committing the image |
|
| 58 |
-If an existing container was created without the DEBUG environment |
|
| 59 |
-variable set to "true", you can create a new image based on that |
|
| 60 |
-container by first getting the container's ID with `docker ps` and |
|
| 61 |
-then running: |
|
| 62 |
- |
|
| 63 |
- # docker commit -c="ENV DEBUG true" 98bd7fc99854 debug-image |
|
| 64 |
- |
|
| 65 |
-# HISTORY |
|
| 66 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 67 |
-based on docker.com source material and in |
|
| 68 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 69 |
-July 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 70 |
-Oct 2014, updated by Daniel, Dao Quang Minh <daniel at nitrous dot io> |
|
| 71 |
-June 2015, updated by Sally O'Malley <somalley@redhat.com> |
| 72 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,175 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-cp - Copy files/folders between a container and the local filesystem. |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker cp** |
|
| 9 |
-[**--help**] |
|
| 10 |
-CONTAINER:SRC_PATH DEST_PATH|- |
|
| 11 |
- |
|
| 12 |
-**docker cp** |
|
| 13 |
-[**--help**] |
|
| 14 |
-SRC_PATH|- CONTAINER:DEST_PATH |
|
| 15 |
- |
|
| 16 |
-# DESCRIPTION |
|
| 17 |
- |
|
| 18 |
-The `docker cp` utility copies the contents of `SRC_PATH` to the `DEST_PATH`. |
|
| 19 |
-You can copy from the container's file system to the local machine or the |
|
| 20 |
-reverse, from the local filesystem to the container. If `-` is specified for |
|
| 21 |
-either the `SRC_PATH` or `DEST_PATH`, you can also stream a tar archive from |
|
| 22 |
-`STDIN` or to `STDOUT`. The `CONTAINER` can be a running or stopped container. |
|
| 23 |
-The `SRC_PATH` or `DEST_PATH` can be a file or directory. |
|
| 24 |
- |
|
| 25 |
-The `docker cp` command assumes container paths are relative to the container's |
|
| 26 |
-`/` (root) directory. This means supplying the initial forward slash is optional; |
|
| 27 |
-The command sees `compassionate_darwin:/tmp/foo/myfile.txt` and |
|
| 28 |
-`compassionate_darwin:tmp/foo/myfile.txt` as identical. Local machine paths can |
|
| 29 |
-be an absolute or relative value. The command interprets a local machine's |
|
| 30 |
-relative paths as relative to the current working directory where `docker cp` is |
|
| 31 |
-run. |
|
| 32 |
- |
|
| 33 |
-The `cp` command behaves like the Unix `cp -a` command in that directories are |
|
| 34 |
-copied recursively with permissions preserved if possible. Ownership is set to |
|
| 35 |
-the user and primary group at the destination. For example, files copied to a |
|
| 36 |
-container are created with `UID:GID` of the root user. Files copied to the local |
|
| 37 |
-machine are created with the `UID:GID` of the user which invoked the `docker cp` |
|
| 38 |
-command. If you specify the `-L` option, `docker cp` follows any symbolic link |
|
| 39 |
-in the `SRC_PATH`. `docker cp` does *not* create parent directories for |
|
| 40 |
-`DEST_PATH` if they do not exist. |
|
| 41 |
- |
|
| 42 |
-Assuming a path separator of `/`, a first argument of `SRC_PATH` and second |
|
| 43 |
-argument of `DEST_PATH`, the behavior is as follows: |
|
| 44 |
- |
|
| 45 |
-- `SRC_PATH` specifies a file |
|
| 46 |
- - `DEST_PATH` does not exist |
|
| 47 |
- - the file is saved to a file created at `DEST_PATH` |
|
| 48 |
- - `DEST_PATH` does not exist and ends with `/` |
|
| 49 |
- - Error condition: the destination directory must exist. |
|
| 50 |
- - `DEST_PATH` exists and is a file |
|
| 51 |
- - the destination is overwritten with the source file's contents |
|
| 52 |
- - `DEST_PATH` exists and is a directory |
|
| 53 |
- - the file is copied into this directory using the basename from |
|
| 54 |
- `SRC_PATH` |
|
| 55 |
-- `SRC_PATH` specifies a directory |
|
| 56 |
- - `DEST_PATH` does not exist |
|
| 57 |
- - `DEST_PATH` is created as a directory and the *contents* of the source |
|
| 58 |
- directory are copied into this directory |
|
| 59 |
- - `DEST_PATH` exists and is a file |
|
| 60 |
- - Error condition: cannot copy a directory to a file |
|
| 61 |
- - `DEST_PATH` exists and is a directory |
|
| 62 |
- - `SRC_PATH` does not end with `/.` |
|
| 63 |
- - the source directory is copied into this directory |
|
| 64 |
- - `SRC_PATH` does end with `/.` |
|
| 65 |
- - the *content* of the source directory is copied into this |
|
| 66 |
- directory |
|
| 67 |
- |
|
| 68 |
-The command requires `SRC_PATH` and `DEST_PATH` to exist according to the above |
|
| 69 |
-rules. If `SRC_PATH` is local and is a symbolic link, the symbolic link, not |
|
| 70 |
-the target, is copied by default. To copy the link target and not the link, |
|
| 71 |
-specify the `-L` option. |
|
| 72 |
- |
|
| 73 |
-A colon (`:`) is used as a delimiter between `CONTAINER` and its path. You can |
|
| 74 |
-also use `:` when specifying paths to a `SRC_PATH` or `DEST_PATH` on a local |
|
| 75 |
-machine, for example `file:name.txt`. If you use a `:` in a local machine path, |
|
| 76 |
-you must be explicit with a relative or absolute path, for example: |
|
| 77 |
- |
|
| 78 |
- `/path/to/file:name.txt` or `./file:name.txt` |
|
| 79 |
- |
|
| 80 |
-It is not possible to copy certain system files such as resources under |
|
| 81 |
-`/proc`, `/sys`, `/dev`, tmpfs, and mounts created by the user in the container. |
|
| 82 |
-However, you can still copy such files by manually running `tar` in `docker exec`. |
|
| 83 |
-For example (consider `SRC_PATH` and `DEST_PATH` are directories): |
|
| 84 |
- |
|
| 85 |
- $ docker exec foo tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | tar Cxf DEST_PATH - |
|
| 86 |
- |
|
| 87 |
-or |
|
| 88 |
- |
|
| 89 |
- $ tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | docker exec -i foo tar Cxf DEST_PATH - |
|
| 90 |
- |
|
| 91 |
- |
|
| 92 |
-Using `-` as the `SRC_PATH` streams the contents of `STDIN` as a tar archive. |
|
| 93 |
-The command extracts the content of the tar to the `DEST_PATH` in container's |
|
| 94 |
-filesystem. In this case, `DEST_PATH` must specify a directory. Using `-` as |
|
| 95 |
-the `DEST_PATH` streams the contents of the resource as a tar archive to `STDOUT`. |
|
| 96 |
- |
|
| 97 |
-# OPTIONS |
|
| 98 |
-**-L**, **--follow-link**=*true*|*false* |
|
| 99 |
- Follow symbol link in SRC_PATH |
|
| 100 |
- |
|
| 101 |
-**--help** |
|
| 102 |
- Print usage statement |
|
| 103 |
- |
|
| 104 |
-# EXAMPLES |
|
| 105 |
- |
|
| 106 |
-Suppose a container has finished producing some output as a file it saves |
|
| 107 |
-to somewhere in its filesystem. This could be the output of a build job or |
|
| 108 |
-some other computation. You can copy these outputs from the container to a |
|
| 109 |
-location on your local host. |
|
| 110 |
- |
|
| 111 |
-If you want to copy the `/tmp/foo` directory from a container to the |
|
| 112 |
-existing `/tmp` directory on your host. If you run `docker cp` in your `~` |
|
| 113 |
-(home) directory on the local host: |
|
| 114 |
- |
|
| 115 |
- $ docker cp compassionate_darwin:tmp/foo /tmp |
|
| 116 |
- |
|
| 117 |
-Docker creates a `/tmp/foo` directory on your host. Alternatively, you can omit |
|
| 118 |
-the leading slash in the command. If you execute this command from your home |
|
| 119 |
-directory: |
|
| 120 |
- |
|
| 121 |
- $ docker cp compassionate_darwin:tmp/foo tmp |
|
| 122 |
- |
|
| 123 |
-If `~/tmp` does not exist, Docker will create it and copy the contents of |
|
| 124 |
-`/tmp/foo` from the container into this new directory. If `~/tmp` already |
|
| 125 |
-exists as a directory, then Docker will copy the contents of `/tmp/foo` from |
|
| 126 |
-the container into a directory at `~/tmp/foo`. |
|
| 127 |
- |
|
| 128 |
-When copying a single file to an existing `LOCALPATH`, the `docker cp` command |
|
| 129 |
-will either overwrite the contents of `LOCALPATH` if it is a file or place it |
|
| 130 |
-into `LOCALPATH` if it is a directory, overwriting an existing file of the same |
|
| 131 |
-name if one exists. For example, this command: |
|
| 132 |
- |
|
| 133 |
- $ docker cp sharp_ptolemy:/tmp/foo/myfile.txt /test |
|
| 134 |
- |
|
| 135 |
-If `/test` does not exist on the local machine, it will be created as a file |
|
| 136 |
-with the contents of `/tmp/foo/myfile.txt` from the container. If `/test` |
|
| 137 |
-exists as a file, it will be overwritten. Lastly, if `/test` exists as a |
|
| 138 |
-directory, the file will be copied to `/test/myfile.txt`. |
|
| 139 |
- |
|
| 140 |
-Next, suppose you want to copy a file or folder into a container. For example, |
|
| 141 |
-this could be a configuration file or some other input to a long running |
|
| 142 |
-computation that you would like to place into a created container before it |
|
| 143 |
-starts. This is useful because it does not require the configuration file or |
|
| 144 |
-other input to exist in the container image. |
|
| 145 |
- |
|
| 146 |
-If you have a file, `config.yml`, in the current directory on your local host |
|
| 147 |
-and wish to copy it to an existing directory at `/etc/my-app.d` in a container, |
|
| 148 |
-this command can be used: |
|
| 149 |
- |
|
| 150 |
- $ docker cp config.yml myappcontainer:/etc/my-app.d |
|
| 151 |
- |
|
| 152 |
-If you have several files in a local directory `/config` which you need to copy |
|
| 153 |
-to a directory `/etc/my-app.d` in a container: |
|
| 154 |
- |
|
| 155 |
- $ docker cp /config/. myappcontainer:/etc/my-app.d |
|
| 156 |
- |
|
| 157 |
-The above command will copy the contents of the local `/config` directory into |
|
| 158 |
-the directory `/etc/my-app.d` in the container. |
|
| 159 |
- |
|
| 160 |
-Finally, if you want to copy a symbolic link into a container, you typically |
|
| 161 |
-want to copy the linked target and not the link itself. To copy the target, use |
|
| 162 |
-the `-L` option, for example: |
|
| 163 |
- |
|
| 164 |
- $ ln -s /tmp/somefile /tmp/somefile.ln |
|
| 165 |
- $ docker cp -L /tmp/somefile.ln myappcontainer:/tmp/ |
|
| 166 |
- |
|
| 167 |
-This command copies content of the local `/tmp/somefile` into the file |
|
| 168 |
-`/tmp/somefile.ln` in the container. Without `-L` option, the `/tmp/somefile.ln` |
|
| 169 |
-preserves its symbolic link but not its content. |
|
| 170 |
- |
|
| 171 |
-# HISTORY |
|
| 172 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 173 |
-based on docker.com source material and internal work. |
|
| 174 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 175 |
-May 2015, updated by Josh Hawn <josh.hawn@docker.com> |
| 176 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,553 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-create - Create a new container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker create** |
|
| 9 |
-[**-a**|**--attach**[=*[]*]] |
|
| 10 |
-[**--add-host**[=*[]*]] |
|
| 11 |
-[**--blkio-weight**[=*[BLKIO-WEIGHT]*]] |
|
| 12 |
-[**--blkio-weight-device**[=*[]*]] |
|
| 13 |
-[**--cpu-shares**[=*0*]] |
|
| 14 |
-[**--cap-add**[=*[]*]] |
|
| 15 |
-[**--cap-drop**[=*[]*]] |
|
| 16 |
-[**--cgroup-parent**[=*CGROUP-PATH*]] |
|
| 17 |
-[**--cidfile**[=*CIDFILE*]] |
|
| 18 |
-[**--cpu-count**[=*0*]] |
|
| 19 |
-[**--cpu-percent**[=*0*]] |
|
| 20 |
-[**--cpu-period**[=*0*]] |
|
| 21 |
-[**--cpu-quota**[=*0*]] |
|
| 22 |
-[**--cpu-rt-period**[=*0*]] |
|
| 23 |
-[**--cpu-rt-runtime**[=*0*]] |
|
| 24 |
-[**--cpus**[=*0.0*]] |
|
| 25 |
-[**--cpuset-cpus**[=*CPUSET-CPUS*]] |
|
| 26 |
-[**--cpuset-mems**[=*CPUSET-MEMS*]] |
|
| 27 |
-[**--device**[=*[]*]] |
|
| 28 |
-[**--device-read-bps**[=*[]*]] |
|
| 29 |
-[**--device-read-iops**[=*[]*]] |
|
| 30 |
-[**--device-write-bps**[=*[]*]] |
|
| 31 |
-[**--device-write-iops**[=*[]*]] |
|
| 32 |
-[**--dns**[=*[]*]] |
|
| 33 |
-[**--dns-search**[=*[]*]] |
|
| 34 |
-[**--dns-option**[=*[]*]] |
|
| 35 |
-[**-e**|**--env**[=*[]*]] |
|
| 36 |
-[**--entrypoint**[=*ENTRYPOINT*]] |
|
| 37 |
-[**--env-file**[=*[]*]] |
|
| 38 |
-[**--expose**[=*[]*]] |
|
| 39 |
-[**--group-add**[=*[]*]] |
|
| 40 |
-[**-h**|**--hostname**[=*HOSTNAME*]] |
|
| 41 |
-[**--help**] |
|
| 42 |
-[**-i**|**--interactive**] |
|
| 43 |
-[**--ip**[=*IPv4-ADDRESS*]] |
|
| 44 |
-[**--ip6**[=*IPv6-ADDRESS*]] |
|
| 45 |
-[**--ipc**[=*IPC*]] |
|
| 46 |
-[**--isolation**[=*default*]] |
|
| 47 |
-[**--kernel-memory**[=*KERNEL-MEMORY*]] |
|
| 48 |
-[**-l**|**--label**[=*[]*]] |
|
| 49 |
-[**--label-file**[=*[]*]] |
|
| 50 |
-[**--link**[=*[]*]] |
|
| 51 |
-[**--link-local-ip**[=*[]*]] |
|
| 52 |
-[**--log-driver**[=*[]*]] |
|
| 53 |
-[**--log-opt**[=*[]*]] |
|
| 54 |
-[**-m**|**--memory**[=*MEMORY*]] |
|
| 55 |
-[**--mac-address**[=*MAC-ADDRESS*]] |
|
| 56 |
-[**--memory-reservation**[=*MEMORY-RESERVATION*]] |
|
| 57 |
-[**--memory-swap**[=*LIMIT*]] |
|
| 58 |
-[**--memory-swappiness**[=*MEMORY-SWAPPINESS*]] |
|
| 59 |
-[**--name**[=*NAME*]] |
|
| 60 |
-[**--network-alias**[=*[]*]] |
|
| 61 |
-[**--network**[=*"bridge"*]] |
|
| 62 |
-[**--oom-kill-disable**] |
|
| 63 |
-[**--oom-score-adj**[=*0*]] |
|
| 64 |
-[**-P**|**--publish-all**] |
|
| 65 |
-[**-p**|**--publish**[=*[]*]] |
|
| 66 |
-[**--pid**[=*[PID]*]] |
|
| 67 |
-[**--userns**[=*[]*]] |
|
| 68 |
-[**--pids-limit**[=*PIDS_LIMIT*]] |
|
| 69 |
-[**--privileged**] |
|
| 70 |
-[**--read-only**] |
|
| 71 |
-[**--restart**[=*RESTART*]] |
|
| 72 |
-[**--rm**] |
|
| 73 |
-[**--security-opt**[=*[]*]] |
|
| 74 |
-[**--storage-opt**[=*[]*]] |
|
| 75 |
-[**--stop-signal**[=*SIGNAL*]] |
|
| 76 |
-[**--stop-timeout**[=*TIMEOUT*]] |
|
| 77 |
-[**--shm-size**[=*[]*]] |
|
| 78 |
-[**--sysctl**[=*[]*]] |
|
| 79 |
-[**-t**|**--tty**] |
|
| 80 |
-[**--tmpfs**[=*[CONTAINER-DIR[:<OPTIONS>]*]] |
|
| 81 |
-[**-u**|**--user**[=*USER*]] |
|
| 82 |
-[**--ulimit**[=*[]*]] |
|
| 83 |
-[**--uts**[=*[]*]] |
|
| 84 |
-[**-v**|**--volume**[=*[[HOST-DIR:]CONTAINER-DIR[:OPTIONS]]*]] |
|
| 85 |
-[**--volume-driver**[=*DRIVER*]] |
|
| 86 |
-[**--volumes-from**[=*[]*]] |
|
| 87 |
-[**-w**|**--workdir**[=*WORKDIR*]] |
|
| 88 |
-IMAGE [COMMAND] [ARG...] |
|
| 89 |
- |
|
| 90 |
-# DESCRIPTION |
|
| 91 |
- |
|
| 92 |
-Creates a writeable container layer over the specified image and prepares it for |
|
| 93 |
-running the specified command. The container ID is then printed to STDOUT. This |
|
| 94 |
-is similar to **docker run -d** except the container is never started. You can |
|
| 95 |
-then use the **docker start <container_id>** command to start the container at |
|
| 96 |
-any point. |
|
| 97 |
- |
|
| 98 |
-The initial status of the container created with **docker create** is 'created'. |
|
| 99 |
- |
|
| 100 |
-# OPTIONS |
|
| 101 |
-**-a**, **--attach**=[] |
|
| 102 |
- Attach to STDIN, STDOUT or STDERR. |
|
| 103 |
- |
|
| 104 |
-**--add-host**=[] |
|
| 105 |
- Add a custom host-to-IP mapping (host:ip) |
|
| 106 |
- |
|
| 107 |
-**--blkio-weight**=*0* |
|
| 108 |
- Block IO weight (relative weight) accepts a weight value between 10 and 1000. |
|
| 109 |
- |
|
| 110 |
-**--blkio-weight-device**=[] |
|
| 111 |
- Block IO weight (relative device weight, format: `DEVICE_NAME:WEIGHT`). |
|
| 112 |
- |
|
| 113 |
-**--cpu-shares**=*0* |
|
| 114 |
- CPU shares (relative weight) |
|
| 115 |
- |
|
| 116 |
-**--cap-add**=[] |
|
| 117 |
- Add Linux capabilities |
|
| 118 |
- |
|
| 119 |
-**--cap-drop**=[] |
|
| 120 |
- Drop Linux capabilities |
|
| 121 |
- |
|
| 122 |
-**--cgroup-parent**="" |
|
| 123 |
- Path to cgroups under which the cgroup for the container will be created. If the path is not absolute, the path is considered to be relative to the cgroups path of the init process. Cgroups will be created if they do not already exist. |
|
| 124 |
- |
|
| 125 |
-**--cidfile**="" |
|
| 126 |
- Write the container ID to the file |
|
| 127 |
- |
|
| 128 |
-**--cpu-count**=*0* |
|
| 129 |
- Limit the number of CPUs available for execution by the container. |
|
| 130 |
- |
|
| 131 |
- On Windows Server containers, this is approximated as a percentage of total CPU usage. |
|
| 132 |
- |
|
| 133 |
- On Windows Server containers, the processor resource controls are mutually exclusive, the order of precedence is CPUCount first, then CPUShares, and CPUPercent last. |
|
| 134 |
- |
|
| 135 |
-**--cpu-percent**=*0* |
|
| 136 |
- Limit the percentage of CPU available for execution by a container running on a Windows daemon. |
|
| 137 |
- |
|
| 138 |
- On Windows Server containers, the processor resource controls are mutually exclusive, the order of precedence is CPUCount first, then CPUShares, and CPUPercent last. |
|
| 139 |
- |
|
| 140 |
-**--cpu-period**=*0* |
|
| 141 |
- Limit the CPU CFS (Completely Fair Scheduler) period |
|
| 142 |
- |
|
| 143 |
- Limit the container's CPU usage. This flag tell the kernel to restrict the container's CPU usage to the period you specify. |
|
| 144 |
- |
|
| 145 |
-**--cpuset-cpus**="" |
|
| 146 |
- CPUs in which to allow execution (0-3, 0,1) |
|
| 147 |
- |
|
| 148 |
-**--cpuset-mems**="" |
|
| 149 |
- Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. |
|
| 150 |
- |
|
| 151 |
- If you have four memory nodes on your system (0-3), use `--cpuset-mems=0,1` |
|
| 152 |
-then processes in your Docker container will only use memory from the first |
|
| 153 |
-two memory nodes. |
|
| 154 |
- |
|
| 155 |
-**--cpu-quota**=*0* |
|
| 156 |
- Limit the CPU CFS (Completely Fair Scheduler) quota |
|
| 157 |
- |
|
| 158 |
-**--cpu-rt-period**=0 |
|
| 159 |
- Limit the CPU real-time period in microseconds |
|
| 160 |
- |
|
| 161 |
- Limit the container's Real Time CPU usage. This flag tell the kernel to restrict the container's Real Time CPU usage to the period you specify. |
|
| 162 |
- |
|
| 163 |
-**--cpu-rt-runtime**=0 |
|
| 164 |
- Limit the CPU real-time runtime in microseconds |
|
| 165 |
- |
|
| 166 |
- Limit the containers Real Time CPU usage. This flag tells the kernel to limit the amount of time in a given CPU period Real Time tasks may consume. Ex: |
|
| 167 |
- Period of 1,000,000us and Runtime of 950,000us means that this container could consume 95% of available CPU and leave the remaining 5% to normal priority tasks. |
|
| 168 |
- |
|
| 169 |
- The sum of all runtimes across containers cannot exceed the amount allotted to the parent cgroup. |
|
| 170 |
- |
|
| 171 |
-**--cpus**=0.0 |
|
| 172 |
- Number of CPUs. The default is *0.0*. |
|
| 173 |
- |
|
| 174 |
-**--device**=[] |
|
| 175 |
- Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm) |
|
| 176 |
- |
|
| 177 |
-**--device-read-bps**=[] |
|
| 178 |
- Limit read rate (bytes per second) from a device (e.g. --device-read-bps=/dev/sda:1mb) |
|
| 179 |
- |
|
| 180 |
-**--device-read-iops**=[] |
|
| 181 |
- Limit read rate (IO per second) from a device (e.g. --device-read-iops=/dev/sda:1000) |
|
| 182 |
- |
|
| 183 |
-**--device-write-bps**=[] |
|
| 184 |
- Limit write rate (bytes per second) to a device (e.g. --device-write-bps=/dev/sda:1mb) |
|
| 185 |
- |
|
| 186 |
-**--device-write-iops**=[] |
|
| 187 |
- Limit write rate (IO per second) to a device (e.g. --device-write-iops=/dev/sda:1000) |
|
| 188 |
- |
|
| 189 |
-**--dns**=[] |
|
| 190 |
- Set custom DNS servers |
|
| 191 |
- |
|
| 192 |
-**--dns-option**=[] |
|
| 193 |
- Set custom DNS options |
|
| 194 |
- |
|
| 195 |
-**--dns-search**=[] |
|
| 196 |
- Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain) |
|
| 197 |
- |
|
| 198 |
-**-e**, **--env**=[] |
|
| 199 |
- Set environment variables |
|
| 200 |
- |
|
| 201 |
-**--entrypoint**="" |
|
| 202 |
- Overwrite the default ENTRYPOINT of the image |
|
| 203 |
- |
|
| 204 |
-**--env-file**=[] |
|
| 205 |
- Read in a line-delimited file of environment variables |
|
| 206 |
- |
|
| 207 |
-**--expose**=[] |
|
| 208 |
- Expose a port or a range of ports (e.g. --expose=3300-3310) from the container without publishing it to your host |
|
| 209 |
- |
|
| 210 |
-**--group-add**=[] |
|
| 211 |
- Add additional groups to run as |
|
| 212 |
- |
|
| 213 |
-**-h**, **--hostname**="" |
|
| 214 |
- Container host name |
|
| 215 |
- |
|
| 216 |
-**--help** |
|
| 217 |
- Print usage statement |
|
| 218 |
- |
|
| 219 |
-**-i**, **--interactive**=*true*|*false* |
|
| 220 |
- Keep STDIN open even if not attached. The default is *false*. |
|
| 221 |
- |
|
| 222 |
-**--ip**="" |
|
| 223 |
- Sets the container's interface IPv4 address (e.g. 172.23.0.9) |
|
| 224 |
- |
|
| 225 |
- It can only be used in conjunction with **--network** for user-defined networks |
|
| 226 |
- |
|
| 227 |
-**--ip6**="" |
|
| 228 |
- Sets the container's interface IPv6 address (e.g. 2001:db8::1b99) |
|
| 229 |
- |
|
| 230 |
- It can only be used in conjunction with **--network** for user-defined networks |
|
| 231 |
- |
|
| 232 |
-**--ipc**="" |
|
| 233 |
- Default is to create a private IPC namespace (POSIX SysV IPC) for the container |
|
| 234 |
- 'container:<name|id>': reuses another container shared memory, semaphores and message queues |
|
| 235 |
- 'host': use the host shared memory,semaphores and message queues inside the container. Note: the host mode gives the container full access to local shared memory and is therefore considered insecure. |
|
| 236 |
- |
|
| 237 |
-**--isolation**="*default*" |
|
| 238 |
- Isolation specifies the type of isolation technology used by containers. Note |
|
| 239 |
-that the default on Windows server is `process`, and the default on Windows client |
|
| 240 |
-is `hyperv`. Linux only supports `default`. |
|
| 241 |
- |
|
| 242 |
-**--kernel-memory**="" |
|
| 243 |
- Kernel memory limit (format: `<number>[<unit>]`, where unit = b, k, m or g) |
|
| 244 |
- |
|
| 245 |
- Constrains the kernel memory available to a container. If a limit of 0 |
|
| 246 |
-is specified (not using `--kernel-memory`), the container's kernel memory |
|
| 247 |
-is not limited. If you specify a limit, it may be rounded up to a multiple |
|
| 248 |
-of the operating system's page size and the value can be very large, |
|
| 249 |
-millions of trillions. |
|
| 250 |
- |
|
| 251 |
-**-l**, **--label**=[] |
|
| 252 |
- Adds metadata to a container (e.g., --label=com.example.key=value) |
|
| 253 |
- |
|
| 254 |
-**--label-file**=[] |
|
| 255 |
- Read labels from a file. Delimit each label with an EOL. |
|
| 256 |
- |
|
| 257 |
-**--link**=[] |
|
| 258 |
- Add link to another container in the form of <name or id>:alias or just |
|
| 259 |
- <name or id> in which case the alias will match the name. |
|
| 260 |
- |
|
| 261 |
-**--link-local-ip**=[] |
|
| 262 |
- Add one or more link-local IPv4/IPv6 addresses to the container's interface |
|
| 263 |
- |
|
| 264 |
-**--log-driver**="*json-file*|*syslog*|*journald*|*gelf*|*fluentd*|*awslogs*|*splunk*|*etwlogs*|*gcplogs*|*none*" |
|
| 265 |
- Logging driver for the container. Default is defined by daemon `--log-driver` flag. |
|
| 266 |
- **Warning**: the `docker logs` command works only for the `json-file` and |
|
| 267 |
- `journald` logging drivers. |
|
| 268 |
- |
|
| 269 |
-**--log-opt**=[] |
|
| 270 |
- Logging driver specific options. |
|
| 271 |
- |
|
| 272 |
-**-m**, **--memory**="" |
|
| 273 |
- Memory limit (format: <number>[<unit>], where unit = b, k, m or g) |
|
| 274 |
- |
|
| 275 |
- Allows you to constrain the memory available to a container. If the host |
|
| 276 |
-supports swap memory, then the **-m** memory setting can be larger than physical |
|
| 277 |
-RAM. If a limit of 0 is specified (not using **-m**), the container's memory is |
|
| 278 |
-not limited. The actual limit may be rounded up to a multiple of the operating |
|
| 279 |
-system's page size (the value would be very large, that's millions of trillions). |
|
| 280 |
- |
|
| 281 |
-**--mac-address**="" |
|
| 282 |
- Container MAC address (e.g. 92:d0:c6:0a:29:33) |
|
| 283 |
- |
|
| 284 |
-**--memory-reservation**="" |
|
| 285 |
- Memory soft limit (format: <number>[<unit>], where unit = b, k, m or g) |
|
| 286 |
- |
|
| 287 |
- After setting memory reservation, when the system detects memory contention |
|
| 288 |
-or low memory, containers are forced to restrict their consumption to their |
|
| 289 |
-reservation. So you should always set the value below **--memory**, otherwise the |
|
| 290 |
-hard limit will take precedence. By default, memory reservation will be the same |
|
| 291 |
-as memory limit. |
|
| 292 |
- |
|
| 293 |
-**--memory-swap**="LIMIT" |
|
| 294 |
- A limit value equal to memory plus swap. Must be used with the **-m** |
|
| 295 |
-(**--memory**) flag. The swap `LIMIT` should always be larger than **-m** |
|
| 296 |
-(**--memory**) value. |
|
| 297 |
- |
|
| 298 |
- The format of `LIMIT` is `<number>[<unit>]`. Unit can be `b` (bytes), |
|
| 299 |
-`k` (kilobytes), `m` (megabytes), or `g` (gigabytes). If you don't specify a |
|
| 300 |
-unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap. |
|
| 301 |
- |
|
| 302 |
-**--memory-swappiness**="" |
|
| 303 |
- Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. |
|
| 304 |
- |
|
| 305 |
-**--name**="" |
|
| 306 |
- Assign a name to the container |
|
| 307 |
- |
|
| 308 |
-**--network**="*bridge*" |
|
| 309 |
- Set the Network mode for the container |
|
| 310 |
- 'bridge': create a network stack on the default Docker bridge |
|
| 311 |
- 'none': no networking |
|
| 312 |
- 'container:<name|id>': reuse another container's network stack |
|
| 313 |
- 'host': use the Docker host network stack. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure. |
|
| 314 |
- '<network-name>|<network-id>': connect to a user-defined network |
|
| 315 |
- |
|
| 316 |
-**--network-alias**=[] |
|
| 317 |
- Add network-scoped alias for the container |
|
| 318 |
- |
|
| 319 |
-**--oom-kill-disable**=*true*|*false* |
|
| 320 |
- Whether to disable OOM Killer for the container or not. |
|
| 321 |
- |
|
| 322 |
-**--oom-score-adj**="" |
|
| 323 |
- Tune the host's OOM preferences for containers (accepts -1000 to 1000) |
|
| 324 |
- |
|
| 325 |
-**-P**, **--publish-all**=*true*|*false* |
|
| 326 |
- Publish all exposed ports to random ports on the host interfaces. The default is *false*. |
|
| 327 |
- |
|
| 328 |
-**-p**, **--publish**=[] |
|
| 329 |
- Publish a container's port, or a range of ports, to the host |
|
| 330 |
- format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort |
|
| 331 |
- Both hostPort and containerPort can be specified as a range of ports. |
|
| 332 |
- When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range. (e.g., `-p 1234-1236:1234-1236/tcp`) |
|
| 333 |
- (use 'docker port' to see the actual mapping) |
|
| 334 |
- |
|
| 335 |
-**--pid**="" |
|
| 336 |
- Set the PID mode for the container |
|
| 337 |
- Default is to create a private PID namespace for the container |
|
| 338 |
- 'container:<name|id>': join another container's PID namespace |
|
| 339 |
- 'host': use the host's PID namespace for the container. Note: the host mode gives the container full access to local PID and is therefore considered insecure. |
|
| 340 |
- |
|
| 341 |
-**--userns**="" |
|
| 342 |
- Set the usernamespace mode for the container when `userns-remap` option is enabled. |
|
| 343 |
- **host**: use the host usernamespace and enable all privileged options (e.g., `pid=host` or `--privileged`). |
|
| 344 |
- |
|
| 345 |
-**--pids-limit**="" |
|
| 346 |
- Tune the container's pids limit. Set `-1` to have unlimited pids for the container. |
|
| 347 |
- |
|
| 348 |
-**--privileged**=*true*|*false* |
|
| 349 |
- Give extended privileges to this container. The default is *false*. |
|
| 350 |
- |
|
| 351 |
-**--read-only**=*true*|*false* |
|
| 352 |
- Mount the container's root filesystem as read only. |
|
| 353 |
- |
|
| 354 |
-**--restart**="*no*" |
|
| 355 |
- Restart policy to apply when a container exits (no, on-failure[:max-retry], always, unless-stopped). |
|
| 356 |
- |
|
| 357 |
-**--rm**=*true*|*false* |
|
| 358 |
- Automatically remove the container when it exits. The default is *false*. |
|
| 359 |
- |
|
| 360 |
-**--shm-size**="" |
|
| 361 |
- Size of `/dev/shm`. The format is `<number><unit>`. `number` must be greater than `0`. |
|
| 362 |
- Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes). If you omit the unit, the system uses bytes. |
|
| 363 |
- If you omit the size entirely, the system uses `64m`. |
|
| 364 |
- |
|
| 365 |
-**--security-opt**=[] |
|
| 366 |
- Security Options |
|
| 367 |
- |
|
| 368 |
- "label:user:USER" : Set the label user for the container |
|
| 369 |
- "label:role:ROLE" : Set the label role for the container |
|
| 370 |
- "label:type:TYPE" : Set the label type for the container |
|
| 371 |
- "label:level:LEVEL" : Set the label level for the container |
|
| 372 |
- "label:disable" : Turn off label confinement for the container |
|
| 373 |
- "no-new-privileges" : Disable container processes from gaining additional privileges |
|
| 374 |
- "seccomp:unconfined" : Turn off seccomp confinement for the container |
|
| 375 |
- "seccomp:profile.json : White listed syscalls seccomp Json file to be used as a seccomp filter |
|
| 376 |
- |
|
| 377 |
-**--storage-opt**=[] |
|
| 378 |
- Storage driver options per container |
|
| 379 |
- |
|
| 380 |
- $ docker create -it --storage-opt size=120G fedora /bin/bash |
|
| 381 |
- |
|
| 382 |
- This (size) will allow to set the container rootfs size to 120G at creation time. |
|
| 383 |
- This option is only available for the `devicemapper`, `btrfs`, `overlay2` and `zfs` graph drivers. |
|
| 384 |
- For the `devicemapper`, `btrfs` and `zfs` storage drivers, user cannot pass a size less than the Default BaseFS Size. |
|
| 385 |
- For the `overlay2` storage driver, the size option is only available if the backing fs is `xfs` and mounted with the `pquota` mount option. |
|
| 386 |
- Under these conditions, user can pass any size less then the backing fs size. |
|
| 387 |
- |
|
| 388 |
-**--stop-signal**=*SIGTERM* |
|
| 389 |
- Signal to stop a container. Default is SIGTERM. |
|
| 390 |
- |
|
| 391 |
-**--stop-timeout**=*10* |
|
| 392 |
- Timeout (in seconds) to stop a container. Default is 10. |
|
| 393 |
- |
|
| 394 |
-**--sysctl**=SYSCTL |
|
| 395 |
- Configure namespaced kernel parameters at runtime |
|
| 396 |
- |
|
| 397 |
- IPC Namespace - current sysctls allowed: |
|
| 398 |
- |
|
| 399 |
- kernel.msgmax, kernel.msgmnb, kernel.msgmni, kernel.sem, kernel.shmall, kernel.shmmax, kernel.shmmni, kernel.shm_rmid_forced |
|
| 400 |
- Sysctls beginning with fs.mqueue.* |
|
| 401 |
- |
|
| 402 |
- Note: if you use --ipc=host using these sysctls will not be allowed. |
|
| 403 |
- |
|
| 404 |
- Network Namespace - current sysctls allowed: |
|
| 405 |
- Sysctls beginning with net.* |
|
| 406 |
- |
|
| 407 |
- Note: if you use --network=host using these sysctls will not be allowed. |
|
| 408 |
- |
|
| 409 |
-**-t**, **--tty**=*true*|*false* |
|
| 410 |
- Allocate a pseudo-TTY. The default is *false*. |
|
| 411 |
- |
|
| 412 |
-**--tmpfs**=[] Create a tmpfs mount |
|
| 413 |
- |
|
| 414 |
- Mount a temporary filesystem (`tmpfs`) mount into a container, for example: |
|
| 415 |
- |
|
| 416 |
- $ docker run -d --tmpfs /tmp:rw,size=787448k,mode=1777 my_image |
|
| 417 |
- |
|
| 418 |
- This command mounts a `tmpfs` at `/tmp` within the container. The supported mount |
|
| 419 |
-options are the same as the Linux default `mount` flags. If you do not specify |
|
| 420 |
-any options, the systems uses the following options: |
|
| 421 |
-`rw,noexec,nosuid,nodev,size=65536k`. |
|
| 422 |
- |
|
| 423 |
-**-u**, **--user**="" |
|
| 424 |
- Sets the username or UID used and optionally the groupname or GID for the specified command. |
|
| 425 |
- |
|
| 426 |
- The followings examples are all valid: |
|
| 427 |
- --user [user | user:group | uid | uid:gid | user:gid | uid:group ] |
|
| 428 |
- |
|
| 429 |
- Without this argument root user will be used in the container by default. |
|
| 430 |
- |
|
| 431 |
-**--ulimit**=[] |
|
| 432 |
- Ulimit options |
|
| 433 |
- |
|
| 434 |
-**--uts**=*host* |
|
| 435 |
- Set the UTS mode for the container |
|
| 436 |
- **host**: use the host's UTS namespace inside the container. |
|
| 437 |
- Note: the host mode gives the container access to changing the host's hostname and is therefore considered insecure. |
|
| 438 |
- |
|
| 439 |
-**-v**|**--volume**[=*[[HOST-DIR:]CONTAINER-DIR[:OPTIONS]]*] |
|
| 440 |
- Create a bind mount. If you specify, ` -v /HOST-DIR:/CONTAINER-DIR`, Docker |
|
| 441 |
- bind mounts `/HOST-DIR` in the host to `/CONTAINER-DIR` in the Docker |
|
| 442 |
- container. If 'HOST-DIR' is omitted, Docker automatically creates the new |
|
| 443 |
- volume on the host. The `OPTIONS` are a comma delimited list and can be: |
|
| 444 |
- |
|
| 445 |
- * [rw|ro] |
|
| 446 |
- * [z|Z] |
|
| 447 |
- * [`[r]shared`|`[r]slave`|`[r]private`] |
|
| 448 |
- |
|
| 449 |
-The `CONTAINER-DIR` must be an absolute path such as `/src/docs`. The `HOST-DIR` |
|
| 450 |
-can be an absolute path or a `name` value. A `name` value must start with an |
|
| 451 |
-alphanumeric character, followed by `a-z0-9`, `_` (underscore), `.` (period) or |
|
| 452 |
-`-` (hyphen). An absolute path starts with a `/` (forward slash). |
|
| 453 |
- |
|
| 454 |
-If you supply a `HOST-DIR` that is an absolute path, Docker bind-mounts to the |
|
| 455 |
-path you specify. If you supply a `name`, Docker creates a named volume by that |
|
| 456 |
-`name`. For example, you can specify either `/foo` or `foo` for a `HOST-DIR` |
|
| 457 |
-value. If you supply the `/foo` value, Docker creates a bind-mount. If you |
|
| 458 |
-supply the `foo` specification, Docker creates a named volume. |
|
| 459 |
- |
|
| 460 |
-You can specify multiple **-v** options to mount one or more mounts to a |
|
| 461 |
-container. To use these same mounts in other containers, specify the |
|
| 462 |
-**--volumes-from** option also. |
|
| 463 |
- |
|
| 464 |
-You can add `:ro` or `:rw` suffix to a volume to mount it read-only or |
|
| 465 |
-read-write mode, respectively. By default, the volumes are mounted read-write. |
|
| 466 |
-See examples. |
|
| 467 |
- |
|
| 468 |
-Labeling systems like SELinux require that proper labels are placed on volume |
|
| 469 |
-content mounted into a container. Without a label, the security system might |
|
| 470 |
-prevent the processes running inside the container from using the content. By |
|
| 471 |
-default, Docker does not change the labels set by the OS. |
|
| 472 |
- |
|
| 473 |
-To change a label in the container context, you can add either of two suffixes |
|
| 474 |
-`:z` or `:Z` to the volume mount. These suffixes tell Docker to relabel file |
|
| 475 |
-objects on the shared volumes. The `z` option tells Docker that two containers |
|
| 476 |
-share the volume content. As a result, Docker labels the content with a shared |
|
| 477 |
-content label. Shared volume labels allow all containers to read/write content. |
|
| 478 |
-The `Z` option tells Docker to label the content with a private unshared label. |
|
| 479 |
-Only the current container can use a private volume. |
|
| 480 |
- |
|
| 481 |
-By default bind mounted volumes are `private`. That means any mounts done |
|
| 482 |
-inside container will not be visible on host and vice-a-versa. One can change |
|
| 483 |
-this behavior by specifying a volume mount propagation property. Making a |
|
| 484 |
-volume `shared` mounts done under that volume inside container will be |
|
| 485 |
-visible on host and vice-a-versa. Making a volume `slave` enables only one |
|
| 486 |
-way mount propagation and that is mounts done on host under that volume |
|
| 487 |
-will be visible inside container but not the other way around. |
|
| 488 |
- |
|
| 489 |
-To control mount propagation property of volume one can use `:[r]shared`, |
|
| 490 |
-`:[r]slave` or `:[r]private` propagation flag. Propagation property can |
|
| 491 |
-be specified only for bind mounted volumes and not for internal volumes or |
|
| 492 |
-named volumes. For mount propagation to work source mount point (mount point |
|
| 493 |
-where source dir is mounted on) has to have right propagation properties. For |
|
| 494 |
-shared volumes, source mount point has to be shared. And for slave volumes, |
|
| 495 |
-source mount has to be either shared or slave. |
|
| 496 |
- |
|
| 497 |
-Use `df <source-dir>` to figure out the source mount and then use |
|
| 498 |
-`findmnt -o TARGET,PROPAGATION <source-mount-dir>` to figure out propagation |
|
| 499 |
-properties of source mount. If `findmnt` utility is not available, then one |
|
| 500 |
-can look at mount entry for source mount point in `/proc/self/mountinfo`. Look |
|
| 501 |
-at `optional fields` and see if any propagaion properties are specified. |
|
| 502 |
-`shared:X` means mount is `shared`, `master:X` means mount is `slave` and if |
|
| 503 |
-nothing is there that means mount is `private`. |
|
| 504 |
- |
|
| 505 |
-To change propagation properties of a mount point use `mount` command. For |
|
| 506 |
-example, if one wants to bind mount source directory `/foo` one can do |
|
| 507 |
-`mount --bind /foo /foo` and `mount --make-private --make-shared /foo`. This |
|
| 508 |
-will convert /foo into a `shared` mount point. Alternatively one can directly |
|
| 509 |
-change propagation properties of source mount. Say `/` is source mount for |
|
| 510 |
-`/foo`, then use `mount --make-shared /` to convert `/` into a `shared` mount. |
|
| 511 |
- |
|
| 512 |
-> **Note**: |
|
| 513 |
-> When using systemd to manage the Docker daemon's start and stop, in the systemd |
|
| 514 |
-> unit file there is an option to control mount propagation for the Docker daemon |
|
| 515 |
-> itself, called `MountFlags`. The value of this setting may cause Docker to not |
|
| 516 |
-> see mount propagation changes made on the mount point. For example, if this value |
|
| 517 |
-> is `slave`, you may not be able to use the `shared` or `rshared` propagation on |
|
| 518 |
-> a volume. |
|
| 519 |
- |
|
| 520 |
- |
|
| 521 |
-To disable automatic copying of data from the container path to the volume, use |
|
| 522 |
-the `nocopy` flag. The `nocopy` flag can be set on bind mounts and named volumes. |
|
| 523 |
- |
|
| 524 |
-**--volume-driver**="" |
|
| 525 |
- Container's volume driver. This driver creates volumes specified either from |
|
| 526 |
- a Dockerfile's `VOLUME` instruction or from the `docker run -v` flag. |
|
| 527 |
- See **docker-volume-create(1)** for full details. |
|
| 528 |
- |
|
| 529 |
-**--volumes-from**=[] |
|
| 530 |
- Mount volumes from the specified container(s) |
|
| 531 |
- |
|
| 532 |
-**-w**, **--workdir**="" |
|
| 533 |
- Working directory inside the container |
|
| 534 |
- |
|
| 535 |
-# EXAMPLES |
|
| 536 |
- |
|
| 537 |
-## Specify isolation technology for container (--isolation) |
|
| 538 |
- |
|
| 539 |
-This option is useful in situations where you are running Docker containers on |
|
| 540 |
-Windows. The `--isolation=<value>` option sets a container's isolation |
|
| 541 |
-technology. On Linux, the only supported is the `default` option which uses |
|
| 542 |
-Linux namespaces. On Microsoft Windows, you can specify these values: |
|
| 543 |
- |
|
| 544 |
-* `default`: Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value. |
|
| 545 |
-* `process`: Namespace isolation only. |
|
| 546 |
-* `hyperv`: Hyper-V hypervisor partition-based isolation. |
|
| 547 |
- |
|
| 548 |
-Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`. |
|
| 549 |
- |
|
| 550 |
-# HISTORY |
|
| 551 |
-August 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 552 |
-September 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 553 |
-November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 554 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,61 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-diff - Inspect changes to files or directories on a container's filesystem |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker diff** |
|
| 9 |
-[**--help**] |
|
| 10 |
-CONTAINER |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
-List the changed files and directories in a container᾿s filesystem since the |
|
| 14 |
-container was created. Three different types of change are tracked: |
|
| 15 |
- |
|
| 16 |
-| Symbol | Description | |
|
| 17 |
-|--------|---------------------------------| |
|
| 18 |
-| `A` | A file or directory was added | |
|
| 19 |
-| `D` | A file or directory was deleted | |
|
| 20 |
-| `C` | A file or directory was changed | |
|
| 21 |
- |
|
| 22 |
-You can use the full or shortened container ID or the container name set using |
|
| 23 |
-**docker run --name** option. |
|
| 24 |
- |
|
| 25 |
-# OPTIONS |
|
| 26 |
-**--help** |
|
| 27 |
- Print usage statement |
|
| 28 |
- |
|
| 29 |
-# EXAMPLES |
|
| 30 |
- |
|
| 31 |
-Inspect the changes to an `nginx` container: |
|
| 32 |
- |
|
| 33 |
-```bash |
|
| 34 |
-$ docker diff 1fdfd1f54c1b |
|
| 35 |
- |
|
| 36 |
-C /dev |
|
| 37 |
-C /dev/console |
|
| 38 |
-C /dev/core |
|
| 39 |
-C /dev/stdout |
|
| 40 |
-C /dev/fd |
|
| 41 |
-C /dev/ptmx |
|
| 42 |
-C /dev/stderr |
|
| 43 |
-C /dev/stdin |
|
| 44 |
-C /run |
|
| 45 |
-A /run/nginx.pid |
|
| 46 |
-C /var/lib/nginx/tmp |
|
| 47 |
-A /var/lib/nginx/tmp/client_body |
|
| 48 |
-A /var/lib/nginx/tmp/fastcgi |
|
| 49 |
-A /var/lib/nginx/tmp/proxy |
|
| 50 |
-A /var/lib/nginx/tmp/scgi |
|
| 51 |
-A /var/lib/nginx/tmp/uwsgi |
|
| 52 |
-C /var/log/nginx |
|
| 53 |
-A /var/log/nginx/access.log |
|
| 54 |
-A /var/log/nginx/error.log |
|
| 55 |
-``` |
|
| 56 |
- |
|
| 57 |
- |
|
| 58 |
-# HISTORY |
|
| 59 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 60 |
-based on docker.com source material and internal work. |
|
| 61 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 62 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,180 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-events - Get real time events from the server |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker events** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-f**|**--filter**[=*[]*]] |
|
| 11 |
-[**--since**[=*SINCE*]] |
|
| 12 |
-[**--until**[=*UNTIL*]] |
|
| 13 |
-[**--format**[=*FORMAT*]] |
|
| 14 |
- |
|
| 15 |
- |
|
| 16 |
-# DESCRIPTION |
|
| 17 |
-Get event information from the Docker daemon. Information can include historical |
|
| 18 |
-information and real-time information. |
|
| 19 |
- |
|
| 20 |
-Docker containers will report the following events: |
|
| 21 |
- |
|
| 22 |
- attach, commit, copy, create, destroy, detach, die, exec_create, exec_detach, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update |
|
| 23 |
- |
|
| 24 |
-Docker images report the following events: |
|
| 25 |
- |
|
| 26 |
- delete, import, load, pull, push, save, tag, untag |
|
| 27 |
- |
|
| 28 |
-Docker volumes report the following events: |
|
| 29 |
- |
|
| 30 |
- create, mount, unmount, destroy |
|
| 31 |
- |
|
| 32 |
-Docker networks report the following events: |
|
| 33 |
- |
|
| 34 |
- create, connect, disconnect, destroy |
|
| 35 |
- |
|
| 36 |
-# OPTIONS |
|
| 37 |
-**--help** |
|
| 38 |
- Print usage statement |
|
| 39 |
- |
|
| 40 |
-**-f**, **--filter**=[] |
|
| 41 |
- Filter output based on these conditions |
|
| 42 |
- - container (`container=<name or id>`) |
|
| 43 |
- - event (`event=<event action>`) |
|
| 44 |
- - image (`image=<tag or id>`) |
|
| 45 |
- - plugin (experimental) (`plugin=<name or id>`) |
|
| 46 |
- - label (`label=<key>` or `label=<key>=<value>`) |
|
| 47 |
- - type (`type=<container or image or volume or network or daemon>`) |
|
| 48 |
- - volume (`volume=<name or id>`) |
|
| 49 |
- - network (`network=<name or id>`) |
|
| 50 |
- - daemon (`daemon=<name or id>`) |
|
| 51 |
- |
|
| 52 |
-**--since**="" |
|
| 53 |
- Show all events created since timestamp |
|
| 54 |
- |
|
| 55 |
-**--until**="" |
|
| 56 |
- Stream events until this timestamp |
|
| 57 |
- |
|
| 58 |
-**--format**="" |
|
| 59 |
- Format the output using the given Go template |
|
| 60 |
- |
|
| 61 |
-The `--since` and `--until` parameters can be Unix timestamps, date formatted |
|
| 62 |
-timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed |
|
| 63 |
-relative to the client machine's time. If you do not provide the `--since` option, |
|
| 64 |
-the command returns only new and/or live events. Supported formats for date |
|
| 65 |
-formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, |
|
| 66 |
-`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local |
|
| 67 |
-timezone on the client will be used if you do not provide either a `Z` or a |
|
| 68 |
-`+-00:00` timezone offset at the end of the timestamp. When providing Unix |
|
| 69 |
-timestamps enter seconds[.nanoseconds], where seconds is the number of seconds |
|
| 70 |
-that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap |
|
| 71 |
-seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a |
|
| 72 |
-fraction of a second no more than nine digits long. |
|
| 73 |
- |
|
| 74 |
-# EXAMPLES |
|
| 75 |
- |
|
| 76 |
-## Listening for Docker events |
|
| 77 |
- |
|
| 78 |
-After running docker events a container 786d698004576 is started and stopped |
|
| 79 |
-(The container name has been shortened in the output below): |
|
| 80 |
- |
|
| 81 |
- # docker events |
|
| 82 |
- 2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) start |
|
| 83 |
- 2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) die |
|
| 84 |
- 2015-01-28T20:21:32.000000000-08:00 59211849bc10: (from whenry/testimage:latest) stop |
|
| 85 |
- |
|
| 86 |
-## Listening for events since a given date |
|
| 87 |
-Again the output container IDs have been shortened for the purposes of this document: |
|
| 88 |
- |
|
| 89 |
- # docker events --since '2015-01-28' |
|
| 90 |
- 2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create |
|
| 91 |
- 2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start |
|
| 92 |
- 2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create |
|
| 93 |
- 2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start |
|
| 94 |
- 2015-01-28T20:25:40.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die |
|
| 95 |
- 2015-01-28T20:25:42.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop |
|
| 96 |
- 2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start |
|
| 97 |
- 2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die |
|
| 98 |
- 2015-01-28T20:25:46.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop |
|
| 99 |
- |
|
| 100 |
-The following example outputs all events that were generated in the last 3 minutes, |
|
| 101 |
-relative to the current time on the client machine: |
|
| 102 |
- |
|
| 103 |
- # docker events --since '3m' |
|
| 104 |
- 2015-05-12T11:51:30.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die |
|
| 105 |
- 2015-05-12T15:52:12.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop |
|
| 106 |
- 2015-05-12T15:53:45.999999999Z07:00 7805c1d35632: (from redis:2.8) die |
|
| 107 |
- 2015-05-12T15:54:03.999999999Z07:00 7805c1d35632: (from redis:2.8) stop |
|
| 108 |
- |
|
| 109 |
-If you do not provide the --since option, the command returns only new and/or |
|
| 110 |
-live events. |
|
| 111 |
- |
|
| 112 |
-## Format |
|
| 113 |
- |
|
| 114 |
-If a format (`--format`) is specified, the given template will be executed |
|
| 115 |
-instead of the default format. Go's **text/template** package describes all the |
|
| 116 |
-details of the format. |
|
| 117 |
- |
|
| 118 |
- # docker events --filter 'type=container' --format 'Type={{.Type}} Status={{.Status}} ID={{.ID}}'
|
|
| 119 |
- Type=container Status=create ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 120 |
- Type=container Status=attach ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 121 |
- Type=container Status=start ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 122 |
- Type=container Status=resize ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 123 |
- Type=container Status=die ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 124 |
- Type=container Status=destroy ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 125 |
- |
|
| 126 |
-If a format is set to `{{json .}}`, the events are streamed as valid JSON
|
|
| 127 |
-Lines. For information about JSON Lines, please refer to http://jsonlines.org/ . |
|
| 128 |
- |
|
| 129 |
- # docker events --format '{{json .}}'
|
|
| 130 |
- {"status":"create","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
|
|
| 131 |
- {"status":"attach","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
|
|
| 132 |
- {"Type":"network","Action":"connect","Actor":{"ID":"1b50a5bf755f6021dfa78e..
|
|
| 133 |
- {"status":"start","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f42..
|
|
| 134 |
- {"status":"resize","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
|
|
| 135 |
- |
|
| 136 |
-## Filters |
|
| 137 |
- |
|
| 138 |
- $ docker events --filter 'event=stop' |
|
| 139 |
- 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) |
|
| 140 |
- 2014-09-03T17:42:14.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) |
|
| 141 |
- |
|
| 142 |
- $ docker events --filter 'image=ubuntu-1:14.04' |
|
| 143 |
- 2014-05-10T17:42:14.999999999Z07:00 container start 4386fb97867d (image=ubuntu-1:14.04) |
|
| 144 |
- 2014-05-10T17:42:14.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04) |
|
| 145 |
- 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) |
|
| 146 |
- |
|
| 147 |
- $ docker events --filter 'container=7805c1d35632' |
|
| 148 |
- 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8) |
|
| 149 |
- 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image= redis:2.8) |
|
| 150 |
- |
|
| 151 |
- $ docker events --filter 'container=7805c1d35632' --filter 'container=4386fb97867d' |
|
| 152 |
- 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04) |
|
| 153 |
- 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) |
|
| 154 |
- 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8) |
|
| 155 |
- 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) |
|
| 156 |
- |
|
| 157 |
- $ docker events --filter 'container=7805c1d35632' --filter 'event=stop' |
|
| 158 |
- 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) |
|
| 159 |
- |
|
| 160 |
- $ docker events --filter 'type=volume' |
|
| 161 |
- 2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local) |
|
| 162 |
- 2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, destination=/foo, driver=local, propagation=rprivate) |
|
| 163 |
- 2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, driver=local) |
|
| 164 |
- 2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local) |
|
| 165 |
- |
|
| 166 |
- $ docker events --filter 'type=network' |
|
| 167 |
- 2015-12-23T21:38:24.705709133Z network create 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, type=bridge) |
|
| 168 |
- 2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge) |
|
| 169 |
- |
|
| 170 |
- $ docker events --filter 'type=plugin' (experimental) |
|
| 171 |
- 2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/no-remove:latest) |
|
| 172 |
- 2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/no-remove:latest) |
|
| 173 |
- |
|
| 174 |
- |
|
| 175 |
-# HISTORY |
|
| 176 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 177 |
-based on docker.com source material and internal work. |
|
| 178 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 179 |
-June 2015, updated by Brian Goff <cpuguy83@gmail.com> |
|
| 180 |
-October 2015, updated by Mike Brown <mikebrow@gmail.com> |
| 181 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,71 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-exec - Run a command in a running container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker exec** |
|
| 9 |
-[**-d**|**--detach**] |
|
| 10 |
-[**--detach-keys**[=*[]*]] |
|
| 11 |
-[**-e**|**--env**[=*[]*]] |
|
| 12 |
-[**--help**] |
|
| 13 |
-[**-i**|**--interactive**] |
|
| 14 |
-[**--privileged**] |
|
| 15 |
-[**-t**|**--tty**] |
|
| 16 |
-[**-u**|**--user**[=*USER*]] |
|
| 17 |
-CONTAINER COMMAND [ARG...] |
|
| 18 |
- |
|
| 19 |
-# DESCRIPTION |
|
| 20 |
- |
|
| 21 |
-Run a process in a running container. |
|
| 22 |
- |
|
| 23 |
-The command started using `docker exec` will only run while the container's primary |
|
| 24 |
-process (`PID 1`) is running, and will not be restarted if the container is restarted. |
|
| 25 |
- |
|
| 26 |
-If the container is paused, then the `docker exec` command will wait until the |
|
| 27 |
-container is unpaused, and then run |
|
| 28 |
- |
|
| 29 |
-# OPTIONS |
|
| 30 |
-**-d**, **--detach**=*true*|*false* |
|
| 31 |
- Detached mode: run command in the background. The default is *false*. |
|
| 32 |
- |
|
| 33 |
-**--detach-keys**="" |
|
| 34 |
- Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. |
|
| 35 |
- |
|
| 36 |
-**-e**, **--env**=[] |
|
| 37 |
- Set environment variables |
|
| 38 |
- |
|
| 39 |
- This option allows you to specify arbitrary environment variables that are |
|
| 40 |
-available for the command to be executed. |
|
| 41 |
- |
|
| 42 |
-**--help** |
|
| 43 |
- Print usage statement |
|
| 44 |
- |
|
| 45 |
-**-i**, **--interactive**=*true*|*false* |
|
| 46 |
- Keep STDIN open even if not attached. The default is *false*. |
|
| 47 |
- |
|
| 48 |
-**--privileged**=*true*|*false* |
|
| 49 |
- Give the process extended [Linux capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html) |
|
| 50 |
-when running in a container. The default is *false*. |
|
| 51 |
- |
|
| 52 |
- Without this flag, the process run by `docker exec` in a running container has |
|
| 53 |
-the same capabilities as the container, which may be limited. Set |
|
| 54 |
-`--privileged` to give all capabilities to the process. |
|
| 55 |
- |
|
| 56 |
-**-t**, **--tty**=*true*|*false* |
|
| 57 |
- Allocate a pseudo-TTY. The default is *false*. |
|
| 58 |
- |
|
| 59 |
-**-u**, **--user**="" |
|
| 60 |
- Sets the username or UID used and optionally the groupname or GID for the specified command. |
|
| 61 |
- |
|
| 62 |
- The followings examples are all valid: |
|
| 63 |
- --user [user | user:group | uid | uid:gid | user:gid | uid:group ] |
|
| 64 |
- |
|
| 65 |
- Without this argument the command will be run as root in the container. |
|
| 66 |
- |
|
| 67 |
-The **-t** option is incompatible with a redirection of the docker client |
|
| 68 |
-standard input. |
|
| 69 |
- |
|
| 70 |
-# HISTORY |
|
| 71 |
-November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 72 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,46 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-export - Export the contents of a container's filesystem as a tar archive |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker export** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-o**|**--output**[=*""*]] |
|
| 11 |
-CONTAINER |
|
| 12 |
- |
|
| 13 |
-# DESCRIPTION |
|
| 14 |
-Export the contents of a container's filesystem using the full or shortened |
|
| 15 |
-container ID or container name. The output is exported to STDOUT and can be |
|
| 16 |
-redirected to a tar file. |
|
| 17 |
- |
|
| 18 |
-Stream to a file instead of STDOUT by using **-o**. |
|
| 19 |
- |
|
| 20 |
-# OPTIONS |
|
| 21 |
-**--help** |
|
| 22 |
- Print usage statement |
|
| 23 |
- |
|
| 24 |
-**-o**, **--output**="" |
|
| 25 |
- Write to a file, instead of STDOUT |
|
| 26 |
- |
|
| 27 |
-# EXAMPLES |
|
| 28 |
-Export the contents of the container called angry_bell to a tar file |
|
| 29 |
-called angry_bell.tar: |
|
| 30 |
- |
|
| 31 |
- # docker export angry_bell > angry_bell.tar |
|
| 32 |
- # docker export --output=angry_bell-latest.tar angry_bell |
|
| 33 |
- # ls -sh angry_bell.tar |
|
| 34 |
- 321M angry_bell.tar |
|
| 35 |
- # ls -sh angry_bell-latest.tar |
|
| 36 |
- 321M angry_bell-latest.tar |
|
| 37 |
- |
|
| 38 |
-# See also |
|
| 39 |
-**docker-import(1)** to create an empty filesystem image |
|
| 40 |
-and import the contents of the tarball into it, then optionally tag it. |
|
| 41 |
- |
|
| 42 |
-# HISTORY |
|
| 43 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 44 |
-based on docker.com source material and internal work. |
|
| 45 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 46 |
-January 2015, updated by Joseph Kern (josephakern at gmail dot com) |
| 47 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,52 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-history - Show the history of an image |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker history** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-H**|**--human**[=*true*]] |
|
| 11 |
-[**--no-trunc**] |
|
| 12 |
-[**-q**|**--quiet**] |
|
| 13 |
-IMAGE |
|
| 14 |
- |
|
| 15 |
-# DESCRIPTION |
|
| 16 |
- |
|
| 17 |
-Show the history of when and how an image was created. |
|
| 18 |
- |
|
| 19 |
-# OPTIONS |
|
| 20 |
-**--help** |
|
| 21 |
- Print usage statement |
|
| 22 |
- |
|
| 23 |
-**-H**, **--human**=*true*|*false* |
|
| 24 |
- Print sizes and dates in human readable format. The default is *true*. |
|
| 25 |
- |
|
| 26 |
-**--no-trunc**=*true*|*false* |
|
| 27 |
- Don't truncate output. The default is *false*. |
|
| 28 |
- |
|
| 29 |
-**-q**, **--quiet**=*true*|*false* |
|
| 30 |
- Only show numeric IDs. The default is *false*. |
|
| 31 |
- |
|
| 32 |
-# EXAMPLES |
|
| 33 |
- $ docker history fedora |
|
| 34 |
- IMAGE CREATED CREATED BY SIZE COMMENT |
|
| 35 |
- 105182bb5e8b 5 days ago /bin/sh -c #(nop) ADD file:71356d2ad59aa3119d 372.7 MB |
|
| 36 |
- 73bd853d2ea5 13 days ago /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar 0 B |
|
| 37 |
- 511136ea3c5a 10 months ago 0 B Imported from - |
|
| 38 |
- |
|
| 39 |
-## Display comments in the image history |
|
| 40 |
-The `docker commit` command has a **-m** flag for adding comments to the image. These comments will be displayed in the image history. |
|
| 41 |
- |
|
| 42 |
- $ sudo docker history docker:scm |
|
| 43 |
- IMAGE CREATED CREATED BY SIZE COMMENT |
|
| 44 |
- 2ac9d1098bf1 3 months ago /bin/bash 241.4 MB Added Apache to Fedora base image |
|
| 45 |
- 88b42ffd1f7c 5 months ago /bin/sh -c #(nop) ADD file:1fd8d7f9f6557cafc7 373.7 MB |
|
| 46 |
- c69cab00d6ef 5 months ago /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar 0 B |
|
| 47 |
- 511136ea3c5a 19 months ago 0 B Imported from - |
|
| 48 |
- |
|
| 49 |
-# HISTORY |
|
| 50 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 51 |
-based on docker.com source material and internal work. |
|
| 52 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 53 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,153 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-images - List images |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker images** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-a**|**--all**] |
|
| 11 |
-[**--digests**] |
|
| 12 |
-[**-f**|**--filter**[=*[]*]] |
|
| 13 |
-[**--format**=*"TEMPLATE"*] |
|
| 14 |
-[**--no-trunc**] |
|
| 15 |
-[**-q**|**--quiet**] |
|
| 16 |
-[REPOSITORY[:TAG]] |
|
| 17 |
- |
|
| 18 |
-# DESCRIPTION |
|
| 19 |
-This command lists the images stored in the local Docker repository. |
|
| 20 |
- |
|
| 21 |
-By default, intermediate images, used during builds, are not listed. Some of the |
|
| 22 |
-output, e.g., image ID, is truncated, for space reasons. However the truncated |
|
| 23 |
-image ID, and often the first few characters, are enough to be used in other |
|
| 24 |
-Docker commands that use the image ID. The output includes repository, tag, image |
|
| 25 |
-ID, date created and the virtual size. |
|
| 26 |
- |
|
| 27 |
-The title REPOSITORY for the first title may seem confusing. It is essentially |
|
| 28 |
-the image name. However, because you can tag a specific image, and multiple tags |
|
| 29 |
-(image instances) can be associated with a single name, the name is really a |
|
| 30 |
-repository for all tagged images of the same name. For example consider an image |
|
| 31 |
-called fedora. It may be tagged with 18, 19, or 20, etc. to manage different |
|
| 32 |
-versions. |
|
| 33 |
- |
|
| 34 |
-# OPTIONS |
|
| 35 |
-**-a**, **--all**=*true*|*false* |
|
| 36 |
- Show all images (by default filter out the intermediate image layers). The default is *false*. |
|
| 37 |
- |
|
| 38 |
-**--digests**=*true*|*false* |
|
| 39 |
- Show image digests. The default is *false*. |
|
| 40 |
- |
|
| 41 |
-**-f**, **--filter**=[] |
|
| 42 |
- Filters the output based on these conditions: |
|
| 43 |
- - dangling=(true|false) - find unused images |
|
| 44 |
- - label=<key> or label=<key>=<value> |
|
| 45 |
- - before=(<image-name>[:tag]|<image-id>|<image@digest>) |
|
| 46 |
- - since=(<image-name>[:tag]|<image-id>|<image@digest>) |
|
| 47 |
- |
|
| 48 |
-**--format**="*TEMPLATE*" |
|
| 49 |
- Pretty-print images using a Go template. |
|
| 50 |
- Valid placeholders: |
|
| 51 |
- .ID - Image ID |
|
| 52 |
- .Repository - Image repository |
|
| 53 |
- .Tag - Image tag |
|
| 54 |
- .Digest - Image digest |
|
| 55 |
- .CreatedSince - Elapsed time since the image was created |
|
| 56 |
- .CreatedAt - Time when the image was created |
|
| 57 |
- .Size - Image disk size |
|
| 58 |
- |
|
| 59 |
-**--help** |
|
| 60 |
- Print usage statement |
|
| 61 |
- |
|
| 62 |
-**--no-trunc**=*true*|*false* |
|
| 63 |
- Don't truncate output. The default is *false*. |
|
| 64 |
- |
|
| 65 |
-**-q**, **--quiet**=*true*|*false* |
|
| 66 |
- Only show numeric IDs. The default is *false*. |
|
| 67 |
- |
|
| 68 |
-# EXAMPLES |
|
| 69 |
- |
|
| 70 |
-## Listing the images |
|
| 71 |
- |
|
| 72 |
-To list the images in a local repository (not the registry) run: |
|
| 73 |
- |
|
| 74 |
- docker images |
|
| 75 |
- |
|
| 76 |
-The list will contain the image repository name, a tag for the image, and an |
|
| 77 |
-image ID, when it was created and its virtual size. Columns: REPOSITORY, TAG, |
|
| 78 |
-IMAGE ID, CREATED, and SIZE. |
|
| 79 |
- |
|
| 80 |
-The `docker images` command takes an optional `[REPOSITORY[:TAG]]` argument |
|
| 81 |
-that restricts the list to images that match the argument. If you specify |
|
| 82 |
-`REPOSITORY`but no `TAG`, the `docker images` command lists all images in the |
|
| 83 |
-given repository. |
|
| 84 |
- |
|
| 85 |
- docker images java |
|
| 86 |
- |
|
| 87 |
-The `[REPOSITORY[:TAG]]` value must be an "exact match". This means that, for example, |
|
| 88 |
-`docker images jav` does not match the image `java`. |
|
| 89 |
- |
|
| 90 |
-If both `REPOSITORY` and `TAG` are provided, only images matching that |
|
| 91 |
-repository and tag are listed. To find all local images in the "java" |
|
| 92 |
-repository with tag "8" you can use: |
|
| 93 |
- |
|
| 94 |
- docker images java:8 |
|
| 95 |
- |
|
| 96 |
-To get a verbose list of images which contains all the intermediate images |
|
| 97 |
-used in builds use **-a**: |
|
| 98 |
- |
|
| 99 |
- docker images -a |
|
| 100 |
- |
|
| 101 |
-Previously, the docker images command supported the --tree and --dot arguments, |
|
| 102 |
-which displayed different visualizations of the image data. Docker core removed |
|
| 103 |
-this functionality in the 1.7 version. If you liked this functionality, you can |
|
| 104 |
-still find it in the third-party dockviz tool: https://github.com/justone/dockviz. |
|
| 105 |
- |
|
| 106 |
-## Listing images in a desired format |
|
| 107 |
- |
|
| 108 |
-When using the --format option, the image command will either output the data |
|
| 109 |
-exactly as the template declares or, when using the `table` directive, will |
|
| 110 |
-include column headers as well. You can use special characters like `\t` for |
|
| 111 |
-inserting tab spacing between columns. |
|
| 112 |
- |
|
| 113 |
-The following example uses a template without headers and outputs the ID and |
|
| 114 |
-Repository entries separated by a colon for all images: |
|
| 115 |
- |
|
| 116 |
- docker images --format "{{.ID}}: {{.Repository}}"
|
|
| 117 |
- 77af4d6b9913: <none> |
|
| 118 |
- b6fa739cedf5: committ |
|
| 119 |
- 78a85c484bad: ipbabble |
|
| 120 |
- 30557a29d5ab: docker |
|
| 121 |
- 5ed6274db6ce: <none> |
|
| 122 |
- 746b819f315e: postgres |
|
| 123 |
- 746b819f315e: postgres |
|
| 124 |
- 746b819f315e: postgres |
|
| 125 |
- 746b819f315e: postgres |
|
| 126 |
- |
|
| 127 |
-To list all images with their repository and tag in a table format you can use: |
|
| 128 |
- |
|
| 129 |
- docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}"
|
|
| 130 |
- IMAGE ID REPOSITORY TAG |
|
| 131 |
- 77af4d6b9913 <none> <none> |
|
| 132 |
- b6fa739cedf5 committ latest |
|
| 133 |
- 78a85c484bad ipbabble <none> |
|
| 134 |
- 30557a29d5ab docker latest |
|
| 135 |
- 5ed6274db6ce <none> <none> |
|
| 136 |
- 746b819f315e postgres 9 |
|
| 137 |
- 746b819f315e postgres 9.3 |
|
| 138 |
- 746b819f315e postgres 9.3.5 |
|
| 139 |
- 746b819f315e postgres latest |
|
| 140 |
- |
|
| 141 |
-Valid template placeholders are listed above. |
|
| 142 |
- |
|
| 143 |
-## Listing only the shortened image IDs |
|
| 144 |
- |
|
| 145 |
-Listing just the shortened image IDs. This can be useful for some automated |
|
| 146 |
-tools. |
|
| 147 |
- |
|
| 148 |
- docker images -q |
|
| 149 |
- |
|
| 150 |
-# HISTORY |
|
| 151 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 152 |
-based on docker.com source material and internal work. |
|
| 153 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 154 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,72 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-import - Create an empty filesystem image and import the contents of the tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then optionally tag it. |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker import** |
|
| 9 |
-[**-c**|**--change**[=*[]*]] |
|
| 10 |
-[**-m**|**--message**[=*MESSAGE*]] |
|
| 11 |
-[**--help**] |
|
| 12 |
-file|URL|**-**[REPOSITORY[:TAG]] |
|
| 13 |
- |
|
| 14 |
-# OPTIONS |
|
| 15 |
-**-c**, **--change**=[] |
|
| 16 |
- Apply specified Dockerfile instructions while importing the image |
|
| 17 |
- Supported Dockerfile instructions: `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` |
|
| 18 |
- |
|
| 19 |
-**--help** |
|
| 20 |
- Print usage statement |
|
| 21 |
- |
|
| 22 |
-**-m**, **--message**="" |
|
| 23 |
- Set commit message for imported image |
|
| 24 |
- |
|
| 25 |
-# DESCRIPTION |
|
| 26 |
-Create a new filesystem image from the contents of a tarball (`.tar`, |
|
| 27 |
-`.tar.gz`, `.tgz`, `.bzip`, `.tar.xz`, `.txz`) into it, then optionally tag it. |
|
| 28 |
- |
|
| 29 |
- |
|
| 30 |
-# EXAMPLES |
|
| 31 |
- |
|
| 32 |
-## Import from a remote location |
|
| 33 |
- |
|
| 34 |
- # docker import http://example.com/exampleimage.tgz example/imagerepo |
|
| 35 |
- |
|
| 36 |
-## Import from a local file |
|
| 37 |
- |
|
| 38 |
-Import to docker via pipe and stdin: |
|
| 39 |
- |
|
| 40 |
- # cat exampleimage.tgz | docker import - example/imagelocal |
|
| 41 |
- |
|
| 42 |
-Import with a commit message. |
|
| 43 |
- |
|
| 44 |
- # cat exampleimage.tgz | docker import --message "New image imported from tarball" - exampleimagelocal:new |
|
| 45 |
- |
|
| 46 |
-Import to a Docker image from a local file. |
|
| 47 |
- |
|
| 48 |
- # docker import /path/to/exampleimage.tgz |
|
| 49 |
- |
|
| 50 |
- |
|
| 51 |
-## Import from a local file and tag |
|
| 52 |
- |
|
| 53 |
-Import to docker via pipe and stdin: |
|
| 54 |
- |
|
| 55 |
- # cat exampleimageV2.tgz | docker import - example/imagelocal:V-2.0 |
|
| 56 |
- |
|
| 57 |
-## Import from a local directory |
|
| 58 |
- |
|
| 59 |
- # tar -c . | docker import - exampleimagedir |
|
| 60 |
- |
|
| 61 |
-## Apply specified Dockerfile instructions while importing the image |
|
| 62 |
-This example sets the docker image ENV variable DEBUG to true by default. |
|
| 63 |
- |
|
| 64 |
- # tar -c . | docker import -c="ENV DEBUG true" - exampleimagedir |
|
| 65 |
- |
|
| 66 |
-# See also |
|
| 67 |
-**docker-export(1)** to export the contents of a filesystem as a tar archive to STDOUT. |
|
| 68 |
- |
|
| 69 |
-# HISTORY |
|
| 70 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 71 |
-based on docker.com source material and internal work. |
|
| 72 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 73 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,187 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-info - Display system-wide information |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker info** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-f**|**--format**[=*FORMAT*]] |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
-This command displays system wide information regarding the Docker installation. |
|
| 14 |
-Information displayed includes the kernel version, number of containers and images. |
|
| 15 |
-The number of images shown is the number of unique images. The same image tagged |
|
| 16 |
-under different names is counted only once. |
|
| 17 |
- |
|
| 18 |
-If a format is specified, the given template will be executed instead of the |
|
| 19 |
-default format. Go's **text/template** package |
|
| 20 |
-describes all the details of the format. |
|
| 21 |
- |
|
| 22 |
-Depending on the storage driver in use, additional information can be shown, such |
|
| 23 |
-as pool name, data file, metadata file, data space used, total data space, metadata |
|
| 24 |
-space used, and total metadata space. |
|
| 25 |
- |
|
| 26 |
-The data file is where the images are stored and the metadata file is where the |
|
| 27 |
-meta data regarding those images are stored. When run for the first time Docker |
|
| 28 |
-allocates a certain amount of data space and meta data space from the space |
|
| 29 |
-available on the volume where `/var/lib/docker` is mounted. |
|
| 30 |
- |
|
| 31 |
-# OPTIONS |
|
| 32 |
-**--help** |
|
| 33 |
- Print usage statement |
|
| 34 |
- |
|
| 35 |
-**-f**, **--format**="" |
|
| 36 |
- Format the output using the given Go template |
|
| 37 |
- |
|
| 38 |
-# EXAMPLES |
|
| 39 |
- |
|
| 40 |
-## Display Docker system information |
|
| 41 |
- |
|
| 42 |
-Here is a sample output for a daemon running on Ubuntu, using the overlay2 |
|
| 43 |
-storage driver: |
|
| 44 |
- |
|
| 45 |
- $ docker -D info |
|
| 46 |
- Containers: 14 |
|
| 47 |
- Running: 3 |
|
| 48 |
- Paused: 1 |
|
| 49 |
- Stopped: 10 |
|
| 50 |
- Images: 52 |
|
| 51 |
- Server Version: 1.13.0 |
|
| 52 |
- Storage Driver: overlay2 |
|
| 53 |
- Backing Filesystem: extfs |
|
| 54 |
- Supports d_type: true |
|
| 55 |
- Native Overlay Diff: false |
|
| 56 |
- Logging Driver: json-file |
|
| 57 |
- Cgroup Driver: cgroupfs |
|
| 58 |
- Plugins: |
|
| 59 |
- Volume: local |
|
| 60 |
- Network: bridge host macvlan null overlay |
|
| 61 |
- Swarm: active |
|
| 62 |
- NodeID: rdjq45w1op418waxlairloqbm |
|
| 63 |
- Is Manager: true |
|
| 64 |
- ClusterID: te8kdyw33n36fqiz74bfjeixd |
|
| 65 |
- Managers: 1 |
|
| 66 |
- Nodes: 2 |
|
| 67 |
- Orchestration: |
|
| 68 |
- Task History Retention Limit: 5 |
|
| 69 |
- Raft: |
|
| 70 |
- Snapshot Interval: 10000 |
|
| 71 |
- Number of Old Snapshots to Retain: 0 |
|
| 72 |
- Heartbeat Tick: 1 |
|
| 73 |
- Election Tick: 3 |
|
| 74 |
- Dispatcher: |
|
| 75 |
- Heartbeat Period: 5 seconds |
|
| 76 |
- CA Configuration: |
|
| 77 |
- Expiry Duration: 3 months |
|
| 78 |
- Node Address: 172.16.66.128 172.16.66.129 |
|
| 79 |
- Manager Addresses: |
|
| 80 |
- 172.16.66.128:2477 |
|
| 81 |
- Runtimes: runc |
|
| 82 |
- Default Runtime: runc |
|
| 83 |
- Init Binary: docker-init |
|
| 84 |
- containerd version: 8517738ba4b82aff5662c97ca4627e7e4d03b531 |
|
| 85 |
- runc version: ac031b5bf1cc92239461125f4c1ffb760522bbf2 |
|
| 86 |
- init version: N/A (expected: v0.13.0) |
|
| 87 |
- Security Options: |
|
| 88 |
- apparmor |
|
| 89 |
- seccomp |
|
| 90 |
- Profile: default |
|
| 91 |
- Kernel Version: 4.4.0-31-generic |
|
| 92 |
- Operating System: Ubuntu 16.04.1 LTS |
|
| 93 |
- OSType: linux |
|
| 94 |
- Architecture: x86_64 |
|
| 95 |
- CPUs: 2 |
|
| 96 |
- Total Memory: 1.937 GiB |
|
| 97 |
- Name: ubuntu |
|
| 98 |
- ID: H52R:7ZR6:EIIA:76JG:ORIY:BVKF:GSFU:HNPG:B5MK:APSC:SZ3Q:N326 |
|
| 99 |
- Docker Root Dir: /var/lib/docker |
|
| 100 |
- Debug Mode (client): true |
|
| 101 |
- Debug Mode (server): true |
|
| 102 |
- File Descriptors: 30 |
|
| 103 |
- Goroutines: 123 |
|
| 104 |
- System Time: 2016-11-12T17:24:37.955404361-08:00 |
|
| 105 |
- EventsListeners: 0 |
|
| 106 |
- Http Proxy: http://test:test@proxy.example.com:8080 |
|
| 107 |
- Https Proxy: https://test:test@proxy.example.com:8080 |
|
| 108 |
- No Proxy: localhost,127.0.0.1,docker-registry.somecorporation.com |
|
| 109 |
- Registry: https://index.docker.io/v1/ |
|
| 110 |
- WARNING: No swap limit support |
|
| 111 |
- Labels: |
|
| 112 |
- storage=ssd |
|
| 113 |
- staging=true |
|
| 114 |
- Experimental: false |
|
| 115 |
- Insecure Registries: |
|
| 116 |
- 127.0.0.0/8 |
|
| 117 |
- Registry Mirrors: |
|
| 118 |
- http://192.168.1.2/ |
|
| 119 |
- http://registry-mirror.example.com:5000/ |
|
| 120 |
- Live Restore Enabled: false |
|
| 121 |
- |
|
| 122 |
- |
|
| 123 |
- |
|
| 124 |
-The global `-D` option tells all `docker` commands to output debug information. |
|
| 125 |
- |
|
| 126 |
-The example below shows the output for a daemon running on Red Hat Enterprise Linux, |
|
| 127 |
-using the devicemapper storage driver. As can be seen in the output, additional |
|
| 128 |
-information about the devicemapper storage driver is shown: |
|
| 129 |
- |
|
| 130 |
- $ docker info |
|
| 131 |
- Containers: 14 |
|
| 132 |
- Running: 3 |
|
| 133 |
- Paused: 1 |
|
| 134 |
- Stopped: 10 |
|
| 135 |
- Untagged Images: 52 |
|
| 136 |
- Server Version: 1.10.3 |
|
| 137 |
- Storage Driver: devicemapper |
|
| 138 |
- Pool Name: docker-202:2-25583803-pool |
|
| 139 |
- Pool Blocksize: 65.54 kB |
|
| 140 |
- Base Device Size: 10.74 GB |
|
| 141 |
- Backing Filesystem: xfs |
|
| 142 |
- Data file: /dev/loop0 |
|
| 143 |
- Metadata file: /dev/loop1 |
|
| 144 |
- Data Space Used: 1.68 GB |
|
| 145 |
- Data Space Total: 107.4 GB |
|
| 146 |
- Data Space Available: 7.548 GB |
|
| 147 |
- Metadata Space Used: 2.322 MB |
|
| 148 |
- Metadata Space Total: 2.147 GB |
|
| 149 |
- Metadata Space Available: 2.145 GB |
|
| 150 |
- Udev Sync Supported: true |
|
| 151 |
- Deferred Removal Enabled: false |
|
| 152 |
- Deferred Deletion Enabled: false |
|
| 153 |
- Deferred Deleted Device Count: 0 |
|
| 154 |
- Data loop file: /var/lib/docker/devicemapper/devicemapper/data |
|
| 155 |
- Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata |
|
| 156 |
- Library Version: 1.02.107-RHEL7 (2015-12-01) |
|
| 157 |
- Execution Driver: native-0.2 |
|
| 158 |
- Logging Driver: json-file |
|
| 159 |
- Plugins: |
|
| 160 |
- Volume: local |
|
| 161 |
- Network: null host bridge |
|
| 162 |
- Kernel Version: 3.10.0-327.el7.x86_64 |
|
| 163 |
- Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo) |
|
| 164 |
- OSType: linux |
|
| 165 |
- Architecture: x86_64 |
|
| 166 |
- CPUs: 1 |
|
| 167 |
- Total Memory: 991.7 MiB |
|
| 168 |
- Name: ip-172-30-0-91.ec2.internal |
|
| 169 |
- ID: I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S |
|
| 170 |
- Docker Root Dir: /var/lib/docker |
|
| 171 |
- Debug mode (client): false |
|
| 172 |
- Debug mode (server): false |
|
| 173 |
- Username: gordontheturtle |
|
| 174 |
- Registry: https://index.docker.io/v1/ |
|
| 175 |
- Insecure registries: |
|
| 176 |
- myinsecurehost:5000 |
|
| 177 |
- 127.0.0.0/8 |
|
| 178 |
- |
|
| 179 |
-You can also specify the output format: |
|
| 180 |
- |
|
| 181 |
- $ docker info --format '{{json .}}'
|
|
| 182 |
- {"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...}
|
|
| 183 |
- |
|
| 184 |
-# HISTORY |
|
| 185 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 186 |
-based on docker.com source material and internal work. |
|
| 187 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 188 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,323 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-inspect - Return low-level information on docker objects |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker inspect** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-f**|**--format**[=*FORMAT*]] |
|
| 11 |
-[**-s**|**--size**] |
|
| 12 |
-[**--type**=*container*|*image*|*network*|*node*|*service*|*task*|*volume*] |
|
| 13 |
-NAME|ID [NAME|ID...] |
|
| 14 |
- |
|
| 15 |
-# DESCRIPTION |
|
| 16 |
- |
|
| 17 |
-This displays the low-level information on Docker object(s) (e.g. container, |
|
| 18 |
-image, volume,network, node, service, or task) identified by name or ID. By default, |
|
| 19 |
-this will render all results in a JSON array. If the container and image have |
|
| 20 |
-the same name, this will return container JSON for unspecified type. If a format |
|
| 21 |
-is specified, the given template will be executed for each result. |
|
| 22 |
- |
|
| 23 |
-# OPTIONS |
|
| 24 |
-**--help** |
|
| 25 |
- Print usage statement |
|
| 26 |
- |
|
| 27 |
-**-f**, **--format**="" |
|
| 28 |
- Format the output using the given Go template |
|
| 29 |
- |
|
| 30 |
-**-s**, **--size** |
|
| 31 |
- Display total file sizes if the type is container |
|
| 32 |
- |
|
| 33 |
-**--type**=*container*|*image*|*network*|*node*|*service*|*task*|*volume* |
|
| 34 |
- Return JSON for specified type, permissible values are "image", "container", |
|
| 35 |
- "network", "node", "service", "task", and "volume" |
|
| 36 |
- |
|
| 37 |
-# EXAMPLES |
|
| 38 |
- |
|
| 39 |
-Get information about an image when image name conflicts with the container name, |
|
| 40 |
-e.g. both image and container are named rhel7: |
|
| 41 |
- |
|
| 42 |
- $ docker inspect --type=image rhel7 |
|
| 43 |
- [ |
|
| 44 |
- {
|
|
| 45 |
- "Id": "fe01a428b9d9de35d29531e9994157978e8c48fa693e1bf1d221dffbbb67b170", |
|
| 46 |
- "Parent": "10acc31def5d6f249b548e01e8ffbaccfd61af0240c17315a7ad393d022c5ca2", |
|
| 47 |
- .... |
|
| 48 |
- } |
|
| 49 |
- ] |
|
| 50 |
- |
|
| 51 |
-## Getting information on a container |
|
| 52 |
- |
|
| 53 |
-To get information on a container use its ID or instance name: |
|
| 54 |
- |
|
| 55 |
- $ docker inspect d2cc496561d6 |
|
| 56 |
- [{
|
|
| 57 |
- "Id": "d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47", |
|
| 58 |
- "Created": "2015-06-08T16:18:02.505155285Z", |
|
| 59 |
- "Path": "bash", |
|
| 60 |
- "Args": [], |
|
| 61 |
- "State": {
|
|
| 62 |
- "Running": false, |
|
| 63 |
- "Paused": false, |
|
| 64 |
- "Restarting": false, |
|
| 65 |
- "OOMKilled": false, |
|
| 66 |
- "Dead": false, |
|
| 67 |
- "Pid": 0, |
|
| 68 |
- "ExitCode": 0, |
|
| 69 |
- "Error": "", |
|
| 70 |
- "StartedAt": "2015-06-08T16:18:03.643865954Z", |
|
| 71 |
- "FinishedAt": "2015-06-08T16:57:06.448552862Z" |
|
| 72 |
- }, |
|
| 73 |
- "Image": "ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", |
|
| 74 |
- "NetworkSettings": {
|
|
| 75 |
- "Bridge": "", |
|
| 76 |
- "SandboxID": "6b4851d1903e16dd6a567bd526553a86664361f31036eaaa2f8454d6f4611f6f", |
|
| 77 |
- "HairpinMode": false, |
|
| 78 |
- "LinkLocalIPv6Address": "", |
|
| 79 |
- "LinkLocalIPv6PrefixLen": 0, |
|
| 80 |
- "Ports": {},
|
|
| 81 |
- "SandboxKey": "/var/run/docker/netns/6b4851d1903e", |
|
| 82 |
- "SecondaryIPAddresses": null, |
|
| 83 |
- "SecondaryIPv6Addresses": null, |
|
| 84 |
- "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", |
|
| 85 |
- "Gateway": "172.17.0.1", |
|
| 86 |
- "GlobalIPv6Address": "", |
|
| 87 |
- "GlobalIPv6PrefixLen": 0, |
|
| 88 |
- "IPAddress": "172.17.0.2", |
|
| 89 |
- "IPPrefixLen": 16, |
|
| 90 |
- "IPv6Gateway": "", |
|
| 91 |
- "MacAddress": "02:42:ac:12:00:02", |
|
| 92 |
- "Networks": {
|
|
| 93 |
- "bridge": {
|
|
| 94 |
- "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", |
|
| 95 |
- "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", |
|
| 96 |
- "Gateway": "172.17.0.1", |
|
| 97 |
- "IPAddress": "172.17.0.2", |
|
| 98 |
- "IPPrefixLen": 16, |
|
| 99 |
- "IPv6Gateway": "", |
|
| 100 |
- "GlobalIPv6Address": "", |
|
| 101 |
- "GlobalIPv6PrefixLen": 0, |
|
| 102 |
- "MacAddress": "02:42:ac:12:00:02" |
|
| 103 |
- } |
|
| 104 |
- } |
|
| 105 |
- |
|
| 106 |
- }, |
|
| 107 |
- "ResolvConfPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/resolv.conf", |
|
| 108 |
- "HostnamePath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hostname", |
|
| 109 |
- "HostsPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hosts", |
|
| 110 |
- "LogPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47-json.log", |
|
| 111 |
- "Name": "/adoring_wozniak", |
|
| 112 |
- "RestartCount": 0, |
|
| 113 |
- "Driver": "devicemapper", |
|
| 114 |
- "MountLabel": "", |
|
| 115 |
- "ProcessLabel": "", |
|
| 116 |
- "Mounts": [ |
|
| 117 |
- {
|
|
| 118 |
- "Source": "/data", |
|
| 119 |
- "Destination": "/data", |
|
| 120 |
- "Mode": "ro,Z", |
|
| 121 |
- "RW": false |
|
| 122 |
- "Propagation": "" |
|
| 123 |
- } |
|
| 124 |
- ], |
|
| 125 |
- "AppArmorProfile": "", |
|
| 126 |
- "ExecIDs": null, |
|
| 127 |
- "HostConfig": {
|
|
| 128 |
- "Binds": null, |
|
| 129 |
- "ContainerIDFile": "", |
|
| 130 |
- "Memory": 0, |
|
| 131 |
- "MemorySwap": 0, |
|
| 132 |
- "CpuShares": 0, |
|
| 133 |
- "CpuPeriod": 0, |
|
| 134 |
- "CpusetCpus": "", |
|
| 135 |
- "CpusetMems": "", |
|
| 136 |
- "CpuQuota": 0, |
|
| 137 |
- "BlkioWeight": 0, |
|
| 138 |
- "OomKillDisable": false, |
|
| 139 |
- "Privileged": false, |
|
| 140 |
- "PortBindings": {},
|
|
| 141 |
- "Links": null, |
|
| 142 |
- "PublishAllPorts": false, |
|
| 143 |
- "Dns": null, |
|
| 144 |
- "DnsSearch": null, |
|
| 145 |
- "DnsOptions": null, |
|
| 146 |
- "ExtraHosts": null, |
|
| 147 |
- "VolumesFrom": null, |
|
| 148 |
- "Devices": [], |
|
| 149 |
- "NetworkMode": "bridge", |
|
| 150 |
- "IpcMode": "", |
|
| 151 |
- "PidMode": "", |
|
| 152 |
- "UTSMode": "", |
|
| 153 |
- "CapAdd": null, |
|
| 154 |
- "CapDrop": null, |
|
| 155 |
- "RestartPolicy": {
|
|
| 156 |
- "Name": "no", |
|
| 157 |
- "MaximumRetryCount": 0 |
|
| 158 |
- }, |
|
| 159 |
- "SecurityOpt": null, |
|
| 160 |
- "ReadonlyRootfs": false, |
|
| 161 |
- "Ulimits": null, |
|
| 162 |
- "LogConfig": {
|
|
| 163 |
- "Type": "json-file", |
|
| 164 |
- "Config": {}
|
|
| 165 |
- }, |
|
| 166 |
- "CgroupParent": "" |
|
| 167 |
- }, |
|
| 168 |
- "GraphDriver": {
|
|
| 169 |
- "Name": "devicemapper", |
|
| 170 |
- "Data": {
|
|
| 171 |
- "DeviceId": "5", |
|
| 172 |
- "DeviceName": "docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47", |
|
| 173 |
- "DeviceSize": "171798691840" |
|
| 174 |
- } |
|
| 175 |
- }, |
|
| 176 |
- "Config": {
|
|
| 177 |
- "Hostname": "d2cc496561d6", |
|
| 178 |
- "Domainname": "", |
|
| 179 |
- "User": "", |
|
| 180 |
- "AttachStdin": true, |
|
| 181 |
- "AttachStdout": true, |
|
| 182 |
- "AttachStderr": true, |
|
| 183 |
- "ExposedPorts": null, |
|
| 184 |
- "Tty": true, |
|
| 185 |
- "OpenStdin": true, |
|
| 186 |
- "StdinOnce": true, |
|
| 187 |
- "Env": null, |
|
| 188 |
- "Cmd": [ |
|
| 189 |
- "bash" |
|
| 190 |
- ], |
|
| 191 |
- "Image": "fedora", |
|
| 192 |
- "Volumes": null, |
|
| 193 |
- "VolumeDriver": "", |
|
| 194 |
- "WorkingDir": "", |
|
| 195 |
- "Entrypoint": null, |
|
| 196 |
- "NetworkDisabled": false, |
|
| 197 |
- "MacAddress": "", |
|
| 198 |
- "OnBuild": null, |
|
| 199 |
- "Labels": {},
|
|
| 200 |
- "Memory": 0, |
|
| 201 |
- "MemorySwap": 0, |
|
| 202 |
- "CpuShares": 0, |
|
| 203 |
- "Cpuset": "", |
|
| 204 |
- "StopSignal": "SIGTERM" |
|
| 205 |
- } |
|
| 206 |
- } |
|
| 207 |
- ] |
|
| 208 |
-## Getting the IP address of a container instance |
|
| 209 |
- |
|
| 210 |
-To get the IP address of a container use: |
|
| 211 |
- |
|
| 212 |
- $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' d2cc496561d6
|
|
| 213 |
- 172.17.0.2 |
|
| 214 |
- |
|
| 215 |
-## Listing all port bindings |
|
| 216 |
- |
|
| 217 |
-One can loop over arrays and maps in the results to produce simple text |
|
| 218 |
-output: |
|
| 219 |
- |
|
| 220 |
- $ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} \
|
|
| 221 |
- {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' d2cc496561d6
|
|
| 222 |
- 80/tcp -> 80 |
|
| 223 |
- |
|
| 224 |
-You can get more information about how to write a Go template from: |
|
| 225 |
-https://golang.org/pkg/text/template/. |
|
| 226 |
- |
|
| 227 |
-## Getting size information on a container |
|
| 228 |
- |
|
| 229 |
- $ docker inspect -s d2cc496561d6 |
|
| 230 |
- [ |
|
| 231 |
- {
|
|
| 232 |
- .... |
|
| 233 |
- "SizeRw": 0, |
|
| 234 |
- "SizeRootFs": 972, |
|
| 235 |
- .... |
|
| 236 |
- } |
|
| 237 |
- ] |
|
| 238 |
- |
|
| 239 |
-## Getting information on an image |
|
| 240 |
- |
|
| 241 |
-Use an image's ID or name (e.g., repository/name[:tag]) to get information |
|
| 242 |
-about the image: |
|
| 243 |
- |
|
| 244 |
- $ docker inspect ded7cd95e059 |
|
| 245 |
- [{
|
|
| 246 |
- "Id": "ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", |
|
| 247 |
- "Parent": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731", |
|
| 248 |
- "Comment": "", |
|
| 249 |
- "Created": "2015-05-27T16:58:22.937503085Z", |
|
| 250 |
- "Container": "76cf7f67d83a7a047454b33007d03e32a8f474ad332c3a03c94537edd22b312b", |
|
| 251 |
- "ContainerConfig": {
|
|
| 252 |
- "Hostname": "76cf7f67d83a", |
|
| 253 |
- "Domainname": "", |
|
| 254 |
- "User": "", |
|
| 255 |
- "AttachStdin": false, |
|
| 256 |
- "AttachStdout": false, |
|
| 257 |
- "AttachStderr": false, |
|
| 258 |
- "ExposedPorts": null, |
|
| 259 |
- "Tty": false, |
|
| 260 |
- "OpenStdin": false, |
|
| 261 |
- "StdinOnce": false, |
|
| 262 |
- "Env": null, |
|
| 263 |
- "Cmd": [ |
|
| 264 |
- "/bin/sh", |
|
| 265 |
- "-c", |
|
| 266 |
- "#(nop) ADD file:4be46382bcf2b095fcb9fe8334206b584eff60bb3fad8178cbd97697fcb2ea83 in /" |
|
| 267 |
- ], |
|
| 268 |
- "Image": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731", |
|
| 269 |
- "Volumes": null, |
|
| 270 |
- "VolumeDriver": "", |
|
| 271 |
- "WorkingDir": "", |
|
| 272 |
- "Entrypoint": null, |
|
| 273 |
- "NetworkDisabled": false, |
|
| 274 |
- "MacAddress": "", |
|
| 275 |
- "OnBuild": null, |
|
| 276 |
- "Labels": {}
|
|
| 277 |
- }, |
|
| 278 |
- "DockerVersion": "1.6.0", |
|
| 279 |
- "Author": "Lokesh Mandvekar \u003clsm5@fedoraproject.org\u003e", |
|
| 280 |
- "Config": {
|
|
| 281 |
- "Hostname": "76cf7f67d83a", |
|
| 282 |
- "Domainname": "", |
|
| 283 |
- "User": "", |
|
| 284 |
- "AttachStdin": false, |
|
| 285 |
- "AttachStdout": false, |
|
| 286 |
- "AttachStderr": false, |
|
| 287 |
- "ExposedPorts": null, |
|
| 288 |
- "Tty": false, |
|
| 289 |
- "OpenStdin": false, |
|
| 290 |
- "StdinOnce": false, |
|
| 291 |
- "Env": null, |
|
| 292 |
- "Cmd": null, |
|
| 293 |
- "Image": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731", |
|
| 294 |
- "Volumes": null, |
|
| 295 |
- "VolumeDriver": "", |
|
| 296 |
- "WorkingDir": "", |
|
| 297 |
- "Entrypoint": null, |
|
| 298 |
- "NetworkDisabled": false, |
|
| 299 |
- "MacAddress": "", |
|
| 300 |
- "OnBuild": null, |
|
| 301 |
- "Labels": {}
|
|
| 302 |
- }, |
|
| 303 |
- "Architecture": "amd64", |
|
| 304 |
- "Os": "linux", |
|
| 305 |
- "Size": 186507296, |
|
| 306 |
- "VirtualSize": 186507296, |
|
| 307 |
- "GraphDriver": {
|
|
| 308 |
- "Name": "devicemapper", |
|
| 309 |
- "Data": {
|
|
| 310 |
- "DeviceId": "3", |
|
| 311 |
- "DeviceName": "docker-253:1-2763198-ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", |
|
| 312 |
- "DeviceSize": "171798691840" |
|
| 313 |
- } |
|
| 314 |
- } |
|
| 315 |
- } |
|
| 316 |
- ] |
|
| 317 |
- |
|
| 318 |
-# HISTORY |
|
| 319 |
-April 2014, originally compiled by William Henry (whenry at redhat dot com) |
|
| 320 |
-based on docker.com source material and internal work. |
|
| 321 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 322 |
-April 2015, updated by Qiang Huang <h.huangqiang@huawei.com> |
|
| 323 |
-October 2015, updated by Sally O'Malley <somalley@redhat.com> |
| 324 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,28 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-kill - Kill a running container using SIGKILL or a specified signal |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker kill** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-s**|**--signal**[=*"KILL"*]] |
|
| 11 |
-CONTAINER [CONTAINER...] |
|
| 12 |
- |
|
| 13 |
-# DESCRIPTION |
|
| 14 |
- |
|
| 15 |
-The main process inside each container specified will be sent SIGKILL, |
|
| 16 |
- or any signal specified with option --signal. |
|
| 17 |
- |
|
| 18 |
-# OPTIONS |
|
| 19 |
-**--help** |
|
| 20 |
- Print usage statement |
|
| 21 |
- |
|
| 22 |
-**-s**, **--signal**="*KILL*" |
|
| 23 |
- Signal to send to the container |
|
| 24 |
- |
|
| 25 |
-# HISTORY |
|
| 26 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 27 |
- based on docker.com source material and internal work. |
|
| 28 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 29 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,56 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-load - Load an image from a tar archive or STDIN |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker load** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-i**|**--input**[=*INPUT*]] |
|
| 11 |
-[**-q**|**--quiet**] |
|
| 12 |
- |
|
| 13 |
-# DESCRIPTION |
|
| 14 |
- |
|
| 15 |
-Loads a tarred repository from a file or the standard input stream. |
|
| 16 |
-Restores both images and tags. Write image names or IDs imported it |
|
| 17 |
-standard output stream. |
|
| 18 |
- |
|
| 19 |
-# OPTIONS |
|
| 20 |
-**--help** |
|
| 21 |
- Print usage statement |
|
| 22 |
- |
|
| 23 |
-**-i**, **--input**="" |
|
| 24 |
- Read from a tar archive file, instead of STDIN. The tarball may be compressed with gzip, bzip, or xz. |
|
| 25 |
- |
|
| 26 |
-**-q**, **--quiet** |
|
| 27 |
- Suppress the load progress bar but still outputs the imported images. |
|
| 28 |
- |
|
| 29 |
-# EXAMPLES |
|
| 30 |
- |
|
| 31 |
- $ docker images |
|
| 32 |
- REPOSITORY TAG IMAGE ID CREATED SIZE |
|
| 33 |
- busybox latest 769b9341d937 7 weeks ago 2.489 MB |
|
| 34 |
- $ docker load --input fedora.tar |
|
| 35 |
- # […] |
|
| 36 |
- Loaded image: fedora:rawhide |
|
| 37 |
- # […] |
|
| 38 |
- Loaded image: fedora:20 |
|
| 39 |
- # […] |
|
| 40 |
- $ docker images |
|
| 41 |
- REPOSITORY TAG IMAGE ID CREATED SIZE |
|
| 42 |
- busybox latest 769b9341d937 7 weeks ago 2.489 MB |
|
| 43 |
- fedora rawhide 0d20aec6529d 7 weeks ago 387 MB |
|
| 44 |
- fedora 20 58394af37342 7 weeks ago 385.5 MB |
|
| 45 |
- fedora heisenbug 58394af37342 7 weeks ago 385.5 MB |
|
| 46 |
- fedora latest 58394af37342 7 weeks ago 385.5 MB |
|
| 47 |
- |
|
| 48 |
-# See also |
|
| 49 |
-**docker-save(1)** to save one or more images to a tar archive (streamed to STDOUT by default). |
|
| 50 |
- |
|
| 51 |
-# HISTORY |
|
| 52 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 53 |
-based on docker.com source material and internal work. |
|
| 54 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 55 |
-July 2015 update by Mary Anthony <mary@docker.com> |
|
| 56 |
-June 2016 update by Vincent Demeester <vincent@sbr.pm> |
| 57 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,53 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-login - Log in to a Docker registry. |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker login** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-p**|**--password**[=*PASSWORD*]] |
|
| 11 |
-[**-u**|**--username**[=*USERNAME*]] |
|
| 12 |
-[SERVER] |
|
| 13 |
- |
|
| 14 |
-# DESCRIPTION |
|
| 15 |
-Log in to a Docker Registry located on the specified |
|
| 16 |
-`SERVER`. You can specify a URL or a `hostname` for the `SERVER` value. If you |
|
| 17 |
-do not specify a `SERVER`, the command uses Docker's public registry located at |
|
| 18 |
-`https://registry-1.docker.io/` by default. To get a username/password for Docker's public registry, create an account on Docker Hub. |
|
| 19 |
- |
|
| 20 |
-`docker login` requires user to use `sudo` or be `root`, except when: |
|
| 21 |
- |
|
| 22 |
-1. connecting to a remote daemon, such as a `docker-machine` provisioned `docker engine`. |
|
| 23 |
-2. user is added to the `docker` group. This will impact the security of your system; the `docker` group is `root` equivalent. See [Docker Daemon Attack Surface](https://docs.docker.com/engine/articles/security/#docker-daemon-attack-surface) for details. |
|
| 24 |
- |
|
| 25 |
-You can log into any public or private repository for which you have |
|
| 26 |
-credentials. When you log in, the command stores encoded credentials in |
|
| 27 |
-`$HOME/.docker/config.json` on Linux or `%USERPROFILE%/.docker/config.json` on Windows. |
|
| 28 |
- |
|
| 29 |
-# OPTIONS |
|
| 30 |
-**--help** |
|
| 31 |
- Print usage statement |
|
| 32 |
- |
|
| 33 |
-**-p**, **--password**="" |
|
| 34 |
- Password |
|
| 35 |
- |
|
| 36 |
-**-u**, **--username**="" |
|
| 37 |
- Username |
|
| 38 |
- |
|
| 39 |
-# EXAMPLES |
|
| 40 |
- |
|
| 41 |
-## Login to a registry on your localhost |
|
| 42 |
- |
|
| 43 |
- # docker login localhost:8080 |
|
| 44 |
- |
|
| 45 |
-# See also |
|
| 46 |
-**docker-logout(1)** to log out from a Docker registry. |
|
| 47 |
- |
|
| 48 |
-# HISTORY |
|
| 49 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 50 |
-based on docker.com source material and internal work. |
|
| 51 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 52 |
-April 2015, updated by Mary Anthony for v2 <mary@docker.com> |
|
| 53 |
-November 2015, updated by Sally O'Malley <somalley@redhat.com> |
| 54 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,32 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-logout - Log out from a Docker registry. |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker logout** |
|
| 9 |
-[SERVER] |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
-Log out of a Docker Registry located on the specified `SERVER`. You can |
|
| 13 |
-specify a URL or a `hostname` for the `SERVER` value. If you do not specify a |
|
| 14 |
-`SERVER`, the command attempts to log you out of Docker's public registry |
|
| 15 |
-located at `https://registry-1.docker.io/` by default. |
|
| 16 |
- |
|
| 17 |
-# OPTIONS |
|
| 18 |
-There are no available options. |
|
| 19 |
- |
|
| 20 |
-# EXAMPLES |
|
| 21 |
- |
|
| 22 |
-## Log out from a registry on your localhost |
|
| 23 |
- |
|
| 24 |
- # docker logout localhost:8080 |
|
| 25 |
- |
|
| 26 |
-# See also |
|
| 27 |
-**docker-login(1)** to log in to a Docker registry server. |
|
| 28 |
- |
|
| 29 |
-# HISTORY |
|
| 30 |
-June 2014, Originally compiled by Daniel, Dao Quang Minh (daniel at nitrous dot io) |
|
| 31 |
-July 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 32 |
-April 2015, updated by Mary Anthony for v2 <mary@docker.com> |
| 33 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,71 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-logs - Fetch the logs of a container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker logs** |
|
| 9 |
-[**-f**|**--follow**] |
|
| 10 |
-[**--help**] |
|
| 11 |
-[**--since**[=*SINCE*]] |
|
| 12 |
-[**-t**|**--timestamps**] |
|
| 13 |
-[**--tail**[=*"all"*]] |
|
| 14 |
-CONTAINER |
|
| 15 |
- |
|
| 16 |
-# DESCRIPTION |
|
| 17 |
-The **docker logs** command batch-retrieves whatever logs are present for |
|
| 18 |
-a container at the time of execution. This does not guarantee execution |
|
| 19 |
-order when combined with a docker run (i.e., your run may not have generated |
|
| 20 |
-any logs at the time you execute docker logs). |
|
| 21 |
- |
|
| 22 |
-The **docker logs --follow** command combines commands **docker logs** and |
|
| 23 |
-**docker attach**. It will first return all logs from the beginning and |
|
| 24 |
-then continue streaming new output from the container's stdout and stderr. |
|
| 25 |
- |
|
| 26 |
-**Warning**: This command works only for the **json-file** or **journald** |
|
| 27 |
-logging drivers. |
|
| 28 |
- |
|
| 29 |
-# OPTIONS |
|
| 30 |
-**--help** |
|
| 31 |
- Print usage statement |
|
| 32 |
- |
|
| 33 |
-**--details**=*true*|*false* |
|
| 34 |
- Show extra details provided to logs |
|
| 35 |
- |
|
| 36 |
-**-f**, **--follow**=*true*|*false* |
|
| 37 |
- Follow log output. The default is *false*. |
|
| 38 |
- |
|
| 39 |
-**--since**="" |
|
| 40 |
- Show logs since timestamp |
|
| 41 |
- |
|
| 42 |
-**-t**, **--timestamps**=*true*|*false* |
|
| 43 |
- Show timestamps. The default is *false*. |
|
| 44 |
- |
|
| 45 |
-**--tail**="*all*" |
|
| 46 |
- Output the specified number of lines at the end of logs (defaults to all logs) |
|
| 47 |
- |
|
| 48 |
-The `--since` option can be Unix timestamps, date formatted timestamps, or Go |
|
| 49 |
-duration strings (e.g. `10m`, `1h30m`) computed relative to the client machine's |
|
| 50 |
-time. Supported formats for date formatted time stamps include RFC3339Nano, |
|
| 51 |
-RFC3339, `2006-01-02T15:04:05`, `2006-01-02T15:04:05.999999999`, |
|
| 52 |
-`2006-01-02Z07:00`, and `2006-01-02`. The local timezone on the client will be |
|
| 53 |
-used if you do not provide either a `Z` or a `+-00:00` timezone offset at the |
|
| 54 |
-end of the timestamp. When providing Unix timestamps enter |
|
| 55 |
-seconds[.nanoseconds], where seconds is the number of seconds that have elapsed |
|
| 56 |
-since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (aka Unix |
|
| 57 |
-epoch or Unix time), and the optional .nanoseconds field is a fraction of a |
|
| 58 |
-second no more than nine digits long. You can combine the `--since` option with |
|
| 59 |
-either or both of the `--follow` or `--tail` options. |
|
| 60 |
- |
|
| 61 |
-The `docker logs --details` command will add on extra attributes, such as |
|
| 62 |
-environment variables and labels, provided to `--log-opt` when creating the |
|
| 63 |
-container. |
|
| 64 |
- |
|
| 65 |
-# HISTORY |
|
| 66 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 67 |
-based on docker.com source material and internal work. |
|
| 68 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 69 |
-July 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 70 |
-April 2015, updated by Ahmet Alp Balkan <ahmetalpbalkan@gmail.com> |
|
| 71 |
-October 2015, updated by Mike Brown <mikebrow@gmail.com> |
| 72 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,66 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% OCT 2015 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-network-connect - connect a container to a network |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker network connect** |
|
| 9 |
-[**--help**] |
|
| 10 |
-NETWORK CONTAINER |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
- |
|
| 14 |
-Connects a container to a network. You can connect a container by name |
|
| 15 |
-or by ID. Once connected, the container can communicate with other containers in |
|
| 16 |
-the same network. |
|
| 17 |
- |
|
| 18 |
-```bash |
|
| 19 |
-$ docker network connect multi-host-network container1 |
|
| 20 |
-``` |
|
| 21 |
- |
|
| 22 |
-You can also use the `docker run --network=<network-name>` option to start a container and immediately connect it to a network. |
|
| 23 |
- |
|
| 24 |
-```bash |
|
| 25 |
-$ docker run -itd --network=multi-host-network --ip 172.20.88.22 --ip6 2001:db8::8822 busybox |
|
| 26 |
-``` |
|
| 27 |
-You can pause, restart, and stop containers that are connected to a network. |
|
| 28 |
-A container connects to its configured networks when it runs. |
|
| 29 |
- |
|
| 30 |
-If specified, the container's IP address(es) is reapplied when a stopped |
|
| 31 |
-container is restarted. If the IP address is no longer available, the container |
|
| 32 |
-fails to start. One way to guarantee that the IP address is available is |
|
| 33 |
-to specify an `--ip-range` when creating the network, and choose the static IP |
|
| 34 |
-address(es) from outside that range. This ensures that the IP address is not |
|
| 35 |
-given to another container while this container is not on the network. |
|
| 36 |
- |
|
| 37 |
-```bash |
|
| 38 |
-$ docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 multi-host-network |
|
| 39 |
-``` |
|
| 40 |
- |
|
| 41 |
-```bash |
|
| 42 |
-$ docker network connect --ip 172.20.128.2 multi-host-network container2 |
|
| 43 |
-``` |
|
| 44 |
- |
|
| 45 |
-To verify the container is connected, use the `docker network inspect` command. Use `docker network disconnect` to remove a container from the network. |
|
| 46 |
- |
|
| 47 |
-Once connected in network, containers can communicate using only another |
|
| 48 |
-container's IP address or name. For `overlay` networks or custom plugins that |
|
| 49 |
-support multi-host connectivity, containers connected to the same multi-host |
|
| 50 |
-network but launched from different Engines can also communicate in this way. |
|
| 51 |
- |
|
| 52 |
-You can connect a container to one or more networks. The networks need not be the same type. For example, you can connect a single container bridge and overlay networks. |
|
| 53 |
- |
|
| 54 |
- |
|
| 55 |
-# OPTIONS |
|
| 56 |
-**NETWORK** |
|
| 57 |
- Specify network name |
|
| 58 |
- |
|
| 59 |
-**CONTAINER** |
|
| 60 |
- Specify container name |
|
| 61 |
- |
|
| 62 |
-**--help** |
|
| 63 |
- Print usage statement |
|
| 64 |
- |
|
| 65 |
-# HISTORY |
|
| 66 |
-OCT 2015, created by Mary Anthony <mary@docker.com> |
| 67 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,187 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% OCT 2015 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-network-create - create a new network |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker network create** |
|
| 9 |
-[**--attachable**] |
|
| 10 |
-[**--aux-address**=*map[]*] |
|
| 11 |
-[**-d**|**--driver**=*DRIVER*] |
|
| 12 |
-[**--gateway**=*[]*] |
|
| 13 |
-[**--help**] |
|
| 14 |
-[**--internal**] |
|
| 15 |
-[**--ip-range**=*[]*] |
|
| 16 |
-[**--ipam-driver**=*default*] |
|
| 17 |
-[**--ipam-opt**=*map[]*] |
|
| 18 |
-[**--ipv6**] |
|
| 19 |
-[**--label**[=*[]*]] |
|
| 20 |
-[**-o**|**--opt**=*map[]*] |
|
| 21 |
-[**--subnet**=*[]*] |
|
| 22 |
-NETWORK-NAME |
|
| 23 |
- |
|
| 24 |
-# DESCRIPTION |
|
| 25 |
- |
|
| 26 |
-Creates a new network. The `DRIVER` accepts `bridge` or `overlay` which are the |
|
| 27 |
-built-in network drivers. If you have installed a third party or your own custom |
|
| 28 |
-network driver you can specify that `DRIVER` here also. If you don't specify the |
|
| 29 |
-`--driver` option, the command automatically creates a `bridge` network for you. |
|
| 30 |
-When you install Docker Engine it creates a `bridge` network automatically. This |
|
| 31 |
-network corresponds to the `docker0` bridge that Engine has traditionally relied |
|
| 32 |
-on. When launch a new container with `docker run` it automatically connects to |
|
| 33 |
-this bridge network. You cannot remove this default bridge network but you can |
|
| 34 |
-create new ones using the `network create` command. |
|
| 35 |
- |
|
| 36 |
-```bash |
|
| 37 |
-$ docker network create -d bridge my-bridge-network |
|
| 38 |
-``` |
|
| 39 |
- |
|
| 40 |
-Bridge networks are isolated networks on a single Engine installation. If you |
|
| 41 |
-want to create a network that spans multiple Docker hosts each running an |
|
| 42 |
-Engine, you must create an `overlay` network. Unlike `bridge` networks overlay |
|
| 43 |
-networks require some pre-existing conditions before you can create one. These |
|
| 44 |
-conditions are: |
|
| 45 |
- |
|
| 46 |
-* Access to a key-value store. Engine supports Consul, Etcd, and Zookeeper (Distributed store) key-value stores. |
|
| 47 |
-* A cluster of hosts with connectivity to the key-value store. |
|
| 48 |
-* A properly configured Engine `daemon` on each host in the cluster. |
|
| 49 |
- |
|
| 50 |
-The `dockerd` options that support the `overlay` network are: |
|
| 51 |
- |
|
| 52 |
-* `--cluster-store` |
|
| 53 |
-* `--cluster-store-opt` |
|
| 54 |
-* `--cluster-advertise` |
|
| 55 |
- |
|
| 56 |
-To read more about these options and how to configure them, see ["*Get started |
|
| 57 |
-with multi-host |
|
| 58 |
-network*"](https://docs.docker.com/engine/userguide/networking/get-started-overlay/). |
|
| 59 |
- |
|
| 60 |
-It is also a good idea, though not required, that you install Docker Swarm on to |
|
| 61 |
-manage the cluster that makes up your network. Swarm provides sophisticated |
|
| 62 |
-discovery and server management that can assist your implementation. |
|
| 63 |
- |
|
| 64 |
-Once you have prepared the `overlay` network prerequisites you simply choose a |
|
| 65 |
-Docker host in the cluster and issue the following to create the network: |
|
| 66 |
- |
|
| 67 |
-```bash |
|
| 68 |
-$ docker network create -d overlay my-multihost-network |
|
| 69 |
-``` |
|
| 70 |
- |
|
| 71 |
-Network names must be unique. The Docker daemon attempts to identify naming |
|
| 72 |
-conflicts but this is not guaranteed. It is the user's responsibility to avoid |
|
| 73 |
-name conflicts. |
|
| 74 |
- |
|
| 75 |
-## Connect containers |
|
| 76 |
- |
|
| 77 |
-When you start a container use the `--network` flag to connect it to a network. |
|
| 78 |
-This adds the `busybox` container to the `mynet` network. |
|
| 79 |
- |
|
| 80 |
-```bash |
|
| 81 |
-$ docker run -itd --network=mynet busybox |
|
| 82 |
-``` |
|
| 83 |
- |
|
| 84 |
-If you want to add a container to a network after the container is already |
|
| 85 |
-running use the `docker network connect` subcommand. |
|
| 86 |
- |
|
| 87 |
-You can connect multiple containers to the same network. Once connected, the |
|
| 88 |
-containers can communicate using only another container's IP address or name. |
|
| 89 |
-For `overlay` networks or custom plugins that support multi-host connectivity, |
|
| 90 |
-containers connected to the same multi-host network but launched from different |
|
| 91 |
-Engines can also communicate in this way. |
|
| 92 |
- |
|
| 93 |
-You can disconnect a container from a network using the `docker network |
|
| 94 |
-disconnect` command. |
|
| 95 |
- |
|
| 96 |
-## Specifying advanced options |
|
| 97 |
- |
|
| 98 |
-When you create a network, Engine creates a non-overlapping subnetwork for the |
|
| 99 |
-network by default. This subnetwork is not a subdivision of an existing network. |
|
| 100 |
-It is purely for ip-addressing purposes. You can override this default and |
|
| 101 |
-specify subnetwork values directly using the `--subnet` option. On a |
|
| 102 |
-`bridge` network you can only create a single subnet: |
|
| 103 |
- |
|
| 104 |
-```bash |
|
| 105 |
-$ docker network create -d bridge --subnet=192.168.0.0/16 br0 |
|
| 106 |
-``` |
|
| 107 |
- |
|
| 108 |
-Additionally, you also specify the `--gateway` `--ip-range` and `--aux-address` |
|
| 109 |
-options. |
|
| 110 |
- |
|
| 111 |
-```bash |
|
| 112 |
-$ docker network create \ |
|
| 113 |
- --driver=bridge \ |
|
| 114 |
- --subnet=172.28.0.0/16 \ |
|
| 115 |
- --ip-range=172.28.5.0/24 \ |
|
| 116 |
- --gateway=172.28.5.254 \ |
|
| 117 |
- br0 |
|
| 118 |
-``` |
|
| 119 |
- |
|
| 120 |
-If you omit the `--gateway` flag the Engine selects one for you from inside a |
|
| 121 |
-preferred pool. For `overlay` networks and for network driver plugins that |
|
| 122 |
-support it you can create multiple subnetworks. |
|
| 123 |
- |
|
| 124 |
-```bash |
|
| 125 |
-$ docker network create -d overlay \ |
|
| 126 |
- --subnet=192.168.0.0/16 \ |
|
| 127 |
- --subnet=192.170.0.0/16 \ |
|
| 128 |
- --gateway=192.168.0.100 \ |
|
| 129 |
- --gateway=192.170.0.100 \ |
|
| 130 |
- --ip-range=192.168.1.0/24 \ |
|
| 131 |
- --aux-address="my-router=192.168.1.5" --aux-address="my-switch=192.168.1.6" \ |
|
| 132 |
- --aux-address="my-printer=192.170.1.5" --aux-address="my-nas=192.170.1.6" \ |
|
| 133 |
- my-multihost-network |
|
| 134 |
-``` |
|
| 135 |
- |
|
| 136 |
-Be sure that your subnetworks do not overlap. If they do, the network create |
|
| 137 |
-fails and Engine returns an error. |
|
| 138 |
- |
|
| 139 |
-### Network internal mode |
|
| 140 |
- |
|
| 141 |
-By default, when you connect a container to an `overlay` network, Docker also |
|
| 142 |
-connects a bridge network to it to provide external connectivity. If you want |
|
| 143 |
-to create an externally isolated `overlay` network, you can specify the |
|
| 144 |
-`--internal` option. |
|
| 145 |
- |
|
| 146 |
-# OPTIONS |
|
| 147 |
-**--attachable** |
|
| 148 |
- Enable manual container attachment |
|
| 149 |
- |
|
| 150 |
-**--aux-address**=map[] |
|
| 151 |
- Auxiliary IPv4 or IPv6 addresses used by network driver |
|
| 152 |
- |
|
| 153 |
-**-d**, **--driver**=*DRIVER* |
|
| 154 |
- Driver to manage the Network bridge or overlay. The default is bridge. |
|
| 155 |
- |
|
| 156 |
-**--gateway**=[] |
|
| 157 |
- IPv4 or IPv6 Gateway for the master subnet |
|
| 158 |
- |
|
| 159 |
-**--help** |
|
| 160 |
- Print usage |
|
| 161 |
- |
|
| 162 |
-**--internal** |
|
| 163 |
- Restrict external access to the network |
|
| 164 |
- |
|
| 165 |
-**--ip-range**=[] |
|
| 166 |
- Allocate container ip from a sub-range |
|
| 167 |
- |
|
| 168 |
-**--ipam-driver**=*default* |
|
| 169 |
- IP Address Management Driver |
|
| 170 |
- |
|
| 171 |
-**--ipam-opt**=map[] |
|
| 172 |
- Set custom IPAM driver options |
|
| 173 |
- |
|
| 174 |
-**--ipv6** |
|
| 175 |
- Enable IPv6 networking |
|
| 176 |
- |
|
| 177 |
-**--label**=*label* |
|
| 178 |
- Set metadata for a network |
|
| 179 |
- |
|
| 180 |
-**-o**, **--opt**=map[] |
|
| 181 |
- Set custom driver options |
|
| 182 |
- |
|
| 183 |
-**--subnet**=[] |
|
| 184 |
- Subnet in CIDR format that represents a network segment |
|
| 185 |
- |
|
| 186 |
-# HISTORY |
|
| 187 |
-OCT 2015, created by Mary Anthony <mary@docker.com> |
| 188 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,36 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% OCT 2015 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-network-disconnect - disconnect a container from a network |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker network disconnect** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**--force**] |
|
| 11 |
-NETWORK CONTAINER |
|
| 12 |
- |
|
| 13 |
-# DESCRIPTION |
|
| 14 |
- |
|
| 15 |
-Disconnects a container from a network. |
|
| 16 |
- |
|
| 17 |
-```bash |
|
| 18 |
- $ docker network disconnect multi-host-network container1 |
|
| 19 |
-``` |
|
| 20 |
- |
|
| 21 |
- |
|
| 22 |
-# OPTIONS |
|
| 23 |
-**NETWORK** |
|
| 24 |
- Specify network name |
|
| 25 |
- |
|
| 26 |
-**CONTAINER** |
|
| 27 |
- Specify container name |
|
| 28 |
- |
|
| 29 |
-**--force** |
|
| 30 |
- Force the container to disconnect from a network |
|
| 31 |
- |
|
| 32 |
-**--help** |
|
| 33 |
- Print usage statement |
|
| 34 |
- |
|
| 35 |
-# HISTORY |
|
| 36 |
-OCT 2015, created by Mary Anthony <mary@docker.com> |
| 37 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,112 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% OCT 2015 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-network-inspect - inspect a network |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker network inspect** |
|
| 9 |
-[**-f**|**--format**[=*FORMAT*]] |
|
| 10 |
-[**--help**] |
|
| 11 |
-NETWORK [NETWORK...] |
|
| 12 |
- |
|
| 13 |
-# DESCRIPTION |
|
| 14 |
- |
|
| 15 |
-Returns information about one or more networks. By default, this command renders all results in a JSON object. For example, if you connect two containers to the default `bridge` network: |
|
| 16 |
- |
|
| 17 |
-```bash |
|
| 18 |
-$ sudo docker run -itd --name=container1 busybox |
|
| 19 |
-f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27 |
|
| 20 |
- |
|
| 21 |
-$ sudo docker run -itd --name=container2 busybox |
|
| 22 |
-bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727 |
|
| 23 |
-``` |
|
| 24 |
- |
|
| 25 |
-The `network inspect` command shows the containers, by id, in its |
|
| 26 |
-results. You can specify an alternate format to execute a given |
|
| 27 |
-template for each result. Go's |
|
| 28 |
-[text/template](http://golang.org/pkg/text/template/) package |
|
| 29 |
-describes all the details of the format. |
|
| 30 |
- |
|
| 31 |
-```bash |
|
| 32 |
-$ sudo docker network inspect bridge |
|
| 33 |
-[ |
|
| 34 |
- {
|
|
| 35 |
- "Name": "bridge", |
|
| 36 |
- "Id": "b2b1a2cba717161d984383fd68218cf70bbbd17d328496885f7c921333228b0f", |
|
| 37 |
- "Scope": "local", |
|
| 38 |
- "Driver": "bridge", |
|
| 39 |
- "IPAM": {
|
|
| 40 |
- "Driver": "default", |
|
| 41 |
- "Config": [ |
|
| 42 |
- {
|
|
| 43 |
- "Subnet": "172.17.42.1/16", |
|
| 44 |
- "Gateway": "172.17.42.1" |
|
| 45 |
- } |
|
| 46 |
- ] |
|
| 47 |
- }, |
|
| 48 |
- "Internal": false, |
|
| 49 |
- "Containers": {
|
|
| 50 |
- "bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727": {
|
|
| 51 |
- "Name": "container2", |
|
| 52 |
- "EndpointID": "0aebb8fcd2b282abe1365979536f21ee4ceaf3ed56177c628eae9f706e00e019", |
|
| 53 |
- "MacAddress": "02:42:ac:11:00:02", |
|
| 54 |
- "IPv4Address": "172.17.0.2/16", |
|
| 55 |
- "IPv6Address": "" |
|
| 56 |
- }, |
|
| 57 |
- "f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27": {
|
|
| 58 |
- "Name": "container1", |
|
| 59 |
- "EndpointID": "a00676d9c91a96bbe5bcfb34f705387a33d7cc365bac1a29e4e9728df92d10ad", |
|
| 60 |
- "MacAddress": "02:42:ac:11:00:01", |
|
| 61 |
- "IPv4Address": "172.17.0.1/16", |
|
| 62 |
- "IPv6Address": "" |
|
| 63 |
- } |
|
| 64 |
- }, |
|
| 65 |
- "Options": {
|
|
| 66 |
- "com.docker.network.bridge.default_bridge": "true", |
|
| 67 |
- "com.docker.network.bridge.enable_icc": "true", |
|
| 68 |
- "com.docker.network.bridge.enable_ip_masquerade": "true", |
|
| 69 |
- "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", |
|
| 70 |
- "com.docker.network.bridge.name": "docker0", |
|
| 71 |
- "com.docker.network.driver.mtu": "1500" |
|
| 72 |
- } |
|
| 73 |
- } |
|
| 74 |
-] |
|
| 75 |
-``` |
|
| 76 |
- |
|
| 77 |
-Returns the information about the user-defined network: |
|
| 78 |
- |
|
| 79 |
-```bash |
|
| 80 |
-$ docker network create simple-network |
|
| 81 |
-69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a |
|
| 82 |
-$ docker network inspect simple-network |
|
| 83 |
-[ |
|
| 84 |
- {
|
|
| 85 |
- "Name": "simple-network", |
|
| 86 |
- "Id": "69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a", |
|
| 87 |
- "Scope": "local", |
|
| 88 |
- "Driver": "bridge", |
|
| 89 |
- "IPAM": {
|
|
| 90 |
- "Driver": "default", |
|
| 91 |
- "Config": [ |
|
| 92 |
- {
|
|
| 93 |
- "Subnet": "172.22.0.0/16", |
|
| 94 |
- "Gateway": "172.22.0.1" |
|
| 95 |
- } |
|
| 96 |
- ] |
|
| 97 |
- }, |
|
| 98 |
- "Containers": {},
|
|
| 99 |
- "Options": {}
|
|
| 100 |
- } |
|
| 101 |
-] |
|
| 102 |
-``` |
|
| 103 |
- |
|
| 104 |
-# OPTIONS |
|
| 105 |
-**-f**, **--format**="" |
|
| 106 |
- Format the output using the given Go template. |
|
| 107 |
- |
|
| 108 |
-**--help** |
|
| 109 |
- Print usage statement |
|
| 110 |
- |
|
| 111 |
-# HISTORY |
|
| 112 |
-OCT 2015, created by Mary Anthony <mary@docker.com> |
| 113 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,188 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% OCT 2015 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-network-ls - list networks |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker network ls** |
|
| 9 |
-[**-f**|**--filter**[=*[]*]] |
|
| 10 |
-[**--format**=*"TEMPLATE"*] |
|
| 11 |
-[**--no-trunc**[=*true*|*false*]] |
|
| 12 |
-[**-q**|**--quiet**[=*true*|*false*]] |
|
| 13 |
-[**--help**] |
|
| 14 |
- |
|
| 15 |
-# DESCRIPTION |
|
| 16 |
- |
|
| 17 |
-Lists all the networks the Engine `daemon` knows about. This includes the |
|
| 18 |
-networks that span across multiple hosts in a cluster, for example: |
|
| 19 |
- |
|
| 20 |
-```bash |
|
| 21 |
- $ docker network ls |
|
| 22 |
- NETWORK ID NAME DRIVER SCOPE |
|
| 23 |
- 7fca4eb8c647 bridge bridge local |
|
| 24 |
- 9f904ee27bf5 none null local |
|
| 25 |
- cf03ee007fb4 host host local |
|
| 26 |
- 78b03ee04fc4 multi-host overlay swarm |
|
| 27 |
-``` |
|
| 28 |
- |
|
| 29 |
-Use the `--no-trunc` option to display the full network id: |
|
| 30 |
- |
|
| 31 |
-```bash |
|
| 32 |
-$ docker network ls --no-trunc |
|
| 33 |
-NETWORK ID NAME DRIVER |
|
| 34 |
-18a2866682b85619a026c81b98a5e375bd33e1b0936a26cc497c283d27bae9b3 none null |
|
| 35 |
-c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47 host host |
|
| 36 |
-7b369448dccbf865d397c8d2be0cda7cf7edc6b0945f77d2529912ae917a0185 bridge bridge |
|
| 37 |
-95e74588f40db048e86320c6526440c504650a1ff3e9f7d60a497c4d2163e5bd foo bridge |
|
| 38 |
-63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 dev bridge |
|
| 39 |
-``` |
|
| 40 |
- |
|
| 41 |
-## Filtering |
|
| 42 |
- |
|
| 43 |
-The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there |
|
| 44 |
-is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). |
|
| 45 |
-Multiple filter flags are combined as an `OR` filter. For example, |
|
| 46 |
-`-f type=custom -f type=builtin` returns both `custom` and `builtin` networks. |
|
| 47 |
- |
|
| 48 |
-The currently supported filters are: |
|
| 49 |
- |
|
| 50 |
-* driver |
|
| 51 |
-* id (network's id) |
|
| 52 |
-* label (`label=<key>` or `label=<key>=<value>`) |
|
| 53 |
-* name (network's name) |
|
| 54 |
-* type (custom|builtin) |
|
| 55 |
- |
|
| 56 |
-#### Driver |
|
| 57 |
- |
|
| 58 |
-The `driver` filter matches networks based on their driver. |
|
| 59 |
- |
|
| 60 |
-The following example matches networks with the `bridge` driver: |
|
| 61 |
- |
|
| 62 |
-```bash |
|
| 63 |
-$ docker network ls --filter driver=bridge |
|
| 64 |
-NETWORK ID NAME DRIVER |
|
| 65 |
-db9db329f835 test1 bridge |
|
| 66 |
-f6e212da9dfd test2 bridge |
|
| 67 |
-``` |
|
| 68 |
- |
|
| 69 |
-#### ID |
|
| 70 |
- |
|
| 71 |
-The `id` filter matches on all or part of a network's ID. |
|
| 72 |
- |
|
| 73 |
-The following filter matches all networks with an ID containing the |
|
| 74 |
-`63d1ff1f77b0...` string. |
|
| 75 |
- |
|
| 76 |
-```bash |
|
| 77 |
-$ docker network ls --filter id=63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 |
|
| 78 |
-NETWORK ID NAME DRIVER |
|
| 79 |
-63d1ff1f77b0 dev bridge |
|
| 80 |
-``` |
|
| 81 |
- |
|
| 82 |
-You can also filter for a substring in an ID as this shows: |
|
| 83 |
- |
|
| 84 |
-```bash |
|
| 85 |
-$ docker network ls --filter id=95e74588f40d |
|
| 86 |
-NETWORK ID NAME DRIVER |
|
| 87 |
-95e74588f40d foo bridge |
|
| 88 |
- |
|
| 89 |
-$ docker network ls --filter id=95e |
|
| 90 |
-NETWORK ID NAME DRIVER |
|
| 91 |
-95e74588f40d foo bridge |
|
| 92 |
-``` |
|
| 93 |
- |
|
| 94 |
-#### Label |
|
| 95 |
- |
|
| 96 |
-The `label` filter matches networks based on the presence of a `label` alone or a `label` and a |
|
| 97 |
-value. |
|
| 98 |
- |
|
| 99 |
-The following filter matches networks with the `usage` label regardless of its value. |
|
| 100 |
- |
|
| 101 |
-```bash |
|
| 102 |
-$ docker network ls -f "label=usage" |
|
| 103 |
-NETWORK ID NAME DRIVER |
|
| 104 |
-db9db329f835 test1 bridge |
|
| 105 |
-f6e212da9dfd test2 bridge |
|
| 106 |
-``` |
|
| 107 |
- |
|
| 108 |
-The following filter matches networks with the `usage` label with the `prod` value. |
|
| 109 |
- |
|
| 110 |
-```bash |
|
| 111 |
-$ docker network ls -f "label=usage=prod" |
|
| 112 |
-NETWORK ID NAME DRIVER |
|
| 113 |
-f6e212da9dfd test2 bridge |
|
| 114 |
-``` |
|
| 115 |
- |
|
| 116 |
-#### Name |
|
| 117 |
- |
|
| 118 |
-The `name` filter matches on all or part of a network's name. |
|
| 119 |
- |
|
| 120 |
-The following filter matches all networks with a name containing the `foobar` string. |
|
| 121 |
- |
|
| 122 |
-```bash |
|
| 123 |
-$ docker network ls --filter name=foobar |
|
| 124 |
-NETWORK ID NAME DRIVER |
|
| 125 |
-06e7eef0a170 foobar bridge |
|
| 126 |
-``` |
|
| 127 |
- |
|
| 128 |
-You can also filter for a substring in a name as this shows: |
|
| 129 |
- |
|
| 130 |
-```bash |
|
| 131 |
-$ docker network ls --filter name=foo |
|
| 132 |
-NETWORK ID NAME DRIVER |
|
| 133 |
-95e74588f40d foo bridge |
|
| 134 |
-06e7eef0a170 foobar bridge |
|
| 135 |
-``` |
|
| 136 |
- |
|
| 137 |
-#### Type |
|
| 138 |
- |
|
| 139 |
-The `type` filter supports two values; `builtin` displays predefined networks |
|
| 140 |
-(`bridge`, `none`, `host`), whereas `custom` displays user defined networks. |
|
| 141 |
- |
|
| 142 |
-The following filter matches all user defined networks: |
|
| 143 |
- |
|
| 144 |
-```bash |
|
| 145 |
-$ docker network ls --filter type=custom |
|
| 146 |
-NETWORK ID NAME DRIVER |
|
| 147 |
-95e74588f40d foo bridge |
|
| 148 |
-63d1ff1f77b0 dev bridge |
|
| 149 |
-``` |
|
| 150 |
- |
|
| 151 |
-By having this flag it allows for batch cleanup. For example, use this filter |
|
| 152 |
-to delete all user defined networks: |
|
| 153 |
- |
|
| 154 |
-```bash |
|
| 155 |
-$ docker network rm `docker network ls --filter type=custom -q` |
|
| 156 |
-``` |
|
| 157 |
- |
|
| 158 |
-A warning will be issued when trying to remove a network that has containers |
|
| 159 |
-attached. |
|
| 160 |
- |
|
| 161 |
-# OPTIONS |
|
| 162 |
- |
|
| 163 |
-**-f**, **--filter**=*[]* |
|
| 164 |
- filter output based on conditions provided. |
|
| 165 |
- |
|
| 166 |
-**--format**="*TEMPLATE*" |
|
| 167 |
- Pretty-print networks using a Go template. |
|
| 168 |
- Valid placeholders: |
|
| 169 |
- .ID - Network ID |
|
| 170 |
- .Name - Network name |
|
| 171 |
- .Driver - Network driver |
|
| 172 |
- .Scope - Network scope (local, global) |
|
| 173 |
- .IPv6 - Whether IPv6 is enabled on the network or not |
|
| 174 |
- .Internal - Whether the network is internal or not |
|
| 175 |
- .Labels - All labels assigned to the network |
|
| 176 |
- .Label - Value of a specific label for this network. For example `{{.Label "project.version"}}`
|
|
| 177 |
- |
|
| 178 |
-**--no-trunc**=*true*|*false* |
|
| 179 |
- Do not truncate the output |
|
| 180 |
- |
|
| 181 |
-**-q**, **--quiet**=*true*|*false* |
|
| 182 |
- Only display network IDs |
|
| 183 |
- |
|
| 184 |
-**--help** |
|
| 185 |
- Print usage statement |
|
| 186 |
- |
|
| 187 |
-# HISTORY |
|
| 188 |
-OCT 2015, created by Mary Anthony <mary@docker.com> |
| 189 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,43 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% OCT 2015 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-network-rm - remove one or more networks |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker network rm** |
|
| 9 |
-[**--help**] |
|
| 10 |
-NETWORK [NETWORK...] |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
- |
|
| 14 |
-Removes one or more networks by name or identifier. To remove a network, |
|
| 15 |
-you must first disconnect any containers connected to it. |
|
| 16 |
-To remove the network named 'my-network': |
|
| 17 |
- |
|
| 18 |
-```bash |
|
| 19 |
- $ docker network rm my-network |
|
| 20 |
-``` |
|
| 21 |
- |
|
| 22 |
-To delete multiple networks in a single `docker network rm` command, provide |
|
| 23 |
-multiple network names or ids. The following example deletes a network with id |
|
| 24 |
-`3695c422697f` and a network named `my-network`: |
|
| 25 |
- |
|
| 26 |
-```bash |
|
| 27 |
- $ docker network rm 3695c422697f my-network |
|
| 28 |
-``` |
|
| 29 |
- |
|
| 30 |
-When you specify multiple networks, the command attempts to delete each in turn. |
|
| 31 |
-If the deletion of one network fails, the command continues to the next on the |
|
| 32 |
-list and tries to delete that. The command reports success or failure for each |
|
| 33 |
-deletion. |
|
| 34 |
- |
|
| 35 |
-# OPTIONS |
|
| 36 |
-**NETWORK** |
|
| 37 |
- Specify network name or id |
|
| 38 |
- |
|
| 39 |
-**--help** |
|
| 40 |
- Print usage statement |
|
| 41 |
- |
|
| 42 |
-# HISTORY |
|
| 43 |
-OCT 2015, created by Mary Anthony <mary@docker.com> |
| 44 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,32 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-pause - Pause all processes within one or more containers |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker pause** |
|
| 9 |
-CONTAINER [CONTAINER...] |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
- |
|
| 13 |
-The `docker pause` command suspends all processes in the specified containers. |
|
| 14 |
-On Linux, this uses the cgroups freezer. Traditionally, when suspending a process |
|
| 15 |
-the `SIGSTOP` signal is used, which is observable by the process being suspended. |
|
| 16 |
-With the cgroups freezer the process is unaware, and unable to capture, |
|
| 17 |
-that it is being suspended, and subsequently resumed. On Windows, only Hyper-V |
|
| 18 |
-containers can be paused. |
|
| 19 |
- |
|
| 20 |
-See the [cgroups freezer documentation] |
|
| 21 |
-(https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) for |
|
| 22 |
-further details. |
|
| 23 |
- |
|
| 24 |
-# OPTIONS |
|
| 25 |
-**--help** |
|
| 26 |
- Print usage statement |
|
| 27 |
- |
|
| 28 |
-# See also |
|
| 29 |
-**docker-unpause(1)** to unpause all processes within one or more containers. |
|
| 30 |
- |
|
| 31 |
-# HISTORY |
|
| 32 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 33 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,47 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-port - List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker port** |
|
| 9 |
-[**--help**] |
|
| 10 |
-CONTAINER [PRIVATE_PORT[/PROTO]] |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
-List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT |
|
| 14 |
- |
|
| 15 |
-# OPTIONS |
|
| 16 |
-**--help** |
|
| 17 |
- Print usage statement |
|
| 18 |
- |
|
| 19 |
-# EXAMPLES |
|
| 20 |
- |
|
| 21 |
- # docker ps |
|
| 22 |
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 23 |
- b650456536c7 busybox:latest top 54 minutes ago Up 54 minutes 0.0.0.0:1234->9876/tcp, 0.0.0.0:4321->7890/tcp test |
|
| 24 |
- |
|
| 25 |
-## Find out all the ports mapped |
|
| 26 |
- |
|
| 27 |
- # docker port test |
|
| 28 |
- 7890/tcp -> 0.0.0.0:4321 |
|
| 29 |
- 9876/tcp -> 0.0.0.0:1234 |
|
| 30 |
- |
|
| 31 |
-## Find out a specific mapping |
|
| 32 |
- |
|
| 33 |
- # docker port test 7890/tcp |
|
| 34 |
- 0.0.0.0:4321 |
|
| 35 |
- |
|
| 36 |
- # docker port test 7890 |
|
| 37 |
- 0.0.0.0:4321 |
|
| 38 |
- |
|
| 39 |
-## An example showing error for non-existent mapping |
|
| 40 |
- |
|
| 41 |
- # docker port test 7890/udp |
|
| 42 |
- 2014/06/24 11:53:36 Error: No public port '7890/udp' published for test |
|
| 43 |
- |
|
| 44 |
-# HISTORY |
|
| 45 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 46 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 47 |
-November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 48 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,145 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% FEBRUARY 2015 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-ps - List containers |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker ps** |
|
| 9 |
-[**-a**|**--all**] |
|
| 10 |
-[**-f**|**--filter**[=*[]*]] |
|
| 11 |
-[**--format**=*"TEMPLATE"*] |
|
| 12 |
-[**--help**] |
|
| 13 |
-[**-l**|**--latest**] |
|
| 14 |
-[**-n**[=*-1*]] |
|
| 15 |
-[**--no-trunc**] |
|
| 16 |
-[**-q**|**--quiet**] |
|
| 17 |
-[**-s**|**--size**] |
|
| 18 |
- |
|
| 19 |
-# DESCRIPTION |
|
| 20 |
- |
|
| 21 |
-List the containers in the local repository. By default this shows only |
|
| 22 |
-the running containers. |
|
| 23 |
- |
|
| 24 |
-# OPTIONS |
|
| 25 |
-**-a**, **--all**=*true*|*false* |
|
| 26 |
- Show all containers. Only running containers are shown by default. The default is *false*. |
|
| 27 |
- |
|
| 28 |
-**-f**, **--filter**=[] |
|
| 29 |
- Filter output based on these conditions: |
|
| 30 |
- - exited=<int> an exit code of <int> |
|
| 31 |
- - label=<key> or label=<key>=<value> |
|
| 32 |
- - status=(created|restarting|running|paused|exited|dead) |
|
| 33 |
- - name=<string> a container's name |
|
| 34 |
- - id=<ID> a container's ID |
|
| 35 |
- - is-task=(true|false) - containers that are a task (part of a service managed by swarm) |
|
| 36 |
- - before=(<container-name>|<container-id>) |
|
| 37 |
- - since=(<container-name>|<container-id>) |
|
| 38 |
- - ancestor=(<image-name>[:tag]|<image-id>|<image@digest>) - containers created from an image or a descendant. |
|
| 39 |
- - volume=(<volume-name>|<mount-point-destination>) |
|
| 40 |
- - network=(<network-name>|<network-id>) - containers connected to the provided network |
|
| 41 |
- - health=(starting|healthy|unhealthy|none) - filters containers based on healthcheck status |
|
| 42 |
- |
|
| 43 |
-**--format**="*TEMPLATE*" |
|
| 44 |
- Pretty-print containers using a Go template. |
|
| 45 |
- Valid placeholders: |
|
| 46 |
- .ID - Container ID |
|
| 47 |
- .Image - Image ID |
|
| 48 |
- .Command - Quoted command |
|
| 49 |
- .CreatedAt - Time when the container was created. |
|
| 50 |
- .RunningFor - Elapsed time since the container was started. |
|
| 51 |
- .Ports - Exposed ports. |
|
| 52 |
- .Status - Container status. |
|
| 53 |
- .Size - Container disk size. |
|
| 54 |
- .Names - Container names. |
|
| 55 |
- .Labels - All labels assigned to the container. |
|
| 56 |
- .Label - Value of a specific label for this container. For example `{{.Label "com.docker.swarm.cpu"}}`
|
|
| 57 |
- .Mounts - Names of the volumes mounted in this container. |
|
| 58 |
- |
|
| 59 |
-**--help** |
|
| 60 |
- Print usage statement |
|
| 61 |
- |
|
| 62 |
-**-l**, **--latest**=*true*|*false* |
|
| 63 |
- Show only the latest created container (includes all states). The default is *false*. |
|
| 64 |
- |
|
| 65 |
-**-n**=*-1* |
|
| 66 |
- Show n last created containers (includes all states). |
|
| 67 |
- |
|
| 68 |
-**--no-trunc**=*true*|*false* |
|
| 69 |
- Don't truncate output. The default is *false*. |
|
| 70 |
- |
|
| 71 |
-**-q**, **--quiet**=*true*|*false* |
|
| 72 |
- Only display numeric IDs. The default is *false*. |
|
| 73 |
- |
|
| 74 |
-**-s**, **--size**=*true*|*false* |
|
| 75 |
- Display total file sizes. The default is *false*. |
|
| 76 |
- |
|
| 77 |
-# EXAMPLES |
|
| 78 |
-# Display all containers, including non-running |
|
| 79 |
- |
|
| 80 |
- # docker ps -a |
|
| 81 |
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 82 |
- a87ecb4f327c fedora:20 /bin/sh -c #(nop) MA 20 minutes ago Exit 0 desperate_brattain |
|
| 83 |
- 01946d9d34d8 vpavlin/rhel7:latest /bin/sh -c #(nop) MA 33 minutes ago Exit 0 thirsty_bell |
|
| 84 |
- c1d3b0166030 acffc0358b9e /bin/sh -c yum -y up 2 weeks ago Exit 1 determined_torvalds |
|
| 85 |
- 41d50ecd2f57 fedora:20 /bin/sh -c #(nop) MA 2 weeks ago Exit 0 drunk_pike |
|
| 86 |
- |
|
| 87 |
-# Display only IDs of all containers, including non-running |
|
| 88 |
- |
|
| 89 |
- # docker ps -a -q |
|
| 90 |
- a87ecb4f327c |
|
| 91 |
- 01946d9d34d8 |
|
| 92 |
- c1d3b0166030 |
|
| 93 |
- 41d50ecd2f57 |
|
| 94 |
- |
|
| 95 |
-# Display only IDs of all containers that have the name `determined_torvalds` |
|
| 96 |
- |
|
| 97 |
- # docker ps -a -q --filter=name=determined_torvalds |
|
| 98 |
- c1d3b0166030 |
|
| 99 |
- |
|
| 100 |
-# Display containers with their commands |
|
| 101 |
- |
|
| 102 |
- # docker ps --format "{{.ID}}: {{.Command}}"
|
|
| 103 |
- a87ecb4f327c: /bin/sh -c #(nop) MA |
|
| 104 |
- 01946d9d34d8: /bin/sh -c #(nop) MA |
|
| 105 |
- c1d3b0166030: /bin/sh -c yum -y up |
|
| 106 |
- 41d50ecd2f57: /bin/sh -c #(nop) MA |
|
| 107 |
- |
|
| 108 |
-# Display containers with their labels in a table |
|
| 109 |
- |
|
| 110 |
- # docker ps --format "table {{.ID}}\t{{.Labels}}"
|
|
| 111 |
- CONTAINER ID LABELS |
|
| 112 |
- a87ecb4f327c com.docker.swarm.node=ubuntu,com.docker.swarm.storage=ssd |
|
| 113 |
- 01946d9d34d8 |
|
| 114 |
- c1d3b0166030 com.docker.swarm.node=debian,com.docker.swarm.cpu=6 |
|
| 115 |
- 41d50ecd2f57 com.docker.swarm.node=fedora,com.docker.swarm.cpu=3,com.docker.swarm.storage=ssd |
|
| 116 |
- |
|
| 117 |
-# Display containers with their node label in a table |
|
| 118 |
- |
|
| 119 |
- # docker ps --format 'table {{.ID}}\t{{(.Label "com.docker.swarm.node")}}'
|
|
| 120 |
- CONTAINER ID NODE |
|
| 121 |
- a87ecb4f327c ubuntu |
|
| 122 |
- 01946d9d34d8 |
|
| 123 |
- c1d3b0166030 debian |
|
| 124 |
- 41d50ecd2f57 fedora |
|
| 125 |
- |
|
| 126 |
-# Display containers with `remote-volume` mounted |
|
| 127 |
- |
|
| 128 |
- $ docker ps --filter volume=remote-volume --format "table {{.ID}}\t{{.Mounts}}"
|
|
| 129 |
- CONTAINER ID MOUNTS |
|
| 130 |
- 9c3527ed70ce remote-volume |
|
| 131 |
- |
|
| 132 |
-# Display containers with a volume mounted in `/data` |
|
| 133 |
- |
|
| 134 |
- $ docker ps --filter volume=/data --format "table {{.ID}}\t{{.Mounts}}"
|
|
| 135 |
- CONTAINER ID MOUNTS |
|
| 136 |
- 9c3527ed70ce remote-volume |
|
| 137 |
- |
|
| 138 |
-# HISTORY |
|
| 139 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 140 |
-based on docker.com source material and internal work. |
|
| 141 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 142 |
-August 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 143 |
-November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 144 |
-February 2015, updated by André Martins <martins@noironetworks.com> |
|
| 145 |
-October 2016, updated by Josh Horwitz <horwitzja@gmail.com> |
| 146 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,220 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-pull - Pull an image or a repository from a registry |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker pull** |
|
| 9 |
-[**-a**|**--all-tags**] |
|
| 10 |
-[**--help**] |
|
| 11 |
-NAME[:TAG] | [REGISTRY_HOST[:REGISTRY_PORT]/]NAME[:TAG] |
|
| 12 |
- |
|
| 13 |
-# DESCRIPTION |
|
| 14 |
- |
|
| 15 |
-This command pulls down an image or a repository from a registry. If |
|
| 16 |
-there is more than one image for a repository (e.g., fedora) then all |
|
| 17 |
-images for that repository name can be pulled down including any tags |
|
| 18 |
-(see the option **-a** or **--all-tags**). |
|
| 19 |
- |
|
| 20 |
-If you do not specify a `REGISTRY_HOST`, the command uses Docker's public |
|
| 21 |
-registry located at `registry-1.docker.io` by default. |
|
| 22 |
- |
|
| 23 |
-# OPTIONS |
|
| 24 |
-**-a**, **--all-tags**=*true*|*false* |
|
| 25 |
- Download all tagged images in the repository. The default is *false*. |
|
| 26 |
- |
|
| 27 |
-**--help** |
|
| 28 |
- Print usage statement |
|
| 29 |
- |
|
| 30 |
-# EXAMPLES |
|
| 31 |
- |
|
| 32 |
-### Pull an image from Docker Hub |
|
| 33 |
- |
|
| 34 |
-To download a particular image, or set of images (i.e., a repository), use |
|
| 35 |
-`docker pull`. If no tag is provided, Docker Engine uses the `:latest` tag as a |
|
| 36 |
-default. This command pulls the `debian:latest` image: |
|
| 37 |
- |
|
| 38 |
- $ docker pull debian |
|
| 39 |
- |
|
| 40 |
- Using default tag: latest |
|
| 41 |
- latest: Pulling from library/debian |
|
| 42 |
- fdd5d7827f33: Pull complete |
|
| 43 |
- a3ed95caeb02: Pull complete |
|
| 44 |
- Digest: sha256:e7d38b3517548a1c71e41bffe9c8ae6d6d29546ce46bf62159837aad072c90aa |
|
| 45 |
- Status: Downloaded newer image for debian:latest |
|
| 46 |
- |
|
| 47 |
-Docker images can consist of multiple layers. In the example above, the image |
|
| 48 |
-consists of two layers; `fdd5d7827f33` and `a3ed95caeb02`. |
|
| 49 |
- |
|
| 50 |
-Layers can be reused by images. For example, the `debian:jessie` image shares |
|
| 51 |
-both layers with `debian:latest`. Pulling the `debian:jessie` image therefore |
|
| 52 |
-only pulls its metadata, but not its layers, because all layers are already |
|
| 53 |
-present locally: |
|
| 54 |
- |
|
| 55 |
- $ docker pull debian:jessie |
|
| 56 |
- |
|
| 57 |
- jessie: Pulling from library/debian |
|
| 58 |
- fdd5d7827f33: Already exists |
|
| 59 |
- a3ed95caeb02: Already exists |
|
| 60 |
- Digest: sha256:a9c958be96d7d40df920e7041608f2f017af81800ca5ad23e327bc402626b58e |
|
| 61 |
- Status: Downloaded newer image for debian:jessie |
|
| 62 |
- |
|
| 63 |
-To see which images are present locally, use the **docker-images(1)** |
|
| 64 |
-command: |
|
| 65 |
- |
|
| 66 |
- $ docker images |
|
| 67 |
- |
|
| 68 |
- REPOSITORY TAG IMAGE ID CREATED SIZE |
|
| 69 |
- debian jessie f50f9524513f 5 days ago 125.1 MB |
|
| 70 |
- debian latest f50f9524513f 5 days ago 125.1 MB |
|
| 71 |
- |
|
| 72 |
-Docker uses a content-addressable image store, and the image ID is a SHA256 |
|
| 73 |
-digest covering the image's configuration and layers. In the example above, |
|
| 74 |
-`debian:jessie` and `debian:latest` have the same image ID because they are |
|
| 75 |
-actually the *same* image tagged with different names. Because they are the |
|
| 76 |
-same image, their layers are stored only once and do not consume extra disk |
|
| 77 |
-space. |
|
| 78 |
- |
|
| 79 |
-For more information about images, layers, and the content-addressable store, |
|
| 80 |
-refer to [understand images, containers, and storage drivers](https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/) |
|
| 81 |
-in the online documentation. |
|
| 82 |
- |
|
| 83 |
- |
|
| 84 |
-## Pull an image by digest (immutable identifier) |
|
| 85 |
- |
|
| 86 |
-So far, you've pulled images by their name (and "tag"). Using names and tags is |
|
| 87 |
-a convenient way to work with images. When using tags, you can `docker pull` an |
|
| 88 |
-image again to make sure you have the most up-to-date version of that image. |
|
| 89 |
-For example, `docker pull ubuntu:14.04` pulls the latest version of the Ubuntu |
|
| 90 |
-14.04 image. |
|
| 91 |
- |
|
| 92 |
-In some cases you don't want images to be updated to newer versions, but prefer |
|
| 93 |
-to use a fixed version of an image. Docker enables you to pull an image by its |
|
| 94 |
-*digest*. When pulling an image by digest, you specify *exactly* which version |
|
| 95 |
-of an image to pull. Doing so, allows you to "pin" an image to that version, |
|
| 96 |
-and guarantee that the image you're using is always the same. |
|
| 97 |
- |
|
| 98 |
-To know the digest of an image, pull the image first. Let's pull the latest |
|
| 99 |
-`ubuntu:14.04` image from Docker Hub: |
|
| 100 |
- |
|
| 101 |
- $ docker pull ubuntu:14.04 |
|
| 102 |
- |
|
| 103 |
- 14.04: Pulling from library/ubuntu |
|
| 104 |
- 5a132a7e7af1: Pull complete |
|
| 105 |
- fd2731e4c50c: Pull complete |
|
| 106 |
- 28a2f68d1120: Pull complete |
|
| 107 |
- a3ed95caeb02: Pull complete |
|
| 108 |
- Digest: sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 109 |
- Status: Downloaded newer image for ubuntu:14.04 |
|
| 110 |
- |
|
| 111 |
-Docker prints the digest of the image after the pull has finished. In the example |
|
| 112 |
-above, the digest of the image is: |
|
| 113 |
- |
|
| 114 |
- sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 115 |
- |
|
| 116 |
-Docker also prints the digest of an image when *pushing* to a registry. This |
|
| 117 |
-may be useful if you want to pin to a version of the image you just pushed. |
|
| 118 |
- |
|
| 119 |
-A digest takes the place of the tag when pulling an image, for example, to |
|
| 120 |
-pull the above image by digest, run the following command: |
|
| 121 |
- |
|
| 122 |
- $ docker pull ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 123 |
- |
|
| 124 |
- sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2: Pulling from library/ubuntu |
|
| 125 |
- 5a132a7e7af1: Already exists |
|
| 126 |
- fd2731e4c50c: Already exists |
|
| 127 |
- 28a2f68d1120: Already exists |
|
| 128 |
- a3ed95caeb02: Already exists |
|
| 129 |
- Digest: sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 130 |
- Status: Downloaded newer image for ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 131 |
- |
|
| 132 |
-Digest can also be used in the `FROM` of a Dockerfile, for example: |
|
| 133 |
- |
|
| 134 |
- FROM ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 135 |
- MAINTAINER some maintainer <maintainer@example.com> |
|
| 136 |
- |
|
| 137 |
-> **Note**: Using this feature "pins" an image to a specific version in time. |
|
| 138 |
-> Docker will therefore not pull updated versions of an image, which may include |
|
| 139 |
-> security updates. If you want to pull an updated image, you need to change the |
|
| 140 |
-> digest accordingly. |
|
| 141 |
- |
|
| 142 |
-## Pulling from a different registry |
|
| 143 |
- |
|
| 144 |
-By default, `docker pull` pulls images from Docker Hub. It is also possible to |
|
| 145 |
-manually specify the path of a registry to pull from. For example, if you have |
|
| 146 |
-set up a local registry, you can specify its path to pull from it. A registry |
|
| 147 |
-path is similar to a URL, but does not contain a protocol specifier (`https://`). |
|
| 148 |
- |
|
| 149 |
-The following command pulls the `testing/test-image` image from a local registry |
|
| 150 |
-listening on port 5000 (`myregistry.local:5000`): |
|
| 151 |
- |
|
| 152 |
- $ docker pull myregistry.local:5000/testing/test-image |
|
| 153 |
- |
|
| 154 |
-Registry credentials are managed by **docker-login(1)**. |
|
| 155 |
- |
|
| 156 |
-Docker uses the `https://` protocol to communicate with a registry, unless the |
|
| 157 |
-registry is allowed to be accessed over an insecure connection. Refer to the |
|
| 158 |
-[insecure registries](https://docs.docker.com/engine/reference/commandline/daemon/#insecure-registries) |
|
| 159 |
-section in the online documentation for more information. |
|
| 160 |
- |
|
| 161 |
- |
|
| 162 |
-## Pull a repository with multiple images |
|
| 163 |
- |
|
| 164 |
-By default, `docker pull` pulls a *single* image from the registry. A repository |
|
| 165 |
-can contain multiple images. To pull all images from a repository, provide the |
|
| 166 |
-`-a` (or `--all-tags`) option when using `docker pull`. |
|
| 167 |
- |
|
| 168 |
-This command pulls all images from the `fedora` repository: |
|
| 169 |
- |
|
| 170 |
- $ docker pull --all-tags fedora |
|
| 171 |
- |
|
| 172 |
- Pulling repository fedora |
|
| 173 |
- ad57ef8d78d7: Download complete |
|
| 174 |
- 105182bb5e8b: Download complete |
|
| 175 |
- 511136ea3c5a: Download complete |
|
| 176 |
- 73bd853d2ea5: Download complete |
|
| 177 |
- .... |
|
| 178 |
- |
|
| 179 |
- Status: Downloaded newer image for fedora |
|
| 180 |
- |
|
| 181 |
-After the pull has completed use the `docker images` command to see the |
|
| 182 |
-images that were pulled. The example below shows all the `fedora` images |
|
| 183 |
-that are present locally: |
|
| 184 |
- |
|
| 185 |
- $ docker images fedora |
|
| 186 |
- |
|
| 187 |
- REPOSITORY TAG IMAGE ID CREATED SIZE |
|
| 188 |
- fedora rawhide ad57ef8d78d7 5 days ago 359.3 MB |
|
| 189 |
- fedora 20 105182bb5e8b 5 days ago 372.7 MB |
|
| 190 |
- fedora heisenbug 105182bb5e8b 5 days ago 372.7 MB |
|
| 191 |
- fedora latest 105182bb5e8b 5 days ago 372.7 MB |
|
| 192 |
- |
|
| 193 |
- |
|
| 194 |
-## Canceling a pull |
|
| 195 |
- |
|
| 196 |
-Killing the `docker pull` process, for example by pressing `CTRL-c` while it is |
|
| 197 |
-running in a terminal, will terminate the pull operation. |
|
| 198 |
- |
|
| 199 |
- $ docker pull fedora |
|
| 200 |
- |
|
| 201 |
- Using default tag: latest |
|
| 202 |
- latest: Pulling from library/fedora |
|
| 203 |
- a3ed95caeb02: Pulling fs layer |
|
| 204 |
- 236608c7b546: Pulling fs layer |
|
| 205 |
- ^C |
|
| 206 |
- |
|
| 207 |
-> **Note**: Technically, the Engine terminates a pull operation when the |
|
| 208 |
-> connection between the Docker Engine daemon and the Docker Engine client |
|
| 209 |
-> initiating the pull is lost. If the connection with the Engine daemon is |
|
| 210 |
-> lost for other reasons than a manual interaction, the pull is also aborted. |
|
| 211 |
- |
|
| 212 |
- |
|
| 213 |
-# HISTORY |
|
| 214 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 215 |
-based on docker.com source material and internal work. |
|
| 216 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 217 |
-August 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 218 |
-April 2015, updated by John Willis <john.willis@docker.com> |
|
| 219 |
-April 2015, updated by Mary Anthony for v2 <mary@docker.com> |
|
| 220 |
-September 2015, updated by Sally O'Malley <somalley@redhat.com> |
| 221 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,63 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-push - Push an image or a repository to a registry |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker push** |
|
| 9 |
-[**--help**] |
|
| 10 |
-NAME[:TAG] | [REGISTRY_HOST[:REGISTRY_PORT]/]NAME[:TAG] |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
- |
|
| 14 |
-Use `docker push` to share your images to the [Docker Hub](https://hub.docker.com) |
|
| 15 |
-registry or to a self-hosted one. |
|
| 16 |
- |
|
| 17 |
-Refer to **docker-tag(1)** for more information about valid image and tag names. |
|
| 18 |
- |
|
| 19 |
-Killing the **docker push** process, for example by pressing **CTRL-c** while it |
|
| 20 |
-is running in a terminal, terminates the push operation. |
|
| 21 |
- |
|
| 22 |
-Registry credentials are managed by **docker-login(1)**. |
|
| 23 |
- |
|
| 24 |
- |
|
| 25 |
-# OPTIONS |
|
| 26 |
- |
|
| 27 |
-**--disable-content-trust** |
|
| 28 |
- Skip image verification (default true) |
|
| 29 |
- |
|
| 30 |
-**--help** |
|
| 31 |
- Print usage statement |
|
| 32 |
- |
|
| 33 |
-# EXAMPLES |
|
| 34 |
- |
|
| 35 |
-## Pushing a new image to a registry |
|
| 36 |
- |
|
| 37 |
-First save the new image by finding the container ID (using **docker ps**) |
|
| 38 |
-and then committing it to a new image name. Note that only a-z0-9-_. are |
|
| 39 |
-allowed when naming images: |
|
| 40 |
- |
|
| 41 |
- # docker commit c16378f943fe rhel-httpd |
|
| 42 |
- |
|
| 43 |
-Now, push the image to the registry using the image ID. In this example the |
|
| 44 |
-registry is on host named `registry-host` and listening on port `5000`. To do |
|
| 45 |
-this, tag the image with the host name or IP address, and the port of the |
|
| 46 |
-registry: |
|
| 47 |
- |
|
| 48 |
- # docker tag rhel-httpd registry-host:5000/myadmin/rhel-httpd |
|
| 49 |
- # docker push registry-host:5000/myadmin/rhel-httpd |
|
| 50 |
- |
|
| 51 |
-Check that this worked by running: |
|
| 52 |
- |
|
| 53 |
- # docker images |
|
| 54 |
- |
|
| 55 |
-You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd` |
|
| 56 |
-listed. |
|
| 57 |
- |
|
| 58 |
-# HISTORY |
|
| 59 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 60 |
-based on docker.com source material and internal work. |
|
| 61 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 62 |
-April 2015, updated by Mary Anthony for v2 <mary@docker.com> |
|
| 63 |
-June 2015, updated by Sally O'Malley <somalley@redhat.com> |
| 64 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,15 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% OCTOBER 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-rename - Rename a container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker rename** |
|
| 9 |
-CONTAINER NEW_NAME |
|
| 10 |
- |
|
| 11 |
-# OPTIONS |
|
| 12 |
-There are no available options. |
|
| 13 |
- |
|
| 14 |
-# DESCRIPTION |
|
| 15 |
-Rename a container. Container may be running, paused or stopped. |
| 16 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,26 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-restart - Restart one or more containers |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker restart** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-t**|**--time**[=*10*]] |
|
| 11 |
-CONTAINER [CONTAINER...] |
|
| 12 |
- |
|
| 13 |
-# DESCRIPTION |
|
| 14 |
-Restart each container listed. |
|
| 15 |
- |
|
| 16 |
-# OPTIONS |
|
| 17 |
-**--help** |
|
| 18 |
- Print usage statement |
|
| 19 |
- |
|
| 20 |
-**-t**, **--time**=*10* |
|
| 21 |
- Number of seconds to try to stop for before killing the container. Once killed it will then be restarted. Default is 10 seconds. |
|
| 22 |
- |
|
| 23 |
-# HISTORY |
|
| 24 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 25 |
-based on docker.com source material and internal work. |
|
| 26 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 27 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,72 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-rm - Remove one or more containers |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker rm** |
|
| 9 |
-[**-f**|**--force**] |
|
| 10 |
-[**-l**|**--link**] |
|
| 11 |
-[**-v**|**--volumes**] |
|
| 12 |
-CONTAINER [CONTAINER...] |
|
| 13 |
- |
|
| 14 |
-# DESCRIPTION |
|
| 15 |
- |
|
| 16 |
-**docker rm** will remove one or more containers from the host node. The |
|
| 17 |
-container name or ID can be used. This does not remove images. You cannot |
|
| 18 |
-remove a running container unless you use the **-f** option. To see all |
|
| 19 |
-containers on a host use the **docker ps -a** command. |
|
| 20 |
- |
|
| 21 |
-# OPTIONS |
|
| 22 |
-**--help** |
|
| 23 |
- Print usage statement |
|
| 24 |
- |
|
| 25 |
-**-f**, **--force**=*true*|*false* |
|
| 26 |
- Force the removal of a running container (uses SIGKILL). The default is *false*. |
|
| 27 |
- |
|
| 28 |
-**-l**, **--link**=*true*|*false* |
|
| 29 |
- Remove the specified link and not the underlying container. The default is *false*. |
|
| 30 |
- |
|
| 31 |
-**-v**, **--volumes**=*true*|*false* |
|
| 32 |
- Remove the volumes associated with the container. The default is *false*. |
|
| 33 |
- |
|
| 34 |
-# EXAMPLES |
|
| 35 |
- |
|
| 36 |
-## Removing a container using its ID |
|
| 37 |
- |
|
| 38 |
-To remove a container using its ID, find either from a **docker ps -a** |
|
| 39 |
-command, or use the ID returned from the **docker run** command, or retrieve |
|
| 40 |
-it from a file used to store it using the **docker run --cidfile**: |
|
| 41 |
- |
|
| 42 |
- docker rm abebf7571666 |
|
| 43 |
- |
|
| 44 |
-## Removing a container using the container name |
|
| 45 |
- |
|
| 46 |
-The name of the container can be found using the **docker ps -a** |
|
| 47 |
-command. The use that name as follows: |
|
| 48 |
- |
|
| 49 |
- docker rm hopeful_morse |
|
| 50 |
- |
|
| 51 |
-## Removing a container and all associated volumes |
|
| 52 |
- |
|
| 53 |
- $ docker rm -v redis |
|
| 54 |
- redis |
|
| 55 |
- |
|
| 56 |
-This command will remove the container and any volumes associated with it. |
|
| 57 |
-Note that if a volume was specified with a name, it will not be removed. |
|
| 58 |
- |
|
| 59 |
- $ docker create -v awesome:/foo -v /bar --name hello redis |
|
| 60 |
- hello |
|
| 61 |
- $ docker rm -v hello |
|
| 62 |
- |
|
| 63 |
-In this example, the volume for `/foo` will remain in tact, but the volume for |
|
| 64 |
-`/bar` will be removed. The same behavior holds for volumes inherited with |
|
| 65 |
-`--volumes-from`. |
|
| 66 |
- |
|
| 67 |
-# HISTORY |
|
| 68 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 69 |
-based on docker.com source material and internal work. |
|
| 70 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 71 |
-July 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 72 |
-August 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 73 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,42 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-rmi - Remove one or more images |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker rmi** |
|
| 9 |
-[**-f**|**--force**] |
|
| 10 |
-[**--help**] |
|
| 11 |
-[**--no-prune**] |
|
| 12 |
-IMAGE [IMAGE...] |
|
| 13 |
- |
|
| 14 |
-# DESCRIPTION |
|
| 15 |
- |
|
| 16 |
-Removes one or more images from the host node. This does not remove images from |
|
| 17 |
-a registry. You cannot remove an image of a running container unless you use the |
|
| 18 |
-**-f** option. To see all images on a host use the **docker images** command. |
|
| 19 |
- |
|
| 20 |
-# OPTIONS |
|
| 21 |
-**-f**, **--force**=*true*|*false* |
|
| 22 |
- Force removal of the image. The default is *false*. |
|
| 23 |
- |
|
| 24 |
-**--help** |
|
| 25 |
- Print usage statement |
|
| 26 |
- |
|
| 27 |
-**--no-prune**=*true*|*false* |
|
| 28 |
- Do not delete untagged parents. The default is *false*. |
|
| 29 |
- |
|
| 30 |
-# EXAMPLES |
|
| 31 |
- |
|
| 32 |
-## Removing an image |
|
| 33 |
- |
|
| 34 |
-Here is an example of removing an image: |
|
| 35 |
- |
|
| 36 |
- docker rmi fedora/httpd |
|
| 37 |
- |
|
| 38 |
-# HISTORY |
|
| 39 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 40 |
-based on docker.com source material and internal work. |
|
| 41 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 42 |
-April 2015, updated by Mary Anthony for v2 <mary@docker.com> |
| 43 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,45 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-save - Save one or more images to a tar archive (streamed to STDOUT by default) |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker save** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-o**|**--output**[=*OUTPUT*]] |
|
| 11 |
-IMAGE [IMAGE...] |
|
| 12 |
- |
|
| 13 |
-# DESCRIPTION |
|
| 14 |
-Produces a tarred repository to the standard output stream. Contains all |
|
| 15 |
-parent layers, and all tags + versions, or specified repo:tag. |
|
| 16 |
- |
|
| 17 |
-Stream to a file instead of STDOUT by using **-o**. |
|
| 18 |
- |
|
| 19 |
-# OPTIONS |
|
| 20 |
-**--help** |
|
| 21 |
- Print usage statement |
|
| 22 |
- |
|
| 23 |
-**-o**, **--output**="" |
|
| 24 |
- Write to a file, instead of STDOUT |
|
| 25 |
- |
|
| 26 |
-# EXAMPLES |
|
| 27 |
- |
|
| 28 |
-Save all fedora repository images to a fedora-all.tar and save the latest |
|
| 29 |
-fedora image to a fedora-latest.tar: |
|
| 30 |
- |
|
| 31 |
- $ docker save fedora > fedora-all.tar |
|
| 32 |
- $ docker save --output=fedora-latest.tar fedora:latest |
|
| 33 |
- $ ls -sh fedora-all.tar |
|
| 34 |
- 721M fedora-all.tar |
|
| 35 |
- $ ls -sh fedora-latest.tar |
|
| 36 |
- 367M fedora-latest.tar |
|
| 37 |
- |
|
| 38 |
-# See also |
|
| 39 |
-**docker-load(1)** to load an image from a tar archive on STDIN. |
|
| 40 |
- |
|
| 41 |
-# HISTORY |
|
| 42 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 43 |
-based on docker.com source material and internal work. |
|
| 44 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 45 |
-November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 46 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,70 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-search - Search the Docker Hub for images |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker search** |
|
| 9 |
-[**-f**|**--filter**[=*[]*]] |
|
| 10 |
-[**--help**] |
|
| 11 |
-[**--limit**[=*LIMIT*]] |
|
| 12 |
-[**--no-trunc**] |
|
| 13 |
-TERM |
|
| 14 |
- |
|
| 15 |
-# DESCRIPTION |
|
| 16 |
- |
|
| 17 |
-Search Docker Hub for images that match the specified `TERM`. The table |
|
| 18 |
-of images returned displays the name, description (truncated by default), number |
|
| 19 |
-of stars awarded, whether the image is official, and whether it is automated. |
|
| 20 |
- |
|
| 21 |
-*Note* - Search queries will only return up to 25 results |
|
| 22 |
- |
|
| 23 |
-# OPTIONS |
|
| 24 |
- |
|
| 25 |
-**-f**, **--filter**=[] |
|
| 26 |
- Filter output based on these conditions: |
|
| 27 |
- - stars=<numberOfStar> |
|
| 28 |
- - is-automated=(true|false) |
|
| 29 |
- - is-official=(true|false) |
|
| 30 |
- |
|
| 31 |
-**--help** |
|
| 32 |
- Print usage statement |
|
| 33 |
- |
|
| 34 |
-**--limit**=*LIMIT* |
|
| 35 |
- Maximum returned search results. The default is 25. |
|
| 36 |
- |
|
| 37 |
-**--no-trunc**=*true*|*false* |
|
| 38 |
- Don't truncate output. The default is *false*. |
|
| 39 |
- |
|
| 40 |
-# EXAMPLES |
|
| 41 |
- |
|
| 42 |
-## Search Docker Hub for ranked images |
|
| 43 |
- |
|
| 44 |
-Search a registry for the term 'fedora' and only display those images |
|
| 45 |
-ranked 3 or higher: |
|
| 46 |
- |
|
| 47 |
- $ docker search --filter=stars=3 fedora |
|
| 48 |
- NAME DESCRIPTION STARS OFFICIAL AUTOMATED |
|
| 49 |
- mattdm/fedora A basic Fedora image corresponding roughly... 50 |
|
| 50 |
- fedora (Semi) Official Fedora base image. 38 |
|
| 51 |
- mattdm/fedora-small A small Fedora image on which to build. Co... 8 |
|
| 52 |
- goldmann/wildfly A WildFly application server running on a ... 3 [OK] |
|
| 53 |
- |
|
| 54 |
-## Search Docker Hub for automated images |
|
| 55 |
- |
|
| 56 |
-Search Docker Hub for the term 'fedora' and only display automated images |
|
| 57 |
-ranked 1 or higher: |
|
| 58 |
- |
|
| 59 |
- $ docker search --filter=is-automated=true --filter=stars=1 fedora |
|
| 60 |
- NAME DESCRIPTION STARS OFFICIAL AUTOMATED |
|
| 61 |
- goldmann/wildfly A WildFly application server running on a ... 3 [OK] |
|
| 62 |
- tutum/fedora-20 Fedora 20 image with SSH access. For the r... 1 [OK] |
|
| 63 |
- |
|
| 64 |
-# HISTORY |
|
| 65 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 66 |
-based on docker.com source material and internal work. |
|
| 67 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 68 |
-April 2015, updated by Mary Anthony for v2 <mary@docker.com> |
|
| 69 |
-April 2016, updated by Vincent Demeester <vincent@sbr.pm> |
|
| 70 |
- |
| 71 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,39 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-start - Start one or more containers |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker start** |
|
| 9 |
-[**-a**|**--attach**] |
|
| 10 |
-[**--detach-keys**[=*[]*]] |
|
| 11 |
-[**--help**] |
|
| 12 |
-[**-i**|**--interactive**] |
|
| 13 |
-CONTAINER [CONTAINER...] |
|
| 14 |
- |
|
| 15 |
-# DESCRIPTION |
|
| 16 |
- |
|
| 17 |
-Start one or more containers. |
|
| 18 |
- |
|
| 19 |
-# OPTIONS |
|
| 20 |
-**-a**, **--attach**=*true*|*false* |
|
| 21 |
- Attach container's STDOUT and STDERR and forward all signals to the |
|
| 22 |
- process. The default is *false*. |
|
| 23 |
- |
|
| 24 |
-**--detach-keys**="" |
|
| 25 |
- Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. |
|
| 26 |
- |
|
| 27 |
-**--help** |
|
| 28 |
- Print usage statement |
|
| 29 |
- |
|
| 30 |
-**-i**, **--interactive**=*true*|*false* |
|
| 31 |
- Attach container's STDIN. The default is *false*. |
|
| 32 |
- |
|
| 33 |
-# See also |
|
| 34 |
-**docker-stop(1)** to stop a container. |
|
| 35 |
- |
|
| 36 |
-# HISTORY |
|
| 37 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 38 |
-based on docker.com source material and internal work. |
|
| 39 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 40 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,57 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-stats - Display a live stream of one or more containers' resource usage statistics |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker stats** |
|
| 9 |
-[**-a**|**--all**] |
|
| 10 |
-[**--help**] |
|
| 11 |
-[**--no-stream**] |
|
| 12 |
-[**--format[="*TEMPLATE*"]**] |
|
| 13 |
-[CONTAINER...] |
|
| 14 |
- |
|
| 15 |
-# DESCRIPTION |
|
| 16 |
- |
|
| 17 |
-Display a live stream of one or more containers' resource usage statistics |
|
| 18 |
- |
|
| 19 |
-# OPTIONS |
|
| 20 |
-**-a**, **--all**=*true*|*false* |
|
| 21 |
- Show all containers. Only running containers are shown by default. The default is *false*. |
|
| 22 |
- |
|
| 23 |
-**--help** |
|
| 24 |
- Print usage statement |
|
| 25 |
- |
|
| 26 |
-**--no-stream**=*true*|*false* |
|
| 27 |
- Disable streaming stats and only pull the first result, default setting is false. |
|
| 28 |
- |
|
| 29 |
-**--format**="*TEMPLATE*" |
|
| 30 |
- Pretty-print containers statistics using a Go template. |
|
| 31 |
- Valid placeholders: |
|
| 32 |
- .Container - Container name or ID. |
|
| 33 |
- .Name - Container name. |
|
| 34 |
- .ID - Container ID. |
|
| 35 |
- .CPUPerc - CPU percentage. |
|
| 36 |
- .MemUsage - Memory usage. |
|
| 37 |
- .NetIO - Network IO. |
|
| 38 |
- .BlockIO - Block IO. |
|
| 39 |
- .MemPerc - Memory percentage (Not available on Windows). |
|
| 40 |
- .PIDs - Number of PIDs (Not available on Windows). |
|
| 41 |
- |
|
| 42 |
-# EXAMPLES |
|
| 43 |
- |
|
| 44 |
-Running `docker stats` on all running containers |
|
| 45 |
- |
|
| 46 |
- $ docker stats |
|
| 47 |
- CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O |
|
| 48 |
- 1285939c1fd3 0.07% 796 KiB / 64 MiB 1.21% 788 B / 648 B 3.568 MB / 512 KB |
|
| 49 |
- 9c76f7834ae2 0.07% 2.746 MiB / 64 MiB 4.29% 1.266 KB / 648 B 12.4 MB / 0 B |
|
| 50 |
- d1ea048f04e4 0.03% 4.583 MiB / 64 MiB 6.30% 2.854 KB / 648 B 27.7 MB / 0 B |
|
| 51 |
- |
|
| 52 |
-Running `docker stats` on multiple containers by name and id. |
|
| 53 |
- |
|
| 54 |
- $ docker stats fervent_panini 5acfcb1b4fd1 |
|
| 55 |
- CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O |
|
| 56 |
- 5acfcb1b4fd1 0.00% 115.2 MiB/1.045 GiB 11.03% 1.422 kB/648 B |
|
| 57 |
- fervent_panini 0.02% 11.08 MiB/1.045 GiB 1.06% 648 B/648 B |
| 58 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,30 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-stop - Stop a container by sending SIGTERM and then SIGKILL after a grace period |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker stop** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-t**|**--time**[=*10*]] |
|
| 11 |
-CONTAINER [CONTAINER...] |
|
| 12 |
- |
|
| 13 |
-# DESCRIPTION |
|
| 14 |
-Stop a container (Send SIGTERM, and then SIGKILL after |
|
| 15 |
- grace period) |
|
| 16 |
- |
|
| 17 |
-# OPTIONS |
|
| 18 |
-**--help** |
|
| 19 |
- Print usage statement |
|
| 20 |
- |
|
| 21 |
-**-t**, **--time**=*10* |
|
| 22 |
- Number of seconds to wait for the container to stop before killing it. Default is 10 seconds. |
|
| 23 |
- |
|
| 24 |
-#See also |
|
| 25 |
-**docker-start(1)** to restart a stopped container. |
|
| 26 |
- |
|
| 27 |
-# HISTORY |
|
| 28 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 29 |
-based on docker.com source material and internal work. |
|
| 30 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 31 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,76 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-tag - Create a tag `TARGET_IMAGE` that refers to `SOURCE_IMAGE` |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker tag** |
|
| 9 |
-[**--help**] |
|
| 10 |
-SOURCE_NAME[:TAG] TARGET_NAME[:TAG] |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
-Assigns a new alias to an image in a registry. An alias refers to the |
|
| 14 |
-entire image name including the optional `TAG` after the ':'. |
|
| 15 |
- |
|
| 16 |
-# "OPTIONS" |
|
| 17 |
-**--help** |
|
| 18 |
- Print usage statement. |
|
| 19 |
- |
|
| 20 |
-**NAME** |
|
| 21 |
- The image name which is made up of slash-separated name components, |
|
| 22 |
- optionally prefixed by a registry hostname. The hostname must comply with |
|
| 23 |
- standard DNS rules, but may not contain underscores. If a hostname is |
|
| 24 |
- present, it may optionally be followed by a port number in the format |
|
| 25 |
- `:8080`. If not present, the command uses Docker's public registry located at |
|
| 26 |
- `registry-1.docker.io` by default. Name components may contain lowercase |
|
| 27 |
- characters, digits and separators. A separator is defined as a period, one or |
|
| 28 |
- two underscores, or one or more dashes. A name component may not start or end |
|
| 29 |
- with a separator. |
|
| 30 |
- |
|
| 31 |
-**TAG** |
|
| 32 |
- The tag assigned to the image to version and distinguish images with the same |
|
| 33 |
- name. The tag name may contain lowercase and uppercase characters, digits, |
|
| 34 |
- underscores, periods and dashes. A tag name may not start with a period or a |
|
| 35 |
- dash and may contain a maximum of 128 characters. |
|
| 36 |
- |
|
| 37 |
-# EXAMPLES |
|
| 38 |
- |
|
| 39 |
-## Tagging an image referenced by ID |
|
| 40 |
- |
|
| 41 |
-To tag a local image with ID "0e5574283393" into the "fedora" repository with |
|
| 42 |
-"version1.0": |
|
| 43 |
- |
|
| 44 |
- docker tag 0e5574283393 fedora/httpd:version1.0 |
|
| 45 |
- |
|
| 46 |
-## Tagging an image referenced by Name |
|
| 47 |
- |
|
| 48 |
-To tag a local image with name "httpd" into the "fedora" repository with |
|
| 49 |
-"version1.0": |
|
| 50 |
- |
|
| 51 |
- docker tag httpd fedora/httpd:version1.0 |
|
| 52 |
- |
|
| 53 |
-Note that since the tag name is not specified, the alias is created for an |
|
| 54 |
-existing local version `httpd:latest`. |
|
| 55 |
- |
|
| 56 |
-## Tagging an image referenced by Name and Tag |
|
| 57 |
- |
|
| 58 |
-To tag a local image with name "httpd" and tag "test" into the "fedora" |
|
| 59 |
-repository with "version1.0.test": |
|
| 60 |
- |
|
| 61 |
- docker tag httpd:test fedora/httpd:version1.0.test |
|
| 62 |
- |
|
| 63 |
-## Tagging an image for a private repository |
|
| 64 |
- |
|
| 65 |
-To push an image to a private registry and not the central Docker |
|
| 66 |
-registry you must tag it with the registry hostname and port (if needed). |
|
| 67 |
- |
|
| 68 |
- docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0 |
|
| 69 |
- |
|
| 70 |
-# HISTORY |
|
| 71 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 72 |
-based on docker.com source material and internal work. |
|
| 73 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 74 |
-July 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 75 |
-April 2015, updated by Mary Anthony for v2 <mary@docker.com> |
|
| 76 |
-June 2015, updated by Sally O'Malley <somalley@redhat.com> |
| 77 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,36 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-top - Display the running processes of a container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker top** |
|
| 9 |
-[**--help**] |
|
| 10 |
-CONTAINER [ps OPTIONS] |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
- |
|
| 14 |
-Display the running process of the container. ps-OPTION can be any of the options you would pass to a Linux ps command. |
|
| 15 |
- |
|
| 16 |
-All displayed information is from host's point of view. |
|
| 17 |
- |
|
| 18 |
-# OPTIONS |
|
| 19 |
-**--help** |
|
| 20 |
- Print usage statement |
|
| 21 |
- |
|
| 22 |
-# EXAMPLES |
|
| 23 |
- |
|
| 24 |
-Run **docker top** with the ps option of -x: |
|
| 25 |
- |
|
| 26 |
- $ docker top 8601afda2b -x |
|
| 27 |
- PID TTY STAT TIME COMMAND |
|
| 28 |
- 16623 ? Ss 0:00 sleep 99999 |
|
| 29 |
- |
|
| 30 |
- |
|
| 31 |
-# HISTORY |
|
| 32 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 33 |
-based on docker.com source material and internal work. |
|
| 34 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 35 |
-June 2015, updated by Ma Shimiao <mashimiao.fnst@cn.fujitsu.com> |
|
| 36 |
-December 2015, updated by Pavel Pospisil <pospispa@gmail.com> |
| 37 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,28 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-unpause - Unpause all processes within one or more containers |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker unpause** |
|
| 9 |
-CONTAINER [CONTAINER...] |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
- |
|
| 13 |
-The `docker unpause` command un-suspends all processes in the specified containers. |
|
| 14 |
-On Linux, it does this using the cgroups freezer. |
|
| 15 |
- |
|
| 16 |
-See the [cgroups freezer documentation] |
|
| 17 |
-(https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) for |
|
| 18 |
-further details. |
|
| 19 |
- |
|
| 20 |
-# OPTIONS |
|
| 21 |
-**--help** |
|
| 22 |
- Print usage statement |
|
| 23 |
- |
|
| 24 |
-# See also |
|
| 25 |
-**docker-pause(1)** to pause all processes within one or more containers. |
|
| 26 |
- |
|
| 27 |
-# HISTORY |
|
| 28 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 29 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,171 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-update - Update configuration of one or more containers |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker update** |
|
| 9 |
-[**--blkio-weight**[=*[BLKIO-WEIGHT]*]] |
|
| 10 |
-[**--cpu-shares**[=*0*]] |
|
| 11 |
-[**--cpu-period**[=*0*]] |
|
| 12 |
-[**--cpu-quota**[=*0*]] |
|
| 13 |
-[**--cpu-rt-period**[=*0*]] |
|
| 14 |
-[**--cpu-rt-runtime**[=*0*]] |
|
| 15 |
-[**--cpuset-cpus**[=*CPUSET-CPUS*]] |
|
| 16 |
-[**--cpuset-mems**[=*CPUSET-MEMS*]] |
|
| 17 |
-[**--help**] |
|
| 18 |
-[**--kernel-memory**[=*KERNEL-MEMORY*]] |
|
| 19 |
-[**-m**|**--memory**[=*MEMORY*]] |
|
| 20 |
-[**--memory-reservation**[=*MEMORY-RESERVATION*]] |
|
| 21 |
-[**--memory-swap**[=*MEMORY-SWAP*]] |
|
| 22 |
-[**--restart**[=*""*]] |
|
| 23 |
-CONTAINER [CONTAINER...] |
|
| 24 |
- |
|
| 25 |
-# DESCRIPTION |
|
| 26 |
- |
|
| 27 |
-The **docker update** command dynamically updates container configuration. |
|
| 28 |
-You can use this command to prevent containers from consuming too many |
|
| 29 |
-resources from their Docker host. With a single command, you can place |
|
| 30 |
-limits on a single container or on many. To specify more than one container, |
|
| 31 |
-provide space-separated list of container names or IDs. |
|
| 32 |
- |
|
| 33 |
-With the exception of the **--kernel-memory** option, you can specify these |
|
| 34 |
-options on a running or a stopped container. On kernel version older than |
|
| 35 |
-4.6, You can only update **--kernel-memory** on a stopped container or on |
|
| 36 |
-a running container with kernel memory initialized. |
|
| 37 |
- |
|
| 38 |
-# OPTIONS |
|
| 39 |
- |
|
| 40 |
-**--blkio-weight**=0 |
|
| 41 |
- Block IO weight (relative weight) accepts a weight value between 10 and 1000. |
|
| 42 |
- |
|
| 43 |
-**--cpu-shares**=0 |
|
| 44 |
- CPU shares (relative weight) |
|
| 45 |
- |
|
| 46 |
-**--cpu-period**=0 |
|
| 47 |
- Limit the CPU CFS (Completely Fair Scheduler) period |
|
| 48 |
- |
|
| 49 |
- Limit the container's CPU usage. This flag tell the kernel to restrict the container's CPU usage to the period you specify. |
|
| 50 |
- |
|
| 51 |
-**--cpu-quota**=0 |
|
| 52 |
- Limit the CPU CFS (Completely Fair Scheduler) quota |
|
| 53 |
- |
|
| 54 |
-**--cpu-rt-period**=0 |
|
| 55 |
- Limit the CPU real-time period in microseconds |
|
| 56 |
- |
|
| 57 |
- Limit the container's Real Time CPU usage. This flag tell the kernel to restrict the container's Real Time CPU usage to the period you specify. |
|
| 58 |
- |
|
| 59 |
-**--cpu-rt-runtime**=0 |
|
| 60 |
- Limit the CPU real-time runtime in microseconds |
|
| 61 |
- |
|
| 62 |
- Limit the containers Real Time CPU usage. This flag tells the kernel to limit the amount of time in a given CPU period Real Time tasks may consume. Ex: |
|
| 63 |
- Period of 1,000,000us and Runtime of 950,000us means that this container could consume 95% of available CPU and leave the remaining 5% to normal priority tasks. |
|
| 64 |
- |
|
| 65 |
- The sum of all runtimes across containers cannot exceed the amount allotted to the parent cgroup. |
|
| 66 |
- |
|
| 67 |
-**--cpuset-cpus**="" |
|
| 68 |
- CPUs in which to allow execution (0-3, 0,1) |
|
| 69 |
- |
|
| 70 |
-**--cpuset-mems**="" |
|
| 71 |
- Memory nodes(MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. |
|
| 72 |
- |
|
| 73 |
-**--help** |
|
| 74 |
- Print usage statement |
|
| 75 |
- |
|
| 76 |
-**--kernel-memory**="" |
|
| 77 |
- Kernel memory limit (format: `<number>[<unit>]`, where unit = b, k, m or g) |
|
| 78 |
- |
|
| 79 |
- Note that on kernel version older than 4.6, you can not update kernel memory on |
|
| 80 |
- a running container if the container is started without kernel memory initialized, |
|
| 81 |
- in this case, it can only be updated after it's stopped. The new setting takes |
|
| 82 |
- effect when the container is started. |
|
| 83 |
- |
|
| 84 |
-**-m**, **--memory**="" |
|
| 85 |
- Memory limit (format: <number><optional unit>, where unit = b, k, m or g) |
|
| 86 |
- |
|
| 87 |
- Note that the memory should be smaller than the already set swap memory limit. |
|
| 88 |
- If you want update a memory limit bigger than the already set swap memory limit, |
|
| 89 |
- you should update swap memory limit at the same time. If you don't set swap memory |
|
| 90 |
- limit on docker create/run but only memory limit, the swap memory is double |
|
| 91 |
- the memory limit. |
|
| 92 |
- |
|
| 93 |
-**--memory-reservation**="" |
|
| 94 |
- Memory soft limit (format: <number>[<unit>], where unit = b, k, m or g) |
|
| 95 |
- |
|
| 96 |
-**--memory-swap**="" |
|
| 97 |
- Total memory limit (memory + swap) |
|
| 98 |
- |
|
| 99 |
-**--restart**="" |
|
| 100 |
- Restart policy to apply when a container exits (no, on-failure[:max-retry], always, unless-stopped). |
|
| 101 |
- |
|
| 102 |
-# EXAMPLES |
|
| 103 |
- |
|
| 104 |
-The following sections illustrate ways to use this command. |
|
| 105 |
- |
|
| 106 |
-### Update a container's cpu-shares |
|
| 107 |
- |
|
| 108 |
-To limit a container's cpu-shares to 512, first identify the container |
|
| 109 |
-name or ID. You can use **docker ps** to find these values. You can also |
|
| 110 |
-use the ID returned from the **docker run** command. Then, do the following: |
|
| 111 |
- |
|
| 112 |
-```bash |
|
| 113 |
-$ docker update --cpu-shares 512 abebf7571666 |
|
| 114 |
-``` |
|
| 115 |
- |
|
| 116 |
-### Update a container with cpu-shares and memory |
|
| 117 |
- |
|
| 118 |
-To update multiple resource configurations for multiple containers: |
|
| 119 |
- |
|
| 120 |
-```bash |
|
| 121 |
-$ docker update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse |
|
| 122 |
-``` |
|
| 123 |
- |
|
| 124 |
-### Update a container's kernel memory constraints |
|
| 125 |
- |
|
| 126 |
-You can update a container's kernel memory limit using the **--kernel-memory** |
|
| 127 |
-option. On kernel version older than 4.6, this option can be updated on a |
|
| 128 |
-running container only if the container was started with **--kernel-memory**. |
|
| 129 |
-If the container was started *without* **--kernel-memory** you need to stop |
|
| 130 |
-the container before updating kernel memory. |
|
| 131 |
- |
|
| 132 |
-For example, if you started a container with this command: |
|
| 133 |
- |
|
| 134 |
-```bash |
|
| 135 |
-$ docker run -dit --name test --kernel-memory 50M ubuntu bash |
|
| 136 |
-``` |
|
| 137 |
- |
|
| 138 |
-You can update kernel memory while the container is running: |
|
| 139 |
- |
|
| 140 |
-```bash |
|
| 141 |
-$ docker update --kernel-memory 80M test |
|
| 142 |
-``` |
|
| 143 |
- |
|
| 144 |
-If you started a container *without* kernel memory initialized: |
|
| 145 |
- |
|
| 146 |
-```bash |
|
| 147 |
-$ docker run -dit --name test2 --memory 300M ubuntu bash |
|
| 148 |
-``` |
|
| 149 |
- |
|
| 150 |
-Update kernel memory of running container `test2` will fail. You need to stop |
|
| 151 |
-the container before updating the **--kernel-memory** setting. The next time you |
|
| 152 |
-start it, the container uses the new value. |
|
| 153 |
- |
|
| 154 |
-Kernel version newer than (include) 4.6 does not have this limitation, you |
|
| 155 |
-can use `--kernel-memory` the same way as other options. |
|
| 156 |
- |
|
| 157 |
-### Update a container's restart policy |
|
| 158 |
- |
|
| 159 |
-You can change a container's restart policy on a running container. The new |
|
| 160 |
-restart policy takes effect instantly after you run `docker update` on a |
|
| 161 |
-container. |
|
| 162 |
- |
|
| 163 |
-To update restart policy for one or more containers: |
|
| 164 |
- |
|
| 165 |
-```bash |
|
| 166 |
-$ docker update --restart=on-failure:3 abebf7571666 hopeful_morse |
|
| 167 |
-``` |
|
| 168 |
- |
|
| 169 |
-Note that if the container is started with "--rm" flag, you cannot update the restart |
|
| 170 |
-policy for it. The `AutoRemove` and `RestartPolicy` are mutually exclusive for the |
|
| 171 |
-container. |
| 172 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,62 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2015 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-version - Show the Docker version information. |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker version** |
|
| 9 |
-[**--help**] |
|
| 10 |
-[**-f**|**--format**[=*FORMAT*]] |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
-This command displays version information for both the Docker client and |
|
| 14 |
-daemon. |
|
| 15 |
- |
|
| 16 |
-# OPTIONS |
|
| 17 |
-**--help** |
|
| 18 |
- Print usage statement |
|
| 19 |
- |
|
| 20 |
-**-f**, **--format**="" |
|
| 21 |
- Format the output using the given Go template. |
|
| 22 |
- |
|
| 23 |
-# EXAMPLES |
|
| 24 |
- |
|
| 25 |
-## Display Docker version information |
|
| 26 |
- |
|
| 27 |
-The default output: |
|
| 28 |
- |
|
| 29 |
- $ docker version |
|
| 30 |
- Client: |
|
| 31 |
- Version: 1.8.0 |
|
| 32 |
- API version: 1.20 |
|
| 33 |
- Go version: go1.4.2 |
|
| 34 |
- Git commit: f5bae0a |
|
| 35 |
- Built: Tue Jun 23 17:56:00 UTC 2015 |
|
| 36 |
- OS/Arch: linux/amd64 |
|
| 37 |
- |
|
| 38 |
- Server: |
|
| 39 |
- Version: 1.8.0 |
|
| 40 |
- API version: 1.20 |
|
| 41 |
- Go version: go1.4.2 |
|
| 42 |
- Git commit: f5bae0a |
|
| 43 |
- Built: Tue Jun 23 17:56:00 UTC 2015 |
|
| 44 |
- OS/Arch: linux/amd64 |
|
| 45 |
- |
|
| 46 |
-Get server version: |
|
| 47 |
- |
|
| 48 |
- $ docker version --format '{{.Server.Version}}'
|
|
| 49 |
- 1.8.0 |
|
| 50 |
- |
|
| 51 |
-Dump raw data: |
|
| 52 |
- |
|
| 53 |
-To view all available fields, you can use the format `{{json .}}`.
|
|
| 54 |
- |
|
| 55 |
- $ docker version --format '{{json .}}'
|
|
| 56 |
- {"Client":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"},"ServerOK":true,"Server":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","KernelVersion":"3.13.2-gentoo","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"}}
|
|
| 57 |
- |
|
| 58 |
- |
|
| 59 |
-# HISTORY |
|
| 60 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
|
| 61 |
-June 2015, updated by John Howard <jhoward@microsoft.com> |
|
| 62 |
-June 2015, updated by Patrick Hemmer <patrick.hemmer@gmail.com> |
| 63 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,30 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% Docker Community |
|
| 3 |
-% JUNE 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-wait - Block until one or more containers stop, then print their exit codes |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker wait** |
|
| 9 |
-[**--help**] |
|
| 10 |
-CONTAINER [CONTAINER...] |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
- |
|
| 14 |
-Block until one or more containers stop, then print their exit codes. |
|
| 15 |
- |
|
| 16 |
-# OPTIONS |
|
| 17 |
-**--help** |
|
| 18 |
- Print usage statement |
|
| 19 |
- |
|
| 20 |
-# EXAMPLES |
|
| 21 |
- |
|
| 22 |
- $ docker run -d fedora sleep 99 |
|
| 23 |
- 079b83f558a2bc52ecad6b2a5de13622d584e6bb1aea058c11b36511e85e7622 |
|
| 24 |
- $ docker wait 079b83f558a2bc |
|
| 25 |
- 0 |
|
| 26 |
- |
|
| 27 |
-# HISTORY |
|
| 28 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 29 |
-based on docker.com source material and internal work. |
|
| 30 |
-June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| ... | ... |
@@ -2,16 +2,22 @@ package main |
| 2 | 2 |
|
| 3 | 3 |
import ( |
| 4 | 4 |
"fmt" |
| 5 |
+ "io/ioutil" |
|
| 6 |
+ "log" |
|
| 5 | 7 |
"os" |
| 8 |
+ "path/filepath" |
|
| 6 | 9 |
|
| 7 | 10 |
"github.com/docker/docker/cli/command" |
| 8 | 11 |
"github.com/docker/docker/cli/command/commands" |
| 9 | 12 |
"github.com/docker/docker/pkg/term" |
| 10 | 13 |
"github.com/spf13/cobra" |
| 11 | 14 |
"github.com/spf13/cobra/doc" |
| 15 |
+ "github.com/spf13/pflag" |
|
| 12 | 16 |
) |
| 13 | 17 |
|
| 14 |
-func generateManPages(path string) error {
|
|
| 18 |
+const descriptionSourcePath = "man/src/" |
|
| 19 |
+ |
|
| 20 |
+func generateManPages(opts *options) error {
|
|
| 15 | 21 |
header := &doc.GenManHeader{
|
| 16 | 22 |
Title: "DOCKER", |
| 17 | 23 |
Section: "1", |
| ... | ... |
@@ -22,22 +28,67 @@ func generateManPages(path string) error {
|
| 22 | 22 |
dockerCli := command.NewDockerCli(stdin, stdout, stderr) |
| 23 | 23 |
cmd := &cobra.Command{Use: "docker"}
|
| 24 | 24 |
commands.AddCommands(cmd, dockerCli) |
| 25 |
+ source := filepath.Join(opts.source, descriptionSourcePath) |
|
| 26 |
+ if err := loadLongDescription(cmd, source); err != nil {
|
|
| 27 |
+ return err |
|
| 28 |
+ } |
|
| 25 | 29 |
|
| 26 | 30 |
cmd.DisableAutoGenTag = true |
| 27 | 31 |
return doc.GenManTreeFromOpts(cmd, doc.GenManTreeOptions{
|
| 28 | 32 |
Header: header, |
| 29 |
- Path: path, |
|
| 33 |
+ Path: opts.target, |
|
| 30 | 34 |
CommandSeparator: "-", |
| 31 | 35 |
}) |
| 32 | 36 |
} |
| 33 | 37 |
|
| 38 |
+func loadLongDescription(cmd *cobra.Command, path string) error {
|
|
| 39 |
+ for _, cmd := range cmd.Commands() {
|
|
| 40 |
+ if cmd.Name() == "" {
|
|
| 41 |
+ continue |
|
| 42 |
+ } |
|
| 43 |
+ fullpath := filepath.Join(path, cmd.Name()+".md") |
|
| 44 |
+ |
|
| 45 |
+ if cmd.HasSubCommands() {
|
|
| 46 |
+ loadLongDescription(cmd, filepath.Join(path, cmd.Name())) |
|
| 47 |
+ } |
|
| 48 |
+ |
|
| 49 |
+ if _, err := os.Stat(fullpath); err != nil {
|
|
| 50 |
+ log.Printf("WARN: %s does not exist, skipping\n", fullpath)
|
|
| 51 |
+ continue |
|
| 52 |
+ } |
|
| 53 |
+ |
|
| 54 |
+ content, err := ioutil.ReadFile(fullpath) |
|
| 55 |
+ if err != nil {
|
|
| 56 |
+ return err |
|
| 57 |
+ } |
|
| 58 |
+ cmd.Long = string(content) |
|
| 59 |
+ } |
|
| 60 |
+ return nil |
|
| 61 |
+} |
|
| 62 |
+ |
|
| 63 |
+type options struct {
|
|
| 64 |
+ source string |
|
| 65 |
+ target string |
|
| 66 |
+} |
|
| 67 |
+ |
|
| 68 |
+func parseArgs() (*options, error) {
|
|
| 69 |
+ opts := &options{}
|
|
| 70 |
+ cwd, _ := os.Getwd() |
|
| 71 |
+ flags := pflag.NewFlagSet(os.Args[0], pflag.ContinueOnError) |
|
| 72 |
+ flags.StringVar(&opts.source, "root", cwd, "Path to project root") |
|
| 73 |
+ flags.StringVar(&opts.target, "target", "/tmp", "Target path for generated man pages") |
|
| 74 |
+ err := flags.Parse(os.Args[1:]) |
|
| 75 |
+ return opts, err |
|
| 76 |
+} |
|
| 77 |
+ |
|
| 34 | 78 |
func main() {
|
| 35 |
- path := "/tmp" |
|
| 36 |
- if len(os.Args) > 1 {
|
|
| 37 |
- path = os.Args[1] |
|
| 79 |
+ opts, err := parseArgs() |
|
| 80 |
+ if err != nil {
|
|
| 81 |
+ fmt.Fprintln(os.Stderr, err.Error()) |
|
| 38 | 82 |
} |
| 39 |
- fmt.Printf("Generating man pages into %s\n", path)
|
|
| 40 |
- if err := generateManPages(path); err != nil {
|
|
| 83 |
+ fmt.Printf("Project root: %s\n", opts.source)
|
|
| 84 |
+ fmt.Printf("Generating man pages into %s\n", opts.target)
|
|
| 85 |
+ if err := generateManPages(opts); err != nil {
|
|
| 41 | 86 |
fmt.Fprintf(os.Stderr, "Failed to generate man pages: %s\n", err.Error()) |
| 42 | 87 |
} |
| 43 | 88 |
} |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,66 @@ |
| 0 |
+The **docker attach** command allows you to attach to a running container using |
|
| 1 |
+the container's ID or name, either to view its ongoing output or to control it |
|
| 2 |
+interactively. You can attach to the same contained process multiple times |
|
| 3 |
+simultaneously, screen sharing style, or quickly view the progress of your |
|
| 4 |
+detached process. |
|
| 5 |
+ |
|
| 6 |
+To stop a container, use `CTRL-c`. This key sequence sends `SIGKILL` to the |
|
| 7 |
+container. You can detach from the container (and leave it running) using a |
|
| 8 |
+configurable key sequence. The default sequence is `CTRL-p CTRL-q`. You |
|
| 9 |
+configure the key sequence using the **--detach-keys** option or a configuration |
|
| 10 |
+file. See **config-json(5)** for documentation on using a configuration file. |
|
| 11 |
+ |
|
| 12 |
+It is forbidden to redirect the standard input of a `docker attach` command while |
|
| 13 |
+attaching to a tty-enabled container (i.e.: launched with `-t`). |
|
| 14 |
+ |
|
| 15 |
+# Override the detach sequence |
|
| 16 |
+ |
|
| 17 |
+If you want, you can configure an override the Docker key sequence for detach. |
|
| 18 |
+This is useful if the Docker default sequence conflicts with key sequence you |
|
| 19 |
+use for other applications. There are two ways to define your own detach key |
|
| 20 |
+sequence, as a per-container override or as a configuration property on your |
|
| 21 |
+entire configuration. |
|
| 22 |
+ |
|
| 23 |
+To override the sequence for an individual container, use the |
|
| 24 |
+`--detach-keys="<sequence>"` flag with the `docker attach` command. The format of |
|
| 25 |
+the `<sequence>` is either a letter [a-Z], or the `ctrl-` combined with any of |
|
| 26 |
+the following: |
|
| 27 |
+ |
|
| 28 |
+* `a-z` (a single lowercase alpha character ) |
|
| 29 |
+* `@` (at sign) |
|
| 30 |
+* `[` (left bracket) |
|
| 31 |
+* `\\` (two backward slashes) |
|
| 32 |
+* `_` (underscore) |
|
| 33 |
+* `^` (caret) |
|
| 34 |
+ |
|
| 35 |
+These `a`, `ctrl-a`, `X`, or `ctrl-\\` values are all examples of valid key |
|
| 36 |
+sequences. To configure a different configuration default key sequence for all |
|
| 37 |
+containers, see **docker(1)**. |
|
| 38 |
+ |
|
| 39 |
+# EXAMPLES |
|
| 40 |
+ |
|
| 41 |
+## Attaching to a container |
|
| 42 |
+ |
|
| 43 |
+In this example the top command is run inside a container, from an image called |
|
| 44 |
+fedora, in detached mode. The ID from the container is passed into the **docker |
|
| 45 |
+attach** command: |
|
| 46 |
+ |
|
| 47 |
+ # ID=$(sudo docker run -d fedora /usr/bin/top -b) |
|
| 48 |
+ # sudo docker attach $ID |
|
| 49 |
+ top - 02:05:52 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 |
|
| 50 |
+ Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie |
|
| 51 |
+ Cpu(s): 0.1%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st |
|
| 52 |
+ Mem: 373572k total, 355560k used, 18012k free, 27872k buffers |
|
| 53 |
+ Swap: 786428k total, 0k used, 786428k free, 221740k cached |
|
| 54 |
+ |
|
| 55 |
+ PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
|
| 56 |
+ 1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top |
|
| 57 |
+ |
|
| 58 |
+ top - 02:05:55 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 |
|
| 59 |
+ Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie |
|
| 60 |
+ Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st |
|
| 61 |
+ Mem: 373572k total, 355244k used, 18328k free, 27872k buffers |
|
| 62 |
+ Swap: 786428k total, 0k used, 786428k free, 221776k cached |
|
| 63 |
+ |
|
| 64 |
+ PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
|
| 65 |
+ 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top |
| 0 | 66 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,30 @@ |
| 0 |
+Create a new image from an existing container specified by name or |
|
| 1 |
+container ID. The new image will contain the contents of the |
|
| 2 |
+container filesystem, *excluding* any data volumes. Refer to **docker-tag(1)** |
|
| 3 |
+for more information about valid image and tag names. |
|
| 4 |
+ |
|
| 5 |
+While the `docker commit` command is a convenient way of extending an |
|
| 6 |
+existing image, you should prefer the use of a Dockerfile and `docker |
|
| 7 |
+build` for generating images that you intend to share with other |
|
| 8 |
+people. |
|
| 9 |
+ |
|
| 10 |
+# EXAMPLES |
|
| 11 |
+ |
|
| 12 |
+## Creating a new image from an existing container |
|
| 13 |
+An existing Fedora based container has had Apache installed while running |
|
| 14 |
+in interactive mode with the bash shell. Apache is also running. To |
|
| 15 |
+create a new image run `docker ps` to find the container's ID and then run: |
|
| 16 |
+ |
|
| 17 |
+ # docker commit -m="Added Apache to Fedora base image" \ |
|
| 18 |
+ -a="A D Ministrator" 98bd7fc99854 fedora/fedora_httpd:20 |
|
| 19 |
+ |
|
| 20 |
+Note that only a-z0-9-_. are allowed when naming images from an |
|
| 21 |
+existing container. |
|
| 22 |
+ |
|
| 23 |
+## Apply specified Dockerfile instructions while committing the image |
|
| 24 |
+If an existing container was created without the DEBUG environment |
|
| 25 |
+variable set to "true", you can create a new image based on that |
|
| 26 |
+container by first getting the container's ID with `docker ps` and |
|
| 27 |
+then running: |
|
| 28 |
+ |
|
| 29 |
+ # docker container commit -c="ENV DEBUG true" 98bd7fc99854 debug-image |
| 0 | 30 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,145 @@ |
| 0 |
+The `docker container cp` utility copies the contents of `SRC_PATH` to the `DEST_PATH`. |
|
| 1 |
+You can copy from the container's file system to the local machine or the |
|
| 2 |
+reverse, from the local filesystem to the container. If `-` is specified for |
|
| 3 |
+either the `SRC_PATH` or `DEST_PATH`, you can also stream a tar archive from |
|
| 4 |
+`STDIN` or to `STDOUT`. The `CONTAINER` can be a running or stopped container. |
|
| 5 |
+The `SRC_PATH` or `DEST_PATH` can be a file or directory. |
|
| 6 |
+ |
|
| 7 |
+The `docker container cp` command assumes container paths are relative to the container's |
|
| 8 |
+`/` (root) directory. This means supplying the initial forward slash is optional; |
|
| 9 |
+The command sees `compassionate_darwin:/tmp/foo/myfile.txt` and |
|
| 10 |
+`compassionate_darwin:tmp/foo/myfile.txt` as identical. Local machine paths can |
|
| 11 |
+be an absolute or relative value. The command interprets a local machine's |
|
| 12 |
+relative paths as relative to the current working directory where `docker container cp` is |
|
| 13 |
+run. |
|
| 14 |
+ |
|
| 15 |
+The `cp` command behaves like the Unix `cp -a` command in that directories are |
|
| 16 |
+copied recursively with permissions preserved if possible. Ownership is set to |
|
| 17 |
+the user and primary group at the destination. For example, files copied to a |
|
| 18 |
+container are created with `UID:GID` of the root user. Files copied to the local |
|
| 19 |
+machine are created with the `UID:GID` of the user which invoked the `docker container cp` |
|
| 20 |
+command. If you specify the `-L` option, `docker container cp` follows any symbolic link |
|
| 21 |
+in the `SRC_PATH`. `docker container cp` does *not* create parent directories for |
|
| 22 |
+`DEST_PATH` if they do not exist. |
|
| 23 |
+ |
|
| 24 |
+Assuming a path separator of `/`, a first argument of `SRC_PATH` and second |
|
| 25 |
+argument of `DEST_PATH`, the behavior is as follows: |
|
| 26 |
+ |
|
| 27 |
+- `SRC_PATH` specifies a file |
|
| 28 |
+ - `DEST_PATH` does not exist |
|
| 29 |
+ - the file is saved to a file created at `DEST_PATH` |
|
| 30 |
+ - `DEST_PATH` does not exist and ends with `/` |
|
| 31 |
+ - Error condition: the destination directory must exist. |
|
| 32 |
+ - `DEST_PATH` exists and is a file |
|
| 33 |
+ - the destination is overwritten with the source file's contents |
|
| 34 |
+ - `DEST_PATH` exists and is a directory |
|
| 35 |
+ - the file is copied into this directory using the basename from |
|
| 36 |
+ `SRC_PATH` |
|
| 37 |
+- `SRC_PATH` specifies a directory |
|
| 38 |
+ - `DEST_PATH` does not exist |
|
| 39 |
+ - `DEST_PATH` is created as a directory and the *contents* of the source |
|
| 40 |
+ directory are copied into this directory |
|
| 41 |
+ - `DEST_PATH` exists and is a file |
|
| 42 |
+ - Error condition: cannot copy a directory to a file |
|
| 43 |
+ - `DEST_PATH` exists and is a directory |
|
| 44 |
+ - `SRC_PATH` does not end with `/.` |
|
| 45 |
+ - the source directory is copied into this directory |
|
| 46 |
+ - `SRC_PATH` does end with `/.` |
|
| 47 |
+ - the *content* of the source directory is copied into this |
|
| 48 |
+ directory |
|
| 49 |
+ |
|
| 50 |
+The command requires `SRC_PATH` and `DEST_PATH` to exist according to the above |
|
| 51 |
+rules. If `SRC_PATH` is local and is a symbolic link, the symbolic link, not |
|
| 52 |
+the target, is copied by default. To copy the link target and not the link, |
|
| 53 |
+specify the `-L` option. |
|
| 54 |
+ |
|
| 55 |
+A colon (`:`) is used as a delimiter between `CONTAINER` and its path. You can |
|
| 56 |
+also use `:` when specifying paths to a `SRC_PATH` or `DEST_PATH` on a local |
|
| 57 |
+machine, for example `file:name.txt`. If you use a `:` in a local machine path, |
|
| 58 |
+you must be explicit with a relative or absolute path, for example: |
|
| 59 |
+ |
|
| 60 |
+ `/path/to/file:name.txt` or `./file:name.txt` |
|
| 61 |
+ |
|
| 62 |
+It is not possible to copy certain system files such as resources under |
|
| 63 |
+`/proc`, `/sys`, `/dev`, tmpfs, and mounts created by the user in the container. |
|
| 64 |
+However, you can still copy such files by manually running `tar` in `docker exec`. |
|
| 65 |
+For example (consider `SRC_PATH` and `DEST_PATH` are directories): |
|
| 66 |
+ |
|
| 67 |
+ $ docker exec foo tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | tar Cxf DEST_PATH - |
|
| 68 |
+ |
|
| 69 |
+or |
|
| 70 |
+ |
|
| 71 |
+ $ tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | docker exec -i foo tar Cxf DEST_PATH - |
|
| 72 |
+ |
|
| 73 |
+ |
|
| 74 |
+Using `-` as the `SRC_PATH` streams the contents of `STDIN` as a tar archive. |
|
| 75 |
+The command extracts the content of the tar to the `DEST_PATH` in container's |
|
| 76 |
+filesystem. In this case, `DEST_PATH` must specify a directory. Using `-` as |
|
| 77 |
+the `DEST_PATH` streams the contents of the resource as a tar archive to `STDOUT`. |
|
| 78 |
+ |
|
| 79 |
+# EXAMPLES |
|
| 80 |
+ |
|
| 81 |
+Suppose a container has finished producing some output as a file it saves |
|
| 82 |
+to somewhere in its filesystem. This could be the output of a build job or |
|
| 83 |
+some other computation. You can copy these outputs from the container to a |
|
| 84 |
+location on your local host. |
|
| 85 |
+ |
|
| 86 |
+If you want to copy the `/tmp/foo` directory from a container to the |
|
| 87 |
+existing `/tmp` directory on your host. If you run `docker container cp` in your `~` |
|
| 88 |
+(home) directory on the local host: |
|
| 89 |
+ |
|
| 90 |
+ $ docker container cp compassionate_darwin:tmp/foo /tmp |
|
| 91 |
+ |
|
| 92 |
+Docker creates a `/tmp/foo` directory on your host. Alternatively, you can omit |
|
| 93 |
+the leading slash in the command. If you execute this command from your home |
|
| 94 |
+directory: |
|
| 95 |
+ |
|
| 96 |
+ $ docker container cp compassionate_darwin:tmp/foo tmp |
|
| 97 |
+ |
|
| 98 |
+If `~/tmp` does not exist, Docker will create it and copy the contents of |
|
| 99 |
+`/tmp/foo` from the container into this new directory. If `~/tmp` already |
|
| 100 |
+exists as a directory, then Docker will copy the contents of `/tmp/foo` from |
|
| 101 |
+the container into a directory at `~/tmp/foo`. |
|
| 102 |
+ |
|
| 103 |
+When copying a single file to an existing `LOCALPATH`, the `docker container cp` command |
|
| 104 |
+will either overwrite the contents of `LOCALPATH` if it is a file or place it |
|
| 105 |
+into `LOCALPATH` if it is a directory, overwriting an existing file of the same |
|
| 106 |
+name if one exists. For example, this command: |
|
| 107 |
+ |
|
| 108 |
+ $ docker container cp sharp_ptolemy:/tmp/foo/myfile.txt /test |
|
| 109 |
+ |
|
| 110 |
+If `/test` does not exist on the local machine, it will be created as a file |
|
| 111 |
+with the contents of `/tmp/foo/myfile.txt` from the container. If `/test` |
|
| 112 |
+exists as a file, it will be overwritten. Lastly, if `/test` exists as a |
|
| 113 |
+directory, the file will be copied to `/test/myfile.txt`. |
|
| 114 |
+ |
|
| 115 |
+Next, suppose you want to copy a file or folder into a container. For example, |
|
| 116 |
+this could be a configuration file or some other input to a long running |
|
| 117 |
+computation that you would like to place into a created container before it |
|
| 118 |
+starts. This is useful because it does not require the configuration file or |
|
| 119 |
+other input to exist in the container image. |
|
| 120 |
+ |
|
| 121 |
+If you have a file, `config.yml`, in the current directory on your local host |
|
| 122 |
+and wish to copy it to an existing directory at `/etc/my-app.d` in a container, |
|
| 123 |
+this command can be used: |
|
| 124 |
+ |
|
| 125 |
+ $ docker container cp config.yml myappcontainer:/etc/my-app.d |
|
| 126 |
+ |
|
| 127 |
+If you have several files in a local directory `/config` which you need to copy |
|
| 128 |
+to a directory `/etc/my-app.d` in a container: |
|
| 129 |
+ |
|
| 130 |
+ $ docker container cp /config/. myappcontainer:/etc/my-app.d |
|
| 131 |
+ |
|
| 132 |
+The above command will copy the contents of the local `/config` directory into |
|
| 133 |
+the directory `/etc/my-app.d` in the container. |
|
| 134 |
+ |
|
| 135 |
+Finally, if you want to copy a symbolic link into a container, you typically |
|
| 136 |
+want to copy the linked target and not the link itself. To copy the target, use |
|
| 137 |
+the `-L` option, for example: |
|
| 138 |
+ |
|
| 139 |
+ $ ln -s /tmp/somefile /tmp/somefile.ln |
|
| 140 |
+ $ docker container cp -L /tmp/somefile.ln myappcontainer:/tmp/ |
|
| 141 |
+ |
|
| 142 |
+This command copies content of the local `/tmp/somefile` into the file |
|
| 143 |
+`/tmp/somefile.ln` in the container. Without `-L` option, the `/tmp/somefile.ln` |
|
| 144 |
+preserves its symbolic link but not its content. |
| 0 | 145 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,99 @@ |
| 0 |
+Creates a writeable container layer over the specified image and prepares it for |
|
| 1 |
+running the specified command. The container ID is then printed to STDOUT. This |
|
| 2 |
+is similar to **docker run -d** except the container is never started. You can |
|
| 3 |
+then use the **docker start <container_id>** command to start the container at |
|
| 4 |
+any point. |
|
| 5 |
+ |
|
| 6 |
+The initial status of the container created with **docker create** is 'created'. |
|
| 7 |
+ |
|
| 8 |
+# OPTIONS |
|
| 9 |
+ |
|
| 10 |
+The `CONTAINER-DIR` must be an absolute path such as `/src/docs`. The `HOST-DIR` |
|
| 11 |
+can be an absolute path or a `name` value. A `name` value must start with an |
|
| 12 |
+alphanumeric character, followed by `a-z0-9`, `_` (underscore), `.` (period) or |
|
| 13 |
+`-` (hyphen). An absolute path starts with a `/` (forward slash). |
|
| 14 |
+ |
|
| 15 |
+If you supply a `HOST-DIR` that is an absolute path, Docker bind-mounts to the |
|
| 16 |
+path you specify. If you supply a `name`, Docker creates a named volume by that |
|
| 17 |
+`name`. For example, you can specify either `/foo` or `foo` for a `HOST-DIR` |
|
| 18 |
+value. If you supply the `/foo` value, Docker creates a bind-mount. If you |
|
| 19 |
+supply the `foo` specification, Docker creates a named volume. |
|
| 20 |
+ |
|
| 21 |
+You can specify multiple **-v** options to mount one or more mounts to a |
|
| 22 |
+container. To use these same mounts in other containers, specify the |
|
| 23 |
+**--volumes-from** option also. |
|
| 24 |
+ |
|
| 25 |
+You can add `:ro` or `:rw` suffix to a volume to mount it read-only or |
|
| 26 |
+read-write mode, respectively. By default, the volumes are mounted read-write. |
|
| 27 |
+See examples. |
|
| 28 |
+ |
|
| 29 |
+Labeling systems like SELinux require that proper labels are placed on volume |
|
| 30 |
+content mounted into a container. Without a label, the security system might |
|
| 31 |
+prevent the processes running inside the container from using the content. By |
|
| 32 |
+default, Docker does not change the labels set by the OS. |
|
| 33 |
+ |
|
| 34 |
+To change a label in the container context, you can add either of two suffixes |
|
| 35 |
+`:z` or `:Z` to the volume mount. These suffixes tell Docker to relabel file |
|
| 36 |
+objects on the shared volumes. The `z` option tells Docker that two containers |
|
| 37 |
+share the volume content. As a result, Docker labels the content with a shared |
|
| 38 |
+content label. Shared volume labels allow all containers to read/write content. |
|
| 39 |
+The `Z` option tells Docker to label the content with a private unshared label. |
|
| 40 |
+Only the current container can use a private volume. |
|
| 41 |
+ |
|
| 42 |
+By default bind mounted volumes are `private`. That means any mounts done |
|
| 43 |
+inside container will not be visible on host and vice-a-versa. One can change |
|
| 44 |
+this behavior by specifying a volume mount propagation property. Making a |
|
| 45 |
+volume `shared` mounts done under that volume inside container will be |
|
| 46 |
+visible on host and vice-a-versa. Making a volume `slave` enables only one |
|
| 47 |
+way mount propagation and that is mounts done on host under that volume |
|
| 48 |
+will be visible inside container but not the other way around. |
|
| 49 |
+ |
|
| 50 |
+To control mount propagation property of volume one can use `:[r]shared`, |
|
| 51 |
+`:[r]slave` or `:[r]private` propagation flag. Propagation property can |
|
| 52 |
+be specified only for bind mounted volumes and not for internal volumes or |
|
| 53 |
+named volumes. For mount propagation to work source mount point (mount point |
|
| 54 |
+where source dir is mounted on) has to have right propagation properties. For |
|
| 55 |
+shared volumes, source mount point has to be shared. And for slave volumes, |
|
| 56 |
+source mount has to be either shared or slave. |
|
| 57 |
+ |
|
| 58 |
+Use `df <source-dir>` to figure out the source mount and then use |
|
| 59 |
+`findmnt -o TARGET,PROPAGATION <source-mount-dir>` to figure out propagation |
|
| 60 |
+properties of source mount. If `findmnt` utility is not available, then one |
|
| 61 |
+can look at mount entry for source mount point in `/proc/self/mountinfo`. Look |
|
| 62 |
+at `optional fields` and see if any propagaion properties are specified. |
|
| 63 |
+`shared:X` means mount is `shared`, `master:X` means mount is `slave` and if |
|
| 64 |
+nothing is there that means mount is `private`. |
|
| 65 |
+ |
|
| 66 |
+To change propagation properties of a mount point use `mount` command. For |
|
| 67 |
+example, if one wants to bind mount source directory `/foo` one can do |
|
| 68 |
+`mount --bind /foo /foo` and `mount --make-private --make-shared /foo`. This |
|
| 69 |
+will convert /foo into a `shared` mount point. Alternatively one can directly |
|
| 70 |
+change propagation properties of source mount. Say `/` is source mount for |
|
| 71 |
+`/foo`, then use `mount --make-shared /` to convert `/` into a `shared` mount. |
|
| 72 |
+ |
|
| 73 |
+> **Note**: |
|
| 74 |
+> When using systemd to manage the Docker daemon's start and stop, in the systemd |
|
| 75 |
+> unit file there is an option to control mount propagation for the Docker daemon |
|
| 76 |
+> itself, called `MountFlags`. The value of this setting may cause Docker to not |
|
| 77 |
+> see mount propagation changes made on the mount point. For example, if this value |
|
| 78 |
+> is `slave`, you may not be able to use the `shared` or `rshared` propagation on |
|
| 79 |
+> a volume. |
|
| 80 |
+ |
|
| 81 |
+ |
|
| 82 |
+To disable automatic copying of data from the container path to the volume, use |
|
| 83 |
+the `nocopy` flag. The `nocopy` flag can be set on bind mounts and named volumes. |
|
| 84 |
+ |
|
| 85 |
+# EXAMPLES |
|
| 86 |
+ |
|
| 87 |
+## Specify isolation technology for container (--isolation) |
|
| 88 |
+ |
|
| 89 |
+This option is useful in situations where you are running Docker containers on |
|
| 90 |
+Windows. The `--isolation=<value>` option sets a container's isolation |
|
| 91 |
+technology. On Linux, the only supported is the `default` option which uses |
|
| 92 |
+Linux namespaces. On Microsoft Windows, you can specify these values: |
|
| 93 |
+ |
|
| 94 |
+* `default`: Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value. |
|
| 95 |
+* `process`: Namespace isolation only. |
|
| 96 |
+* `hyperv`: Hyper-V hypervisor partition-based isolation. |
|
| 97 |
+ |
|
| 98 |
+Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`. |
| 0 | 99 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,39 @@ |
| 0 |
+List the changed files and directories in a container᾿s filesystem since the |
|
| 1 |
+container was created. Three different types of change are tracked: |
|
| 2 |
+ |
|
| 3 |
+| Symbol | Description | |
|
| 4 |
+|--------|---------------------------------| |
|
| 5 |
+| `A` | A file or directory was added | |
|
| 6 |
+| `D` | A file or directory was deleted | |
|
| 7 |
+| `C` | A file or directory was changed | |
|
| 8 |
+ |
|
| 9 |
+You can use the full or shortened container ID or the container name set using |
|
| 10 |
+**docker run --name** option. |
|
| 11 |
+ |
|
| 12 |
+# EXAMPLES |
|
| 13 |
+ |
|
| 14 |
+Inspect the changes to an `nginx` container: |
|
| 15 |
+ |
|
| 16 |
+```bash |
|
| 17 |
+$ docker diff 1fdfd1f54c1b |
|
| 18 |
+ |
|
| 19 |
+C /dev |
|
| 20 |
+C /dev/console |
|
| 21 |
+C /dev/core |
|
| 22 |
+C /dev/stdout |
|
| 23 |
+C /dev/fd |
|
| 24 |
+C /dev/ptmx |
|
| 25 |
+C /dev/stderr |
|
| 26 |
+C /dev/stdin |
|
| 27 |
+C /run |
|
| 28 |
+A /run/nginx.pid |
|
| 29 |
+C /var/lib/nginx/tmp |
|
| 30 |
+A /var/lib/nginx/tmp/client_body |
|
| 31 |
+A /var/lib/nginx/tmp/fastcgi |
|
| 32 |
+A /var/lib/nginx/tmp/proxy |
|
| 33 |
+A /var/lib/nginx/tmp/scgi |
|
| 34 |
+A /var/lib/nginx/tmp/uwsgi |
|
| 35 |
+C /var/log/nginx |
|
| 36 |
+A /var/log/nginx/access.log |
|
| 37 |
+A /var/log/nginx/error.log |
|
| 38 |
+``` |
| 0 | 39 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,25 @@ |
| 0 |
+Run a process in a running container. |
|
| 1 |
+ |
|
| 2 |
+The command started using `docker exec` will only run while the container's primary |
|
| 3 |
+process (`PID 1`) is running, and will not be restarted if the container is restarted. |
|
| 4 |
+ |
|
| 5 |
+If the container is paused, then the `docker exec` command will wait until the |
|
| 6 |
+container is unpaused, and then run |
|
| 7 |
+ |
|
| 8 |
+# CAPABILITIES |
|
| 9 |
+ |
|
| 10 |
+`privileged` gives the process extended |
|
| 11 |
+[Linux capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html) |
|
| 12 |
+when running in a container. |
|
| 13 |
+ |
|
| 14 |
+Without this flag, the process run by `docker exec` in a running container has |
|
| 15 |
+the same capabilities as the container, which may be limited. Set |
|
| 16 |
+`--privileged` to give all capabilities to the process. |
|
| 17 |
+ |
|
| 18 |
+# USER |
|
| 19 |
+`user` sets the username or UID used and optionally the groupname or GID for the specified command. |
|
| 20 |
+ |
|
| 21 |
+ The followings examples are all valid: |
|
| 22 |
+ --user [user | user:group | uid | uid:gid | user:gid | uid:group ] |
|
| 23 |
+ |
|
| 24 |
+ Without this argument the command will be run as root in the container. |
| 0 | 25 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,20 @@ |
| 0 |
+Export the contents of a container's filesystem using the full or shortened |
|
| 1 |
+container ID or container name. The output is exported to STDOUT and can be |
|
| 2 |
+redirected to a tar file. |
|
| 3 |
+ |
|
| 4 |
+Stream to a file instead of STDOUT by using **-o**. |
|
| 5 |
+ |
|
| 6 |
+# EXAMPLES |
|
| 7 |
+Export the contents of the container called angry_bell to a tar file |
|
| 8 |
+called angry_bell.tar: |
|
| 9 |
+ |
|
| 10 |
+ # docker export angry_bell > angry_bell.tar |
|
| 11 |
+ # docker export --output=angry_bell-latest.tar angry_bell |
|
| 12 |
+ # ls -sh angry_bell.tar |
|
| 13 |
+ 321M angry_bell.tar |
|
| 14 |
+ # ls -sh angry_bell-latest.tar |
|
| 15 |
+ 321M angry_bell-latest.tar |
|
| 16 |
+ |
|
| 17 |
+# See also |
|
| 18 |
+**docker-import(1)** to create an empty filesystem image |
|
| 19 |
+and import the contents of the tarball into it, then optionally tag it. |
| 0 | 2 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,28 @@ |
| 0 |
+The **docker container logs** command batch-retrieves whatever logs are present for |
|
| 1 |
+a container at the time of execution. This does not guarantee execution |
|
| 2 |
+order when combined with a docker run (i.e., your run may not have generated |
|
| 3 |
+any logs at the time you execute docker container logs). |
|
| 4 |
+ |
|
| 5 |
+The **docker container logs --follow** command combines commands **docker container logs** and |
|
| 6 |
+**docker attach**. It will first return all logs from the beginning and |
|
| 7 |
+then continue streaming new output from the container's stdout and stderr. |
|
| 8 |
+ |
|
| 9 |
+**Warning**: This command works only for the **json-file** or **journald** |
|
| 10 |
+logging drivers. |
|
| 11 |
+ |
|
| 12 |
+The `--since` option can be Unix timestamps, date formatted timestamps, or Go |
|
| 13 |
+duration strings (e.g. `10m`, `1h30m`) computed relative to the client machine's |
|
| 14 |
+time. Supported formats for date formatted time stamps include RFC3339Nano, |
|
| 15 |
+RFC3339, `2006-01-02T15:04:05`, `2006-01-02T15:04:05.999999999`, |
|
| 16 |
+`2006-01-02Z07:00`, and `2006-01-02`. The local timezone on the client will be |
|
| 17 |
+used if you do not provide either a `Z` or a `+-00:00` timezone offset at the |
|
| 18 |
+end of the timestamp. When providing Unix timestamps enter |
|
| 19 |
+seconds[.nanoseconds], where seconds is the number of seconds that have elapsed |
|
| 20 |
+since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (aka Unix |
|
| 21 |
+epoch or Unix time), and the optional .nanoseconds field is a fraction of a |
|
| 22 |
+second no more than nine digits long. You can combine the `--since` option with |
|
| 23 |
+either or both of the `--follow` or `--tail` options. |
|
| 24 |
+ |
|
| 25 |
+The `docker container logs --details` command will add on extra attributes, such as |
|
| 26 |
+environment variables and labels, provided to `--log-opt` when creating the |
|
| 27 |
+container. |
| 0 | 28 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,96 @@ |
| 0 |
+List the containers in the local repository. By default this shows only |
|
| 1 |
+the running containers. |
|
| 2 |
+ |
|
| 3 |
+## Filters |
|
| 4 |
+ |
|
| 5 |
+Filter output based on these conditions: |
|
| 6 |
+ - exited=<int> an exit code of <int> |
|
| 7 |
+ - label=<key> or label=<key>=<value> |
|
| 8 |
+ - status=(created|restarting|running|paused|exited|dead) |
|
| 9 |
+ - name=<string> a container's name |
|
| 10 |
+ - id=<ID> a container's ID |
|
| 11 |
+ - is-task=(true|false) - containers that are a task (part of a service managed by swarm) |
|
| 12 |
+ - before=(<container-name>|<container-id>) |
|
| 13 |
+ - since=(<container-name>|<container-id>) |
|
| 14 |
+ - ancestor=(<image-name>[:tag]|<image-id>|<image@digest>) - containers created from an image or a descendant. |
|
| 15 |
+ - volume=(<volume-name>|<mount-point-destination>) |
|
| 16 |
+ - network=(<network-name>|<network-id>) - containers connected to the provided network |
|
| 17 |
+ - health=(starting|healthy|unhealthy|none) - filters containers based on healthcheck status |
|
| 18 |
+ |
|
| 19 |
+## Format |
|
| 20 |
+ |
|
| 21 |
+ Pretty-print containers using a Go template. |
|
| 22 |
+ Valid placeholders: |
|
| 23 |
+ .ID - Container ID |
|
| 24 |
+ .Image - Image ID |
|
| 25 |
+ .Command - Quoted command |
|
| 26 |
+ .CreatedAt - Time when the container was created. |
|
| 27 |
+ .RunningFor - Elapsed time since the container was started. |
|
| 28 |
+ .Ports - Exposed ports. |
|
| 29 |
+ .Status - Container status. |
|
| 30 |
+ .Size - Container disk size. |
|
| 31 |
+ .Names - Container names. |
|
| 32 |
+ .Labels - All labels assigned to the container. |
|
| 33 |
+ .Label - Value of a specific label for this container. For example `{{.Label "com.docker.swarm.cpu"}}`
|
|
| 34 |
+ .Mounts - Names of the volumes mounted in this container. |
|
| 35 |
+ |
|
| 36 |
+# EXAMPLES |
|
| 37 |
+# Display all containers, including non-running |
|
| 38 |
+ |
|
| 39 |
+ # docker container ls -a |
|
| 40 |
+ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 41 |
+ a87ecb4f327c fedora:20 /bin/sh -c #(nop) MA 20 minutes ago Exit 0 desperate_brattain |
|
| 42 |
+ 01946d9d34d8 vpavlin/rhel7:latest /bin/sh -c #(nop) MA 33 minutes ago Exit 0 thirsty_bell |
|
| 43 |
+ c1d3b0166030 acffc0358b9e /bin/sh -c yum -y up 2 weeks ago Exit 1 determined_torvalds |
|
| 44 |
+ 41d50ecd2f57 fedora:20 /bin/sh -c #(nop) MA 2 weeks ago Exit 0 drunk_pike |
|
| 45 |
+ |
|
| 46 |
+# Display only IDs of all containers, including non-running |
|
| 47 |
+ |
|
| 48 |
+ # docker container ls -a -q |
|
| 49 |
+ a87ecb4f327c |
|
| 50 |
+ 01946d9d34d8 |
|
| 51 |
+ c1d3b0166030 |
|
| 52 |
+ 41d50ecd2f57 |
|
| 53 |
+ |
|
| 54 |
+# Display only IDs of all containers that have the name `determined_torvalds` |
|
| 55 |
+ |
|
| 56 |
+ # docker container ls -a -q --filter=name=determined_torvalds |
|
| 57 |
+ c1d3b0166030 |
|
| 58 |
+ |
|
| 59 |
+# Display containers with their commands |
|
| 60 |
+ |
|
| 61 |
+ # docker container ls --format "{{.ID}}: {{.Command}}"
|
|
| 62 |
+ a87ecb4f327c: /bin/sh -c #(nop) MA |
|
| 63 |
+ 01946d9d34d8: /bin/sh -c #(nop) MA |
|
| 64 |
+ c1d3b0166030: /bin/sh -c yum -y up |
|
| 65 |
+ 41d50ecd2f57: /bin/sh -c #(nop) MA |
|
| 66 |
+ |
|
| 67 |
+# Display containers with their labels in a table |
|
| 68 |
+ |
|
| 69 |
+ # docker container ls --format "table {{.ID}}\t{{.Labels}}"
|
|
| 70 |
+ CONTAINER ID LABELS |
|
| 71 |
+ a87ecb4f327c com.docker.swarm.node=ubuntu,com.docker.swarm.storage=ssd |
|
| 72 |
+ 01946d9d34d8 |
|
| 73 |
+ c1d3b0166030 com.docker.swarm.node=debian,com.docker.swarm.cpu=6 |
|
| 74 |
+ 41d50ecd2f57 com.docker.swarm.node=fedora,com.docker.swarm.cpu=3,com.docker.swarm.storage=ssd |
|
| 75 |
+ |
|
| 76 |
+# Display containers with their node label in a table |
|
| 77 |
+ |
|
| 78 |
+ # docker container ls --format 'table {{.ID}}\t{{(.Label "com.docker.swarm.node")}}'
|
|
| 79 |
+ CONTAINER ID NODE |
|
| 80 |
+ a87ecb4f327c ubuntu |
|
| 81 |
+ 01946d9d34d8 |
|
| 82 |
+ c1d3b0166030 debian |
|
| 83 |
+ 41d50ecd2f57 fedora |
|
| 84 |
+ |
|
| 85 |
+# Display containers with `remote-volume` mounted |
|
| 86 |
+ |
|
| 87 |
+ $ docker container ls --filter volume=remote-volume --format "table {{.ID}}\t{{.Mounts}}"
|
|
| 88 |
+ CONTAINER ID MOUNTS |
|
| 89 |
+ 9c3527ed70ce remote-volume |
|
| 90 |
+ |
|
| 91 |
+# Display containers with a volume mounted in `/data` |
|
| 92 |
+ |
|
| 93 |
+ $ docker container ls --filter volume=/data --format "table {{.ID}}\t{{.Mounts}}"
|
|
| 94 |
+ CONTAINER ID MOUNTS |
|
| 95 |
+ 9c3527ed70ce remote-volume |
| 0 | 96 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,12 @@ |
| 0 |
+The `docker container pause` command suspends all processes in the specified containers. |
|
| 1 |
+On Linux, this uses the cgroups freezer. Traditionally, when suspending a process |
|
| 2 |
+the `SIGSTOP` signal is used, which is observable by the process being suspended. |
|
| 3 |
+With the cgroups freezer the process is unaware, and unable to capture, |
|
| 4 |
+that it is being suspended, and subsequently resumed. On Windows, only Hyper-V |
|
| 5 |
+containers can be paused. |
|
| 6 |
+ |
|
| 7 |
+See the [cgroups freezer documentation] |
|
| 8 |
+(https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) for |
|
| 9 |
+further details. |
|
| 10 |
+ |
|
| 11 |
+**docker-container-unpause(1)** to unpause all processes within a container. |
| 0 | 12 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,26 @@ |
| 0 |
+List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT |
|
| 1 |
+ |
|
| 2 |
+# EXAMPLES |
|
| 3 |
+ |
|
| 4 |
+ # docker ps |
|
| 5 |
+ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 6 |
+ b650456536c7 busybox:latest top 54 minutes ago Up 54 minutes 0.0.0.0:1234->9876/tcp, 0.0.0.0:4321->7890/tcp test |
|
| 7 |
+ |
|
| 8 |
+## Find out all the ports mapped |
|
| 9 |
+ |
|
| 10 |
+ # docker container port test |
|
| 11 |
+ 7890/tcp -> 0.0.0.0:4321 |
|
| 12 |
+ 9876/tcp -> 0.0.0.0:1234 |
|
| 13 |
+ |
|
| 14 |
+## Find out a specific mapping |
|
| 15 |
+ |
|
| 16 |
+ # docker container port test 7890/tcp |
|
| 17 |
+ 0.0.0.0:4321 |
|
| 18 |
+ |
|
| 19 |
+ # docker container port test 7890 |
|
| 20 |
+ 0.0.0.0:4321 |
|
| 21 |
+ |
|
| 22 |
+## An example showing error for non-existent mapping |
|
| 23 |
+ |
|
| 24 |
+ # docker container port test 7890/udp |
|
| 25 |
+ 2014/06/24 11:53:36 Error: No public port '7890/udp' published for test |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,37 @@ |
| 0 |
+**docker container rm** will remove one or more containers from the host node. The |
|
| 1 |
+container name or ID can be used. This does not remove images. You cannot |
|
| 2 |
+remove a running container unless you use the **-f** option. To see all |
|
| 3 |
+containers on a host use the **docker container ls -a** command. |
|
| 4 |
+ |
|
| 5 |
+# EXAMPLES |
|
| 6 |
+ |
|
| 7 |
+## Removing a container using its ID |
|
| 8 |
+ |
|
| 9 |
+To remove a container using its ID, find either from a **docker ps -a** |
|
| 10 |
+command, or use the ID returned from the **docker run** command, or retrieve |
|
| 11 |
+it from a file used to store it using the **docker run --cidfile**: |
|
| 12 |
+ |
|
| 13 |
+ docker container rm abebf7571666 |
|
| 14 |
+ |
|
| 15 |
+## Removing a container using the container name |
|
| 16 |
+ |
|
| 17 |
+The name of the container can be found using the **docker ps -a** |
|
| 18 |
+command. The use that name as follows: |
|
| 19 |
+ |
|
| 20 |
+ docker container rm hopeful_morse |
|
| 21 |
+ |
|
| 22 |
+## Removing a container and all associated volumes |
|
| 23 |
+ |
|
| 24 |
+ $ docker container rm -v redis |
|
| 25 |
+ redis |
|
| 26 |
+ |
|
| 27 |
+This command will remove the container and any volumes associated with it. |
|
| 28 |
+Note that if a volume was specified with a name, it will not be removed. |
|
| 29 |
+ |
|
| 30 |
+ $ docker create -v awesome:/foo -v /bar --name hello redis |
|
| 31 |
+ hello |
|
| 32 |
+ $ docker container rm -v hello |
|
| 33 |
+ |
|
| 34 |
+In this example, the volume for `/foo` will remain in tact, but the volume for |
|
| 35 |
+`/bar` will be removed. The same behavior holds for volumes inherited with |
|
| 36 |
+`--volumes-from`. |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,32 @@ |
| 0 |
+Display a live stream of one or more containers' resource usage statistics |
|
| 1 |
+ |
|
| 2 |
+# Format |
|
| 3 |
+ |
|
| 4 |
+ Pretty-print containers statistics using a Go template. |
|
| 5 |
+ Valid placeholders: |
|
| 6 |
+ .Container - Container name or ID. |
|
| 7 |
+ .Name - Container name. |
|
| 8 |
+ .ID - Container ID. |
|
| 9 |
+ .CPUPerc - CPU percentage. |
|
| 10 |
+ .MemUsage - Memory usage. |
|
| 11 |
+ .NetIO - Network IO. |
|
| 12 |
+ .BlockIO - Block IO. |
|
| 13 |
+ .MemPerc - Memory percentage (Not available on Windows). |
|
| 14 |
+ .PIDs - Number of PIDs (Not available on Windows). |
|
| 15 |
+ |
|
| 16 |
+# EXAMPLES |
|
| 17 |
+ |
|
| 18 |
+Running `docker container stats` on all running containers |
|
| 19 |
+ |
|
| 20 |
+ $ docker container stats |
|
| 21 |
+ CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O |
|
| 22 |
+ 1285939c1fd3 0.07% 796 KiB / 64 MiB 1.21% 788 B / 648 B 3.568 MB / 512 KB |
|
| 23 |
+ 9c76f7834ae2 0.07% 2.746 MiB / 64 MiB 4.29% 1.266 KB / 648 B 12.4 MB / 0 B |
|
| 24 |
+ d1ea048f04e4 0.03% 4.583 MiB / 64 MiB 6.30% 2.854 KB / 648 B 27.7 MB / 0 B |
|
| 25 |
+ |
|
| 26 |
+Running `docker container stats` on multiple containers by name and id. |
|
| 27 |
+ |
|
| 28 |
+ $ docker container stats fervent_panini 5acfcb1b4fd1 |
|
| 29 |
+ CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O |
|
| 30 |
+ 5acfcb1b4fd1 0.00% 115.2 MiB/1.045 GiB 11.03% 1.422 kB/648 B |
|
| 31 |
+ fervent_panini 0.02% 11.08 MiB/1.045 GiB 1.06% 648 B/648 B |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,11 @@ |
| 0 |
+Display the running process of the container. ps-OPTION can be any of the options you would pass to a Linux ps command. |
|
| 1 |
+ |
|
| 2 |
+All displayed information is from host's point of view. |
|
| 3 |
+ |
|
| 4 |
+# EXAMPLES |
|
| 5 |
+ |
|
| 6 |
+Run **docker container top** with the ps option of -x: |
|
| 7 |
+ |
|
| 8 |
+ $ docker top 8601afda2b -x |
|
| 9 |
+ PID TTY STAT TIME COMMAND |
|
| 10 |
+ 16623 ? Ss 0:00 sleep 99999 |
| 0 | 11 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,6 @@ |
| 0 |
+The `docker container unpause` command un-suspends all processes in a container. |
|
| 1 |
+On Linux, it does this using the cgroups freezer. |
|
| 2 |
+ |
|
| 3 |
+See the [cgroups freezer documentation] |
|
| 4 |
+(https://www.kernel.org/doc/Documentation/cgroups/freezer-subsystem.txt) for |
|
| 5 |
+further details. |
| 0 | 6 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,102 @@ |
| 0 |
+The **docker container update** command dynamically updates container configuration. |
|
| 1 |
+You can use this command to prevent containers from consuming too many |
|
| 2 |
+resources from their Docker host. With a single command, you can place |
|
| 3 |
+limits on a single container or on many. To specify more than one container, |
|
| 4 |
+provide space-separated list of container names or IDs. |
|
| 5 |
+ |
|
| 6 |
+With the exception of the **--kernel-memory** option, you can specify these |
|
| 7 |
+options on a running or a stopped container. On kernel version older than |
|
| 8 |
+4.6, You can only update **--kernel-memory** on a stopped container or on |
|
| 9 |
+a running container with kernel memory initialized. |
|
| 10 |
+ |
|
| 11 |
+# OPTIONS |
|
| 12 |
+ |
|
| 13 |
+## kernel-memory |
|
| 14 |
+ |
|
| 15 |
+Kernel memory limit (format: `<number>[<unit>]`, where unit = b, k, m or g) |
|
| 16 |
+ |
|
| 17 |
+Note that on kernel version older than 4.6, you can not update kernel memory on |
|
| 18 |
+a running container if the container is started without kernel memory initialized, |
|
| 19 |
+in this case, it can only be updated after it's stopped. The new setting takes |
|
| 20 |
+effect when the container is started. |
|
| 21 |
+ |
|
| 22 |
+## memory |
|
| 23 |
+ |
|
| 24 |
+Memory limit (format: <number><optional unit>, where unit = b, k, m or g) |
|
| 25 |
+ |
|
| 26 |
+Note that the memory should be smaller than the already set swap memory limit. |
|
| 27 |
+If you want update a memory limit bigger than the already set swap memory limit, |
|
| 28 |
+you should update swap memory limit at the same time. If you don't set swap memory |
|
| 29 |
+limit on docker create/run but only memory limit, the swap memory is double |
|
| 30 |
+the memory limit. |
|
| 31 |
+ |
|
| 32 |
+# EXAMPLES |
|
| 33 |
+ |
|
| 34 |
+The following sections illustrate ways to use this command. |
|
| 35 |
+ |
|
| 36 |
+### Update a container's cpu-shares |
|
| 37 |
+ |
|
| 38 |
+To limit a container's cpu-shares to 512, first identify the container |
|
| 39 |
+name or ID. You can use **docker ps** to find these values. You can also |
|
| 40 |
+use the ID returned from the **docker run** command. Then, do the following: |
|
| 41 |
+ |
|
| 42 |
+```bash |
|
| 43 |
+$ docker container update --cpu-shares 512 abebf7571666 |
|
| 44 |
+``` |
|
| 45 |
+ |
|
| 46 |
+### Update a container with cpu-shares and memory |
|
| 47 |
+ |
|
| 48 |
+To update multiple resource configurations for multiple containers: |
|
| 49 |
+ |
|
| 50 |
+```bash |
|
| 51 |
+$ docker container update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse |
|
| 52 |
+``` |
|
| 53 |
+ |
|
| 54 |
+### Update a container's kernel memory constraints |
|
| 55 |
+ |
|
| 56 |
+You can update a container's kernel memory limit using the **--kernel-memory** |
|
| 57 |
+option. On kernel version older than 4.6, this option can be updated on a |
|
| 58 |
+running container only if the container was started with **--kernel-memory**. |
|
| 59 |
+If the container was started *without* **--kernel-memory** you need to stop |
|
| 60 |
+the container before updating kernel memory. |
|
| 61 |
+ |
|
| 62 |
+For example, if you started a container with this command: |
|
| 63 |
+ |
|
| 64 |
+```bash |
|
| 65 |
+$ docker run -dit --name test --kernel-memory 50M ubuntu bash |
|
| 66 |
+``` |
|
| 67 |
+ |
|
| 68 |
+You can update kernel memory while the container is running: |
|
| 69 |
+ |
|
| 70 |
+```bash |
|
| 71 |
+$ docker container update --kernel-memory 80M test |
|
| 72 |
+``` |
|
| 73 |
+ |
|
| 74 |
+If you started a container *without* kernel memory initialized: |
|
| 75 |
+ |
|
| 76 |
+```bash |
|
| 77 |
+$ docker run -dit --name test2 --memory 300M ubuntu bash |
|
| 78 |
+``` |
|
| 79 |
+ |
|
| 80 |
+Update kernel memory of running container `test2` will fail. You need to stop |
|
| 81 |
+the container before updating the **--kernel-memory** setting. The next time you |
|
| 82 |
+start it, the container uses the new value. |
|
| 83 |
+ |
|
| 84 |
+Kernel version newer than (include) 4.6 does not have this limitation, you |
|
| 85 |
+can use `--kernel-memory` the same way as other options. |
|
| 86 |
+ |
|
| 87 |
+### Update a container's restart policy |
|
| 88 |
+ |
|
| 89 |
+You can change a container's restart policy on a running container. The new |
|
| 90 |
+restart policy takes effect instantly after you run `docker container update` on a |
|
| 91 |
+container. |
|
| 92 |
+ |
|
| 93 |
+To update restart policy for one or more containers: |
|
| 94 |
+ |
|
| 95 |
+```bash |
|
| 96 |
+$ docker container update --restart=on-failure:3 abebf7571666 hopeful_morse |
|
| 97 |
+``` |
|
| 98 |
+ |
|
| 99 |
+Note that if the container is started with "--rm" flag, you cannot update the restart |
|
| 100 |
+policy for it. The `AutoRemove` and `RestartPolicy` are mutually exclusive for the |
|
| 101 |
+container. |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,18 @@ |
| 0 |
+Show the history of when and how an image was created. |
|
| 1 |
+ |
|
| 2 |
+# EXAMPLES |
|
| 3 |
+ $ docker history fedora |
|
| 4 |
+ IMAGE CREATED CREATED BY SIZE COMMENT |
|
| 5 |
+ 105182bb5e8b 5 days ago /bin/sh -c #(nop) ADD file:71356d2ad59aa3119d 372.7 MB |
|
| 6 |
+ 73bd853d2ea5 13 days ago /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar 0 B |
|
| 7 |
+ 511136ea3c5a 10 months ago 0 B Imported from - |
|
| 8 |
+ |
|
| 9 |
+## Display comments in the image history |
|
| 10 |
+The `docker commit` command has a **-m** flag for adding comments to the image. These comments will be displayed in the image history. |
|
| 11 |
+ |
|
| 12 |
+ $ sudo docker history docker:scm |
|
| 13 |
+ IMAGE CREATED CREATED BY SIZE COMMENT |
|
| 14 |
+ 2ac9d1098bf1 3 months ago /bin/bash 241.4 MB Added Apache to Fedora base image |
|
| 15 |
+ 88b42ffd1f7c 5 months ago /bin/sh -c #(nop) ADD file:1fd8d7f9f6557cafc7 373.7 MB |
|
| 16 |
+ c69cab00d6ef 5 months ago /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar 0 B |
|
| 17 |
+ 511136ea3c5a 19 months ago 0 B Imported from - |
| 0 | 18 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,42 @@ |
| 0 |
+Create a new filesystem image from the contents of a tarball (`.tar`, |
|
| 1 |
+`.tar.gz`, `.tgz`, `.bzip`, `.tar.xz`, `.txz`) into it, then optionally tag it. |
|
| 2 |
+ |
|
| 3 |
+ |
|
| 4 |
+# EXAMPLES |
|
| 5 |
+ |
|
| 6 |
+## Import from a remote location |
|
| 7 |
+ |
|
| 8 |
+ # docker image import http://example.com/exampleimage.tgz example/imagerepo |
|
| 9 |
+ |
|
| 10 |
+## Import from a local file |
|
| 11 |
+ |
|
| 12 |
+Import to docker via pipe and stdin: |
|
| 13 |
+ |
|
| 14 |
+ # cat exampleimage.tgz | docker image import - example/imagelocal |
|
| 15 |
+ |
|
| 16 |
+Import with a commit message. |
|
| 17 |
+ |
|
| 18 |
+ # cat exampleimage.tgz | docker image import --message "New image imported from tarball" - exampleimagelocal:new |
|
| 19 |
+ |
|
| 20 |
+Import to a Docker image from a local file. |
|
| 21 |
+ |
|
| 22 |
+ # docker image import /path/to/exampleimage.tgz |
|
| 23 |
+ |
|
| 24 |
+ |
|
| 25 |
+## Import from a local file and tag |
|
| 26 |
+ |
|
| 27 |
+Import to docker via pipe and stdin: |
|
| 28 |
+ |
|
| 29 |
+ # cat exampleimageV2.tgz | docker image import - example/imagelocal:V-2.0 |
|
| 30 |
+ |
|
| 31 |
+## Import from a local directory |
|
| 32 |
+ |
|
| 33 |
+ # tar -c . | docker image import - exampleimagedir |
|
| 34 |
+ |
|
| 35 |
+## Apply specified Dockerfile instructions while importing the image |
|
| 36 |
+This example sets the docker image ENV variable DEBUG to true by default. |
|
| 37 |
+ |
|
| 38 |
+ # tar -c . | docker image import -c="ENV DEBUG true" - exampleimagedir |
|
| 39 |
+ |
|
| 40 |
+# See also |
|
| 41 |
+**docker-export(1)** to export the contents of a filesystem as a tar archive to STDOUT. |
| 0 | 42 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,25 @@ |
| 0 |
+Loads a tarred repository from a file or the standard input stream. |
|
| 1 |
+Restores both images and tags. Write image names or IDs imported it |
|
| 2 |
+standard output stream. |
|
| 3 |
+ |
|
| 4 |
+# EXAMPLES |
|
| 5 |
+ |
|
| 6 |
+ $ docker images |
|
| 7 |
+ REPOSITORY TAG IMAGE ID CREATED SIZE |
|
| 8 |
+ busybox latest 769b9341d937 7 weeks ago 2.489 MB |
|
| 9 |
+ $ docker load --input fedora.tar |
|
| 10 |
+ # […] |
|
| 11 |
+ Loaded image: fedora:rawhide |
|
| 12 |
+ # […] |
|
| 13 |
+ Loaded image: fedora:20 |
|
| 14 |
+ # […] |
|
| 15 |
+ $ docker images |
|
| 16 |
+ REPOSITORY TAG IMAGE ID CREATED SIZE |
|
| 17 |
+ busybox latest 769b9341d937 7 weeks ago 2.489 MB |
|
| 18 |
+ fedora rawhide 0d20aec6529d 7 weeks ago 387 MB |
|
| 19 |
+ fedora 20 58394af37342 7 weeks ago 385.5 MB |
|
| 20 |
+ fedora heisenbug 58394af37342 7 weeks ago 385.5 MB |
|
| 21 |
+ fedora latest 58394af37342 7 weeks ago 385.5 MB |
|
| 22 |
+ |
|
| 23 |
+# See also |
|
| 24 |
+**docker-image-save(1)** to save one or more images to a tar archive (streamed to STDOUT by default). |
| 0 | 25 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,117 @@ |
| 0 |
+This command lists the images stored in the local Docker repository. |
|
| 1 |
+ |
|
| 2 |
+By default, intermediate images, used during builds, are not listed. Some of the |
|
| 3 |
+output, e.g., image ID, is truncated, for space reasons. However the truncated |
|
| 4 |
+image ID, and often the first few characters, are enough to be used in other |
|
| 5 |
+Docker commands that use the image ID. The output includes repository, tag, image |
|
| 6 |
+ID, date created and the virtual size. |
|
| 7 |
+ |
|
| 8 |
+The title REPOSITORY for the first title may seem confusing. It is essentially |
|
| 9 |
+the image name. However, because you can tag a specific image, and multiple tags |
|
| 10 |
+(image instances) can be associated with a single name, the name is really a |
|
| 11 |
+repository for all tagged images of the same name. For example consider an image |
|
| 12 |
+called fedora. It may be tagged with 18, 19, or 20, etc. to manage different |
|
| 13 |
+versions. |
|
| 14 |
+ |
|
| 15 |
+## Filters |
|
| 16 |
+ |
|
| 17 |
+Filters the output based on these conditions: |
|
| 18 |
+ |
|
| 19 |
+ - dangling=(true|false) - find unused images |
|
| 20 |
+ - label=<key> or label=<key>=<value> |
|
| 21 |
+ - before=(<image-name>[:tag]|<image-id>|<image@digest>) |
|
| 22 |
+ - since=(<image-name>[:tag]|<image-id>|<image@digest>) |
|
| 23 |
+ |
|
| 24 |
+## Format |
|
| 25 |
+ |
|
| 26 |
+ Pretty-print images using a Go template. |
|
| 27 |
+ Valid placeholders: |
|
| 28 |
+ .ID - Image ID |
|
| 29 |
+ .Repository - Image repository |
|
| 30 |
+ .Tag - Image tag |
|
| 31 |
+ .Digest - Image digest |
|
| 32 |
+ .CreatedSince - Elapsed time since the image was created |
|
| 33 |
+ .CreatedAt - Time when the image was created |
|
| 34 |
+ .Size - Image disk size |
|
| 35 |
+ |
|
| 36 |
+# EXAMPLES |
|
| 37 |
+ |
|
| 38 |
+## Listing the images |
|
| 39 |
+ |
|
| 40 |
+To list the images in a local repository (not the registry) run: |
|
| 41 |
+ |
|
| 42 |
+ docker image ls |
|
| 43 |
+ |
|
| 44 |
+The list will contain the image repository name, a tag for the image, and an |
|
| 45 |
+image ID, when it was created and its virtual size. Columns: REPOSITORY, TAG, |
|
| 46 |
+IMAGE ID, CREATED, and SIZE. |
|
| 47 |
+ |
|
| 48 |
+The `docker image ls` command takes an optional `[REPOSITORY[:TAG]]` argument |
|
| 49 |
+that restricts the list to images that match the argument. If you specify |
|
| 50 |
+`REPOSITORY`but no `TAG`, the `docker image ls` command lists all images in the |
|
| 51 |
+given repository. |
|
| 52 |
+ |
|
| 53 |
+ docker image ls java |
|
| 54 |
+ |
|
| 55 |
+The `[REPOSITORY[:TAG]]` value must be an "exact match". This means that, for example, |
|
| 56 |
+`docker image ls jav` does not match the image `java`. |
|
| 57 |
+ |
|
| 58 |
+If both `REPOSITORY` and `TAG` are provided, only images matching that |
|
| 59 |
+repository and tag are listed. To find all local images in the "java" |
|
| 60 |
+repository with tag "8" you can use: |
|
| 61 |
+ |
|
| 62 |
+ docker image ls java:8 |
|
| 63 |
+ |
|
| 64 |
+To get a verbose list of images which contains all the intermediate images |
|
| 65 |
+used in builds use **-a**: |
|
| 66 |
+ |
|
| 67 |
+ docker image ls -a |
|
| 68 |
+ |
|
| 69 |
+Previously, the docker image ls command supported the --tree and --dot arguments, |
|
| 70 |
+which displayed different visualizations of the image data. Docker core removed |
|
| 71 |
+this functionality in the 1.7 version. If you liked this functionality, you can |
|
| 72 |
+still find it in the third-party dockviz tool: https://github.com/justone/dockviz. |
|
| 73 |
+ |
|
| 74 |
+## Listing images in a desired format |
|
| 75 |
+ |
|
| 76 |
+When using the --format option, the image command will either output the data |
|
| 77 |
+exactly as the template declares or, when using the `table` directive, will |
|
| 78 |
+include column headers as well. You can use special characters like `\t` for |
|
| 79 |
+inserting tab spacing between columns. |
|
| 80 |
+ |
|
| 81 |
+The following example uses a template without headers and outputs the ID and |
|
| 82 |
+Repository entries separated by a colon for all images: |
|
| 83 |
+ |
|
| 84 |
+ docker images --format "{{.ID}}: {{.Repository}}"
|
|
| 85 |
+ 77af4d6b9913: <none> |
|
| 86 |
+ b6fa739cedf5: committ |
|
| 87 |
+ 78a85c484bad: ipbabble |
|
| 88 |
+ 30557a29d5ab: docker |
|
| 89 |
+ 5ed6274db6ce: <none> |
|
| 90 |
+ 746b819f315e: postgres |
|
| 91 |
+ 746b819f315e: postgres |
|
| 92 |
+ 746b819f315e: postgres |
|
| 93 |
+ 746b819f315e: postgres |
|
| 94 |
+ |
|
| 95 |
+To list all images with their repository and tag in a table format you can use: |
|
| 96 |
+ |
|
| 97 |
+ docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}"
|
|
| 98 |
+ IMAGE ID REPOSITORY TAG |
|
| 99 |
+ 77af4d6b9913 <none> <none> |
|
| 100 |
+ b6fa739cedf5 committ latest |
|
| 101 |
+ 78a85c484bad ipbabble <none> |
|
| 102 |
+ 30557a29d5ab docker latest |
|
| 103 |
+ 5ed6274db6ce <none> <none> |
|
| 104 |
+ 746b819f315e postgres 9 |
|
| 105 |
+ 746b819f315e postgres 9.3 |
|
| 106 |
+ 746b819f315e postgres 9.3.5 |
|
| 107 |
+ 746b819f315e postgres latest |
|
| 108 |
+ |
|
| 109 |
+Valid template placeholders are listed above. |
|
| 110 |
+ |
|
| 111 |
+## Listing only the shortened image IDs |
|
| 112 |
+ |
|
| 113 |
+Listing just the shortened image IDs. This can be useful for some automated |
|
| 114 |
+tools. |
|
| 115 |
+ |
|
| 116 |
+ docker image ls -q |
| 0 | 117 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,189 @@ |
| 0 |
+This command pulls down an image or a repository from a registry. If |
|
| 1 |
+there is more than one image for a repository (e.g., fedora) then all |
|
| 2 |
+images for that repository name can be pulled down including any tags |
|
| 3 |
+(see the option **-a** or **--all-tags**). |
|
| 4 |
+ |
|
| 5 |
+If you do not specify a `REGISTRY_HOST`, the command uses Docker's public |
|
| 6 |
+registry located at `registry-1.docker.io` by default. |
|
| 7 |
+ |
|
| 8 |
+# EXAMPLES |
|
| 9 |
+ |
|
| 10 |
+### Pull an image from Docker Hub |
|
| 11 |
+ |
|
| 12 |
+To download a particular image, or set of images (i.e., a repository), use |
|
| 13 |
+`docker image pull`. If no tag is provided, Docker Engine uses the `:latest` tag as a |
|
| 14 |
+default. This command pulls the `debian:latest` image: |
|
| 15 |
+ |
|
| 16 |
+ $ docker image pull debian |
|
| 17 |
+ |
|
| 18 |
+ Using default tag: latest |
|
| 19 |
+ latest: Pulling from library/debian |
|
| 20 |
+ fdd5d7827f33: Pull complete |
|
| 21 |
+ a3ed95caeb02: Pull complete |
|
| 22 |
+ Digest: sha256:e7d38b3517548a1c71e41bffe9c8ae6d6d29546ce46bf62159837aad072c90aa |
|
| 23 |
+ Status: Downloaded newer image for debian:latest |
|
| 24 |
+ |
|
| 25 |
+Docker images can consist of multiple layers. In the example above, the image |
|
| 26 |
+consists of two layers; `fdd5d7827f33` and `a3ed95caeb02`. |
|
| 27 |
+ |
|
| 28 |
+Layers can be reused by images. For example, the `debian:jessie` image shares |
|
| 29 |
+both layers with `debian:latest`. Pulling the `debian:jessie` image therefore |
|
| 30 |
+only pulls its metadata, but not its layers, because all layers are already |
|
| 31 |
+present locally: |
|
| 32 |
+ |
|
| 33 |
+ $ docker image pull debian:jessie |
|
| 34 |
+ |
|
| 35 |
+ jessie: Pulling from library/debian |
|
| 36 |
+ fdd5d7827f33: Already exists |
|
| 37 |
+ a3ed95caeb02: Already exists |
|
| 38 |
+ Digest: sha256:a9c958be96d7d40df920e7041608f2f017af81800ca5ad23e327bc402626b58e |
|
| 39 |
+ Status: Downloaded newer image for debian:jessie |
|
| 40 |
+ |
|
| 41 |
+To see which images are present locally, use the **docker-images(1)** |
|
| 42 |
+command: |
|
| 43 |
+ |
|
| 44 |
+ $ docker images |
|
| 45 |
+ |
|
| 46 |
+ REPOSITORY TAG IMAGE ID CREATED SIZE |
|
| 47 |
+ debian jessie f50f9524513f 5 days ago 125.1 MB |
|
| 48 |
+ debian latest f50f9524513f 5 days ago 125.1 MB |
|
| 49 |
+ |
|
| 50 |
+Docker uses a content-addressable image store, and the image ID is a SHA256 |
|
| 51 |
+digest covering the image's configuration and layers. In the example above, |
|
| 52 |
+`debian:jessie` and `debian:latest` have the same image ID because they are |
|
| 53 |
+actually the *same* image tagged with different names. Because they are the |
|
| 54 |
+same image, their layers are stored only once and do not consume extra disk |
|
| 55 |
+space. |
|
| 56 |
+ |
|
| 57 |
+For more information about images, layers, and the content-addressable store, |
|
| 58 |
+refer to [understand images, containers, and storage drivers](https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/) |
|
| 59 |
+in the online documentation. |
|
| 60 |
+ |
|
| 61 |
+ |
|
| 62 |
+## Pull an image by digest (immutable identifier) |
|
| 63 |
+ |
|
| 64 |
+So far, you've pulled images by their name (and "tag"). Using names and tags is |
|
| 65 |
+a convenient way to work with images. When using tags, you can `docker image pull` an |
|
| 66 |
+image again to make sure you have the most up-to-date version of that image. |
|
| 67 |
+For example, `docker image pull ubuntu:14.04` pulls the latest version of the Ubuntu |
|
| 68 |
+14.04 image. |
|
| 69 |
+ |
|
| 70 |
+In some cases you don't want images to be updated to newer versions, but prefer |
|
| 71 |
+to use a fixed version of an image. Docker enables you to pull an image by its |
|
| 72 |
+*digest*. When pulling an image by digest, you specify *exactly* which version |
|
| 73 |
+of an image to pull. Doing so, allows you to "pin" an image to that version, |
|
| 74 |
+and guarantee that the image you're using is always the same. |
|
| 75 |
+ |
|
| 76 |
+To know the digest of an image, pull the image first. Let's pull the latest |
|
| 77 |
+`ubuntu:14.04` image from Docker Hub: |
|
| 78 |
+ |
|
| 79 |
+ $ docker image pull ubuntu:14.04 |
|
| 80 |
+ |
|
| 81 |
+ 14.04: Pulling from library/ubuntu |
|
| 82 |
+ 5a132a7e7af1: Pull complete |
|
| 83 |
+ fd2731e4c50c: Pull complete |
|
| 84 |
+ 28a2f68d1120: Pull complete |
|
| 85 |
+ a3ed95caeb02: Pull complete |
|
| 86 |
+ Digest: sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 87 |
+ Status: Downloaded newer image for ubuntu:14.04 |
|
| 88 |
+ |
|
| 89 |
+Docker prints the digest of the image after the pull has finished. In the example |
|
| 90 |
+above, the digest of the image is: |
|
| 91 |
+ |
|
| 92 |
+ sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 93 |
+ |
|
| 94 |
+Docker also prints the digest of an image when *pushing* to a registry. This |
|
| 95 |
+may be useful if you want to pin to a version of the image you just pushed. |
|
| 96 |
+ |
|
| 97 |
+A digest takes the place of the tag when pulling an image, for example, to |
|
| 98 |
+pull the above image by digest, run the following command: |
|
| 99 |
+ |
|
| 100 |
+ $ docker image pull ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 101 |
+ |
|
| 102 |
+ sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2: Pulling from library/ubuntu |
|
| 103 |
+ 5a132a7e7af1: Already exists |
|
| 104 |
+ fd2731e4c50c: Already exists |
|
| 105 |
+ 28a2f68d1120: Already exists |
|
| 106 |
+ a3ed95caeb02: Already exists |
|
| 107 |
+ Digest: sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 108 |
+ Status: Downloaded newer image for ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 109 |
+ |
|
| 110 |
+Digest can also be used in the `FROM` of a Dockerfile, for example: |
|
| 111 |
+ |
|
| 112 |
+ FROM ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
|
| 113 |
+ MAINTAINER some maintainer <maintainer@example.com> |
|
| 114 |
+ |
|
| 115 |
+> **Note**: Using this feature "pins" an image to a specific version in time. |
|
| 116 |
+> Docker will therefore not pull updated versions of an image, which may include |
|
| 117 |
+> security updates. If you want to pull an updated image, you need to change the |
|
| 118 |
+> digest accordingly. |
|
| 119 |
+ |
|
| 120 |
+## Pulling from a different registry |
|
| 121 |
+ |
|
| 122 |
+By default, `docker image pull` pulls images from Docker Hub. It is also possible to |
|
| 123 |
+manually specify the path of a registry to pull from. For example, if you have |
|
| 124 |
+set up a local registry, you can specify its path to pull from it. A registry |
|
| 125 |
+path is similar to a URL, but does not contain a protocol specifier (`https://`). |
|
| 126 |
+ |
|
| 127 |
+The following command pulls the `testing/test-image` image from a local registry |
|
| 128 |
+listening on port 5000 (`myregistry.local:5000`): |
|
| 129 |
+ |
|
| 130 |
+ $ docker image pull myregistry.local:5000/testing/test-image |
|
| 131 |
+ |
|
| 132 |
+Registry credentials are managed by **docker-login(1)**. |
|
| 133 |
+ |
|
| 134 |
+Docker uses the `https://` protocol to communicate with a registry, unless the |
|
| 135 |
+registry is allowed to be accessed over an insecure connection. Refer to the |
|
| 136 |
+[insecure registries](https://docs.docker.com/engine/reference/commandline/daemon/#insecure-registries) |
|
| 137 |
+section in the online documentation for more information. |
|
| 138 |
+ |
|
| 139 |
+ |
|
| 140 |
+## Pull a repository with multiple images |
|
| 141 |
+ |
|
| 142 |
+By default, `docker image pull` pulls a *single* image from the registry. A repository |
|
| 143 |
+can contain multiple images. To pull all images from a repository, provide the |
|
| 144 |
+`-a` (or `--all-tags`) option when using `docker image pull`. |
|
| 145 |
+ |
|
| 146 |
+This command pulls all images from the `fedora` repository: |
|
| 147 |
+ |
|
| 148 |
+ $ docker image pull --all-tags fedora |
|
| 149 |
+ |
|
| 150 |
+ Pulling repository fedora |
|
| 151 |
+ ad57ef8d78d7: Download complete |
|
| 152 |
+ 105182bb5e8b: Download complete |
|
| 153 |
+ 511136ea3c5a: Download complete |
|
| 154 |
+ 73bd853d2ea5: Download complete |
|
| 155 |
+ .... |
|
| 156 |
+ |
|
| 157 |
+ Status: Downloaded newer image for fedora |
|
| 158 |
+ |
|
| 159 |
+After the pull has completed use the `docker images` command to see the |
|
| 160 |
+images that were pulled. The example below shows all the `fedora` images |
|
| 161 |
+that are present locally: |
|
| 162 |
+ |
|
| 163 |
+ $ docker images fedora |
|
| 164 |
+ |
|
| 165 |
+ REPOSITORY TAG IMAGE ID CREATED SIZE |
|
| 166 |
+ fedora rawhide ad57ef8d78d7 5 days ago 359.3 MB |
|
| 167 |
+ fedora 20 105182bb5e8b 5 days ago 372.7 MB |
|
| 168 |
+ fedora heisenbug 105182bb5e8b 5 days ago 372.7 MB |
|
| 169 |
+ fedora latest 105182bb5e8b 5 days ago 372.7 MB |
|
| 170 |
+ |
|
| 171 |
+ |
|
| 172 |
+## Canceling a pull |
|
| 173 |
+ |
|
| 174 |
+Killing the `docker image pull` process, for example by pressing `CTRL-c` while it is |
|
| 175 |
+running in a terminal, will terminate the pull operation. |
|
| 176 |
+ |
|
| 177 |
+ $ docker image pull fedora |
|
| 178 |
+ |
|
| 179 |
+ Using default tag: latest |
|
| 180 |
+ latest: Pulling from library/fedora |
|
| 181 |
+ a3ed95caeb02: Pulling fs layer |
|
| 182 |
+ 236608c7b546: Pulling fs layer |
|
| 183 |
+ ^C |
|
| 184 |
+ |
|
| 185 |
+> **Note**: Technically, the Engine terminates a pull operation when the |
|
| 186 |
+> connection between the Docker Engine daemon and the Docker Engine client |
|
| 187 |
+> initiating the pull is lost. If the connection with the Engine daemon is |
|
| 188 |
+> lost for other reasons than a manual interaction, the pull is also aborted. |
| 0 | 189 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,34 @@ |
| 0 |
+Use `docker image push` to share your images to the [Docker Hub](https://hub.docker.com) |
|
| 1 |
+registry or to a self-hosted one. |
|
| 2 |
+ |
|
| 3 |
+Refer to **docker-image-tag(1)** for more information about valid image and tag names. |
|
| 4 |
+ |
|
| 5 |
+Killing the **docker image push** process, for example by pressing **CTRL-c** while it |
|
| 6 |
+is running in a terminal, terminates the push operation. |
|
| 7 |
+ |
|
| 8 |
+Registry credentials are managed by **docker-login(1)**. |
|
| 9 |
+ |
|
| 10 |
+# EXAMPLES |
|
| 11 |
+ |
|
| 12 |
+## Pushing a new image to a registry |
|
| 13 |
+ |
|
| 14 |
+First save the new image by finding the container ID (using **docker container ls**) |
|
| 15 |
+and then committing it to a new image name. Note that only a-z0-9-_. are |
|
| 16 |
+allowed when naming images: |
|
| 17 |
+ |
|
| 18 |
+ # docker container commit c16378f943fe rhel-httpd |
|
| 19 |
+ |
|
| 20 |
+Now, push the image to the registry using the image ID. In this example the |
|
| 21 |
+registry is on host named `registry-host` and listening on port `5000`. To do |
|
| 22 |
+this, tag the image with the host name or IP address, and the port of the |
|
| 23 |
+registry: |
|
| 24 |
+ |
|
| 25 |
+ # docker image tag rhel-httpd registry-host:5000/myadmin/rhel-httpd |
|
| 26 |
+ # docker image push registry-host:5000/myadmin/rhel-httpd |
|
| 27 |
+ |
|
| 28 |
+Check that this worked by running: |
|
| 29 |
+ |
|
| 30 |
+ # docker image ls |
|
| 31 |
+ |
|
| 32 |
+You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd` |
|
| 33 |
+listed. |
| 0 | 34 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,11 @@ |
| 0 |
+Removes one or more images from the host node. This does not remove images from |
|
| 1 |
+a registry. You cannot remove an image of a running container unless you use the |
|
| 2 |
+**-f** option. To see all images on a host use the **docker image ls** command. |
|
| 3 |
+ |
|
| 4 |
+# EXAMPLES |
|
| 5 |
+ |
|
| 6 |
+## Removing an image |
|
| 7 |
+ |
|
| 8 |
+Here is an example of removing an image: |
|
| 9 |
+ |
|
| 10 |
+ docker image rm fedora/httpd |
| 0 | 11 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,19 @@ |
| 0 |
+Produces a tarred repository to the standard output stream. Contains all |
|
| 1 |
+parent layers, and all tags + versions, or specified repo:tag. |
|
| 2 |
+ |
|
| 3 |
+Stream to a file instead of STDOUT by using **-o**. |
|
| 4 |
+ |
|
| 5 |
+# EXAMPLES |
|
| 6 |
+ |
|
| 7 |
+Save all fedora repository images to a fedora-all.tar and save the latest |
|
| 8 |
+fedora image to a fedora-latest.tar: |
|
| 9 |
+ |
|
| 10 |
+ $ docker image save fedora > fedora-all.tar |
|
| 11 |
+ $ docker image save --output=fedora-latest.tar fedora:latest |
|
| 12 |
+ $ ls -sh fedora-all.tar |
|
| 13 |
+ 721M fedora-all.tar |
|
| 14 |
+ $ ls -sh fedora-latest.tar |
|
| 15 |
+ 367M fedora-latest.tar |
|
| 16 |
+ |
|
| 17 |
+# See also |
|
| 18 |
+**docker-image-load(1)** to load an image from a tar archive on STDIN. |
| 0 | 19 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,53 @@ |
| 0 |
+Assigns a new alias to an image in a registry. An alias refers to the |
|
| 1 |
+entire image name including the optional `TAG` after the ':'. |
|
| 2 |
+ |
|
| 3 |
+# OPTIONS |
|
| 4 |
+**NAME** |
|
| 5 |
+ The image name which is made up of slash-separated name components, |
|
| 6 |
+ optionally prefixed by a registry hostname. The hostname must comply with |
|
| 7 |
+ standard DNS rules, but may not contain underscores. If a hostname is |
|
| 8 |
+ present, it may optionally be followed by a port number in the format |
|
| 9 |
+ `:8080`. If not present, the command uses Docker's public registry located at |
|
| 10 |
+ `registry-1.docker.io` by default. Name components may contain lowercase |
|
| 11 |
+ characters, digits and separators. A separator is defined as a period, one or |
|
| 12 |
+ two underscores, or one or more dashes. A name component may not start or end |
|
| 13 |
+ with a separator. |
|
| 14 |
+ |
|
| 15 |
+**TAG** |
|
| 16 |
+ The tag assigned to the image to version and distinguish images with the same |
|
| 17 |
+ name. The tag name may contain lowercase and uppercase characters, digits, |
|
| 18 |
+ underscores, periods and dashes. A tag name may not start with a period or a |
|
| 19 |
+ dash and may contain a maximum of 128 characters. |
|
| 20 |
+ |
|
| 21 |
+# EXAMPLES |
|
| 22 |
+ |
|
| 23 |
+## Tagging an image referenced by ID |
|
| 24 |
+ |
|
| 25 |
+To tag a local image with ID "0e5574283393" into the "fedora" repository with |
|
| 26 |
+"version1.0": |
|
| 27 |
+ |
|
| 28 |
+ docker image tag 0e5574283393 fedora/httpd:version1.0 |
|
| 29 |
+ |
|
| 30 |
+## Tagging an image referenced by Name |
|
| 31 |
+ |
|
| 32 |
+To tag a local image with name "httpd" into the "fedora" repository with |
|
| 33 |
+"version1.0": |
|
| 34 |
+ |
|
| 35 |
+ docker image tag httpd fedora/httpd:version1.0 |
|
| 36 |
+ |
|
| 37 |
+Note that since the tag name is not specified, the alias is created for an |
|
| 38 |
+existing local version `httpd:latest`. |
|
| 39 |
+ |
|
| 40 |
+## Tagging an image referenced by Name and Tag |
|
| 41 |
+ |
|
| 42 |
+To tag a local image with name "httpd" and tag "test" into the "fedora" |
|
| 43 |
+repository with "version1.0.test": |
|
| 44 |
+ |
|
| 45 |
+ docker image tag httpd:test fedora/httpd:version1.0.test |
|
| 46 |
+ |
|
| 47 |
+## Tagging an image for a private repository |
|
| 48 |
+ |
|
| 49 |
+To push an image to a private registry and not the central Docker |
|
| 50 |
+registry you must tag it with the registry hostname and port (if needed). |
|
| 51 |
+ |
|
| 52 |
+ docker image tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0 |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,286 @@ |
| 0 |
+This displays the low-level information on Docker object(s) (e.g. container, |
|
| 1 |
+image, volume,network, node, service, or task) identified by name or ID. By default, |
|
| 2 |
+this will render all results in a JSON array. If the container and image have |
|
| 3 |
+the same name, this will return container JSON for unspecified type. If a format |
|
| 4 |
+is specified, the given template will be executed for each result. |
|
| 5 |
+ |
|
| 6 |
+# EXAMPLES |
|
| 7 |
+ |
|
| 8 |
+Get information about an image when image name conflicts with the container name, |
|
| 9 |
+e.g. both image and container are named rhel7: |
|
| 10 |
+ |
|
| 11 |
+ $ docker inspect --type=image rhel7 |
|
| 12 |
+ [ |
|
| 13 |
+ {
|
|
| 14 |
+ "Id": "fe01a428b9d9de35d29531e9994157978e8c48fa693e1bf1d221dffbbb67b170", |
|
| 15 |
+ "Parent": "10acc31def5d6f249b548e01e8ffbaccfd61af0240c17315a7ad393d022c5ca2", |
|
| 16 |
+ .... |
|
| 17 |
+ } |
|
| 18 |
+ ] |
|
| 19 |
+ |
|
| 20 |
+## Getting information on a container |
|
| 21 |
+ |
|
| 22 |
+To get information on a container use its ID or instance name: |
|
| 23 |
+ |
|
| 24 |
+ $ docker inspect d2cc496561d6 |
|
| 25 |
+ [{
|
|
| 26 |
+ "Id": "d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47", |
|
| 27 |
+ "Created": "2015-06-08T16:18:02.505155285Z", |
|
| 28 |
+ "Path": "bash", |
|
| 29 |
+ "Args": [], |
|
| 30 |
+ "State": {
|
|
| 31 |
+ "Running": false, |
|
| 32 |
+ "Paused": false, |
|
| 33 |
+ "Restarting": false, |
|
| 34 |
+ "OOMKilled": false, |
|
| 35 |
+ "Dead": false, |
|
| 36 |
+ "Pid": 0, |
|
| 37 |
+ "ExitCode": 0, |
|
| 38 |
+ "Error": "", |
|
| 39 |
+ "StartedAt": "2015-06-08T16:18:03.643865954Z", |
|
| 40 |
+ "FinishedAt": "2015-06-08T16:57:06.448552862Z" |
|
| 41 |
+ }, |
|
| 42 |
+ "Image": "ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", |
|
| 43 |
+ "NetworkSettings": {
|
|
| 44 |
+ "Bridge": "", |
|
| 45 |
+ "SandboxID": "6b4851d1903e16dd6a567bd526553a86664361f31036eaaa2f8454d6f4611f6f", |
|
| 46 |
+ "HairpinMode": false, |
|
| 47 |
+ "LinkLocalIPv6Address": "", |
|
| 48 |
+ "LinkLocalIPv6PrefixLen": 0, |
|
| 49 |
+ "Ports": {},
|
|
| 50 |
+ "SandboxKey": "/var/run/docker/netns/6b4851d1903e", |
|
| 51 |
+ "SecondaryIPAddresses": null, |
|
| 52 |
+ "SecondaryIPv6Addresses": null, |
|
| 53 |
+ "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", |
|
| 54 |
+ "Gateway": "172.17.0.1", |
|
| 55 |
+ "GlobalIPv6Address": "", |
|
| 56 |
+ "GlobalIPv6PrefixLen": 0, |
|
| 57 |
+ "IPAddress": "172.17.0.2", |
|
| 58 |
+ "IPPrefixLen": 16, |
|
| 59 |
+ "IPv6Gateway": "", |
|
| 60 |
+ "MacAddress": "02:42:ac:12:00:02", |
|
| 61 |
+ "Networks": {
|
|
| 62 |
+ "bridge": {
|
|
| 63 |
+ "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", |
|
| 64 |
+ "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", |
|
| 65 |
+ "Gateway": "172.17.0.1", |
|
| 66 |
+ "IPAddress": "172.17.0.2", |
|
| 67 |
+ "IPPrefixLen": 16, |
|
| 68 |
+ "IPv6Gateway": "", |
|
| 69 |
+ "GlobalIPv6Address": "", |
|
| 70 |
+ "GlobalIPv6PrefixLen": 0, |
|
| 71 |
+ "MacAddress": "02:42:ac:12:00:02" |
|
| 72 |
+ } |
|
| 73 |
+ } |
|
| 74 |
+ |
|
| 75 |
+ }, |
|
| 76 |
+ "ResolvConfPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/resolv.conf", |
|
| 77 |
+ "HostnamePath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hostname", |
|
| 78 |
+ "HostsPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hosts", |
|
| 79 |
+ "LogPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47-json.log", |
|
| 80 |
+ "Name": "/adoring_wozniak", |
|
| 81 |
+ "RestartCount": 0, |
|
| 82 |
+ "Driver": "devicemapper", |
|
| 83 |
+ "MountLabel": "", |
|
| 84 |
+ "ProcessLabel": "", |
|
| 85 |
+ "Mounts": [ |
|
| 86 |
+ {
|
|
| 87 |
+ "Source": "/data", |
|
| 88 |
+ "Destination": "/data", |
|
| 89 |
+ "Mode": "ro,Z", |
|
| 90 |
+ "RW": false |
|
| 91 |
+ "Propagation": "" |
|
| 92 |
+ } |
|
| 93 |
+ ], |
|
| 94 |
+ "AppArmorProfile": "", |
|
| 95 |
+ "ExecIDs": null, |
|
| 96 |
+ "HostConfig": {
|
|
| 97 |
+ "Binds": null, |
|
| 98 |
+ "ContainerIDFile": "", |
|
| 99 |
+ "Memory": 0, |
|
| 100 |
+ "MemorySwap": 0, |
|
| 101 |
+ "CpuShares": 0, |
|
| 102 |
+ "CpuPeriod": 0, |
|
| 103 |
+ "CpusetCpus": "", |
|
| 104 |
+ "CpusetMems": "", |
|
| 105 |
+ "CpuQuota": 0, |
|
| 106 |
+ "BlkioWeight": 0, |
|
| 107 |
+ "OomKillDisable": false, |
|
| 108 |
+ "Privileged": false, |
|
| 109 |
+ "PortBindings": {},
|
|
| 110 |
+ "Links": null, |
|
| 111 |
+ "PublishAllPorts": false, |
|
| 112 |
+ "Dns": null, |
|
| 113 |
+ "DnsSearch": null, |
|
| 114 |
+ "DnsOptions": null, |
|
| 115 |
+ "ExtraHosts": null, |
|
| 116 |
+ "VolumesFrom": null, |
|
| 117 |
+ "Devices": [], |
|
| 118 |
+ "NetworkMode": "bridge", |
|
| 119 |
+ "IpcMode": "", |
|
| 120 |
+ "PidMode": "", |
|
| 121 |
+ "UTSMode": "", |
|
| 122 |
+ "CapAdd": null, |
|
| 123 |
+ "CapDrop": null, |
|
| 124 |
+ "RestartPolicy": {
|
|
| 125 |
+ "Name": "no", |
|
| 126 |
+ "MaximumRetryCount": 0 |
|
| 127 |
+ }, |
|
| 128 |
+ "SecurityOpt": null, |
|
| 129 |
+ "ReadonlyRootfs": false, |
|
| 130 |
+ "Ulimits": null, |
|
| 131 |
+ "LogConfig": {
|
|
| 132 |
+ "Type": "json-file", |
|
| 133 |
+ "Config": {}
|
|
| 134 |
+ }, |
|
| 135 |
+ "CgroupParent": "" |
|
| 136 |
+ }, |
|
| 137 |
+ "GraphDriver": {
|
|
| 138 |
+ "Name": "devicemapper", |
|
| 139 |
+ "Data": {
|
|
| 140 |
+ "DeviceId": "5", |
|
| 141 |
+ "DeviceName": "docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47", |
|
| 142 |
+ "DeviceSize": "171798691840" |
|
| 143 |
+ } |
|
| 144 |
+ }, |
|
| 145 |
+ "Config": {
|
|
| 146 |
+ "Hostname": "d2cc496561d6", |
|
| 147 |
+ "Domainname": "", |
|
| 148 |
+ "User": "", |
|
| 149 |
+ "AttachStdin": true, |
|
| 150 |
+ "AttachStdout": true, |
|
| 151 |
+ "AttachStderr": true, |
|
| 152 |
+ "ExposedPorts": null, |
|
| 153 |
+ "Tty": true, |
|
| 154 |
+ "OpenStdin": true, |
|
| 155 |
+ "StdinOnce": true, |
|
| 156 |
+ "Env": null, |
|
| 157 |
+ "Cmd": [ |
|
| 158 |
+ "bash" |
|
| 159 |
+ ], |
|
| 160 |
+ "Image": "fedora", |
|
| 161 |
+ "Volumes": null, |
|
| 162 |
+ "VolumeDriver": "", |
|
| 163 |
+ "WorkingDir": "", |
|
| 164 |
+ "Entrypoint": null, |
|
| 165 |
+ "NetworkDisabled": false, |
|
| 166 |
+ "MacAddress": "", |
|
| 167 |
+ "OnBuild": null, |
|
| 168 |
+ "Labels": {},
|
|
| 169 |
+ "Memory": 0, |
|
| 170 |
+ "MemorySwap": 0, |
|
| 171 |
+ "CpuShares": 0, |
|
| 172 |
+ "Cpuset": "", |
|
| 173 |
+ "StopSignal": "SIGTERM" |
|
| 174 |
+ } |
|
| 175 |
+ } |
|
| 176 |
+ ] |
|
| 177 |
+## Getting the IP address of a container instance |
|
| 178 |
+ |
|
| 179 |
+To get the IP address of a container use: |
|
| 180 |
+ |
|
| 181 |
+ $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' d2cc496561d6
|
|
| 182 |
+ 172.17.0.2 |
|
| 183 |
+ |
|
| 184 |
+## Listing all port bindings |
|
| 185 |
+ |
|
| 186 |
+One can loop over arrays and maps in the results to produce simple text |
|
| 187 |
+output: |
|
| 188 |
+ |
|
| 189 |
+ $ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} \
|
|
| 190 |
+ {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' d2cc496561d6
|
|
| 191 |
+ 80/tcp -> 80 |
|
| 192 |
+ |
|
| 193 |
+You can get more information about how to write a Go template from: |
|
| 194 |
+https://golang.org/pkg/text/template/. |
|
| 195 |
+ |
|
| 196 |
+## Getting size information on a container |
|
| 197 |
+ |
|
| 198 |
+ $ docker inspect -s d2cc496561d6 |
|
| 199 |
+ [ |
|
| 200 |
+ {
|
|
| 201 |
+ .... |
|
| 202 |
+ "SizeRw": 0, |
|
| 203 |
+ "SizeRootFs": 972, |
|
| 204 |
+ .... |
|
| 205 |
+ } |
|
| 206 |
+ ] |
|
| 207 |
+ |
|
| 208 |
+## Getting information on an image |
|
| 209 |
+ |
|
| 210 |
+Use an image's ID or name (e.g., repository/name[:tag]) to get information |
|
| 211 |
+about the image: |
|
| 212 |
+ |
|
| 213 |
+ $ docker inspect ded7cd95e059 |
|
| 214 |
+ [{
|
|
| 215 |
+ "Id": "ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", |
|
| 216 |
+ "Parent": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731", |
|
| 217 |
+ "Comment": "", |
|
| 218 |
+ "Created": "2015-05-27T16:58:22.937503085Z", |
|
| 219 |
+ "Container": "76cf7f67d83a7a047454b33007d03e32a8f474ad332c3a03c94537edd22b312b", |
|
| 220 |
+ "ContainerConfig": {
|
|
| 221 |
+ "Hostname": "76cf7f67d83a", |
|
| 222 |
+ "Domainname": "", |
|
| 223 |
+ "User": "", |
|
| 224 |
+ "AttachStdin": false, |
|
| 225 |
+ "AttachStdout": false, |
|
| 226 |
+ "AttachStderr": false, |
|
| 227 |
+ "ExposedPorts": null, |
|
| 228 |
+ "Tty": false, |
|
| 229 |
+ "OpenStdin": false, |
|
| 230 |
+ "StdinOnce": false, |
|
| 231 |
+ "Env": null, |
|
| 232 |
+ "Cmd": [ |
|
| 233 |
+ "/bin/sh", |
|
| 234 |
+ "-c", |
|
| 235 |
+ "#(nop) ADD file:4be46382bcf2b095fcb9fe8334206b584eff60bb3fad8178cbd97697fcb2ea83 in /" |
|
| 236 |
+ ], |
|
| 237 |
+ "Image": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731", |
|
| 238 |
+ "Volumes": null, |
|
| 239 |
+ "VolumeDriver": "", |
|
| 240 |
+ "WorkingDir": "", |
|
| 241 |
+ "Entrypoint": null, |
|
| 242 |
+ "NetworkDisabled": false, |
|
| 243 |
+ "MacAddress": "", |
|
| 244 |
+ "OnBuild": null, |
|
| 245 |
+ "Labels": {}
|
|
| 246 |
+ }, |
|
| 247 |
+ "DockerVersion": "1.6.0", |
|
| 248 |
+ "Author": "Lokesh Mandvekar \u003clsm5@fedoraproject.org\u003e", |
|
| 249 |
+ "Config": {
|
|
| 250 |
+ "Hostname": "76cf7f67d83a", |
|
| 251 |
+ "Domainname": "", |
|
| 252 |
+ "User": "", |
|
| 253 |
+ "AttachStdin": false, |
|
| 254 |
+ "AttachStdout": false, |
|
| 255 |
+ "AttachStderr": false, |
|
| 256 |
+ "ExposedPorts": null, |
|
| 257 |
+ "Tty": false, |
|
| 258 |
+ "OpenStdin": false, |
|
| 259 |
+ "StdinOnce": false, |
|
| 260 |
+ "Env": null, |
|
| 261 |
+ "Cmd": null, |
|
| 262 |
+ "Image": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731", |
|
| 263 |
+ "Volumes": null, |
|
| 264 |
+ "VolumeDriver": "", |
|
| 265 |
+ "WorkingDir": "", |
|
| 266 |
+ "Entrypoint": null, |
|
| 267 |
+ "NetworkDisabled": false, |
|
| 268 |
+ "MacAddress": "", |
|
| 269 |
+ "OnBuild": null, |
|
| 270 |
+ "Labels": {}
|
|
| 271 |
+ }, |
|
| 272 |
+ "Architecture": "amd64", |
|
| 273 |
+ "Os": "linux", |
|
| 274 |
+ "Size": 186507296, |
|
| 275 |
+ "VirtualSize": 186507296, |
|
| 276 |
+ "GraphDriver": {
|
|
| 277 |
+ "Name": "devicemapper", |
|
| 278 |
+ "Data": {
|
|
| 279 |
+ "DeviceId": "3", |
|
| 280 |
+ "DeviceName": "docker-253:1-2763198-ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", |
|
| 281 |
+ "DeviceSize": "171798691840" |
|
| 282 |
+ } |
|
| 283 |
+ } |
|
| 284 |
+ } |
|
| 285 |
+ ] |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,22 @@ |
| 0 |
+Log in to a Docker Registry located on the specified |
|
| 1 |
+`SERVER`. You can specify a URL or a `hostname` for the `SERVER` value. If you |
|
| 2 |
+do not specify a `SERVER`, the command uses Docker's public registry located at |
|
| 3 |
+`https://registry-1.docker.io/` by default. To get a username/password for Docker's public registry, create an account on Docker Hub. |
|
| 4 |
+ |
|
| 5 |
+`docker login` requires user to use `sudo` or be `root`, except when: |
|
| 6 |
+ |
|
| 7 |
+1. connecting to a remote daemon, such as a `docker-machine` provisioned `docker engine`. |
|
| 8 |
+2. user is added to the `docker` group. This will impact the security of your system; the `docker` group is `root` equivalent. See [Docker Daemon Attack Surface](https://docs.docker.com/engine/articles/security/#docker-daemon-attack-surface) for details. |
|
| 9 |
+ |
|
| 10 |
+You can log into any public or private repository for which you have |
|
| 11 |
+credentials. When you log in, the command stores encoded credentials in |
|
| 12 |
+`$HOME/.docker/config.json` on Linux or `%USERPROFILE%/.docker/config.json` on Windows. |
|
| 13 |
+ |
|
| 14 |
+# EXAMPLES |
|
| 15 |
+ |
|
| 16 |
+## Login to a registry on your localhost |
|
| 17 |
+ |
|
| 18 |
+ # docker login localhost:8080 |
|
| 19 |
+ |
|
| 20 |
+# See also |
|
| 21 |
+**docker-logout(1)** to log out from a Docker registry. |
| 0 | 22 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,13 @@ |
| 0 |
+Log out of a Docker Registry located on the specified `SERVER`. You can |
|
| 1 |
+specify a URL or a `hostname` for the `SERVER` value. If you do not specify a |
|
| 2 |
+`SERVER`, the command attempts to log you out of Docker's public registry |
|
| 3 |
+located at `https://registry-1.docker.io/` by default. |
|
| 4 |
+ |
|
| 5 |
+# EXAMPLES |
|
| 6 |
+ |
|
| 7 |
+## Log out from a registry on your localhost |
|
| 8 |
+ |
|
| 9 |
+ # docker logout localhost:8080 |
|
| 10 |
+ |
|
| 11 |
+# See also |
|
| 12 |
+**docker-login(1)** to log in to a Docker registry server. |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,39 @@ |
| 0 |
+Connects a container to a network. You can connect a container by name |
|
| 1 |
+or by ID. Once connected, the container can communicate with other containers in |
|
| 2 |
+the same network. |
|
| 3 |
+ |
|
| 4 |
+```bash |
|
| 5 |
+$ docker network connect multi-host-network container1 |
|
| 6 |
+``` |
|
| 7 |
+ |
|
| 8 |
+You can also use the `docker run --network=<network-name>` option to start a container and immediately connect it to a network. |
|
| 9 |
+ |
|
| 10 |
+```bash |
|
| 11 |
+$ docker run -itd --network=multi-host-network --ip 172.20.88.22 --ip6 2001:db8::8822 busybox |
|
| 12 |
+``` |
|
| 13 |
+You can pause, restart, and stop containers that are connected to a network. |
|
| 14 |
+A container connects to its configured networks when it runs. |
|
| 15 |
+ |
|
| 16 |
+If specified, the container's IP address(es) is reapplied when a stopped |
|
| 17 |
+container is restarted. If the IP address is no longer available, the container |
|
| 18 |
+fails to start. One way to guarantee that the IP address is available is |
|
| 19 |
+to specify an `--ip-range` when creating the network, and choose the static IP |
|
| 20 |
+address(es) from outside that range. This ensures that the IP address is not |
|
| 21 |
+given to another container while this container is not on the network. |
|
| 22 |
+ |
|
| 23 |
+```bash |
|
| 24 |
+$ docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 multi-host-network |
|
| 25 |
+``` |
|
| 26 |
+ |
|
| 27 |
+```bash |
|
| 28 |
+$ docker network connect --ip 172.20.128.2 multi-host-network container2 |
|
| 29 |
+``` |
|
| 30 |
+ |
|
| 31 |
+To verify the container is connected, use the `docker network inspect` command. Use `docker network disconnect` to remove a container from the network. |
|
| 32 |
+ |
|
| 33 |
+Once connected in network, containers can communicate using only another |
|
| 34 |
+container's IP address or name. For `overlay` networks or custom plugins that |
|
| 35 |
+support multi-host connectivity, containers connected to the same multi-host |
|
| 36 |
+network but launched from different Engines can also communicate in this way. |
|
| 37 |
+ |
|
| 38 |
+You can connect a container to one or more networks. The networks need not be the same type. For example, you can connect a single container bridge and overlay networks. |
| 0 | 39 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,119 @@ |
| 0 |
+Creates a new network. The `DRIVER` accepts `bridge` or `overlay` which are the |
|
| 1 |
+built-in network drivers. If you have installed a third party or your own custom |
|
| 2 |
+network driver you can specify that `DRIVER` here also. If you don't specify the |
|
| 3 |
+`--driver` option, the command automatically creates a `bridge` network for you. |
|
| 4 |
+When you install Docker Engine it creates a `bridge` network automatically. This |
|
| 5 |
+network corresponds to the `docker0` bridge that Engine has traditionally relied |
|
| 6 |
+on. When launch a new container with `docker run` it automatically connects to |
|
| 7 |
+this bridge network. You cannot remove this default bridge network but you can |
|
| 8 |
+create new ones using the `network create` command. |
|
| 9 |
+ |
|
| 10 |
+```bash |
|
| 11 |
+$ docker network create -d bridge my-bridge-network |
|
| 12 |
+``` |
|
| 13 |
+ |
|
| 14 |
+Bridge networks are isolated networks on a single Engine installation. If you |
|
| 15 |
+want to create a network that spans multiple Docker hosts each running an |
|
| 16 |
+Engine, you must create an `overlay` network. Unlike `bridge` networks overlay |
|
| 17 |
+networks require some pre-existing conditions before you can create one. These |
|
| 18 |
+conditions are: |
|
| 19 |
+ |
|
| 20 |
+* Access to a key-value store. Engine supports Consul, Etcd, and Zookeeper (Distributed store) key-value stores. |
|
| 21 |
+* A cluster of hosts with connectivity to the key-value store. |
|
| 22 |
+* A properly configured Engine `daemon` on each host in the cluster. |
|
| 23 |
+ |
|
| 24 |
+The `dockerd` options that support the `overlay` network are: |
|
| 25 |
+ |
|
| 26 |
+* `--cluster-store` |
|
| 27 |
+* `--cluster-store-opt` |
|
| 28 |
+* `--cluster-advertise` |
|
| 29 |
+ |
|
| 30 |
+To read more about these options and how to configure them, see ["*Get started |
|
| 31 |
+with multi-host |
|
| 32 |
+network*"](https://docs.docker.com/engine/userguide/networking/get-started-overlay/). |
|
| 33 |
+ |
|
| 34 |
+It is also a good idea, though not required, that you install Docker Swarm on to |
|
| 35 |
+manage the cluster that makes up your network. Swarm provides sophisticated |
|
| 36 |
+discovery and server management that can assist your implementation. |
|
| 37 |
+ |
|
| 38 |
+Once you have prepared the `overlay` network prerequisites you simply choose a |
|
| 39 |
+Docker host in the cluster and issue the following to create the network: |
|
| 40 |
+ |
|
| 41 |
+```bash |
|
| 42 |
+$ docker network create -d overlay my-multihost-network |
|
| 43 |
+``` |
|
| 44 |
+ |
|
| 45 |
+Network names must be unique. The Docker daemon attempts to identify naming |
|
| 46 |
+conflicts but this is not guaranteed. It is the user's responsibility to avoid |
|
| 47 |
+name conflicts. |
|
| 48 |
+ |
|
| 49 |
+## Connect containers |
|
| 50 |
+ |
|
| 51 |
+When you start a container use the `--network` flag to connect it to a network. |
|
| 52 |
+This adds the `busybox` container to the `mynet` network. |
|
| 53 |
+ |
|
| 54 |
+```bash |
|
| 55 |
+$ docker run -itd --network=mynet busybox |
|
| 56 |
+``` |
|
| 57 |
+ |
|
| 58 |
+If you want to add a container to a network after the container is already |
|
| 59 |
+running use the `docker network connect` subcommand. |
|
| 60 |
+ |
|
| 61 |
+You can connect multiple containers to the same network. Once connected, the |
|
| 62 |
+containers can communicate using only another container's IP address or name. |
|
| 63 |
+For `overlay` networks or custom plugins that support multi-host connectivity, |
|
| 64 |
+containers connected to the same multi-host network but launched from different |
|
| 65 |
+Engines can also communicate in this way. |
|
| 66 |
+ |
|
| 67 |
+You can disconnect a container from a network using the `docker network |
|
| 68 |
+disconnect` command. |
|
| 69 |
+ |
|
| 70 |
+## Specifying advanced options |
|
| 71 |
+ |
|
| 72 |
+When you create a network, Engine creates a non-overlapping subnetwork for the |
|
| 73 |
+network by default. This subnetwork is not a subdivision of an existing network. |
|
| 74 |
+It is purely for ip-addressing purposes. You can override this default and |
|
| 75 |
+specify subnetwork values directly using the `--subnet` option. On a |
|
| 76 |
+`bridge` network you can only create a single subnet: |
|
| 77 |
+ |
|
| 78 |
+```bash |
|
| 79 |
+$ docker network create -d bridge --subnet=192.168.0.0/16 br0 |
|
| 80 |
+``` |
|
| 81 |
+ |
|
| 82 |
+Additionally, you also specify the `--gateway` `--ip-range` and `--aux-address` |
|
| 83 |
+options. |
|
| 84 |
+ |
|
| 85 |
+```bash |
|
| 86 |
+$ docker network create \ |
|
| 87 |
+ --driver=bridge \ |
|
| 88 |
+ --subnet=172.28.0.0/16 \ |
|
| 89 |
+ --ip-range=172.28.5.0/24 \ |
|
| 90 |
+ --gateway=172.28.5.254 \ |
|
| 91 |
+ br0 |
|
| 92 |
+``` |
|
| 93 |
+ |
|
| 94 |
+If you omit the `--gateway` flag the Engine selects one for you from inside a |
|
| 95 |
+preferred pool. For `overlay` networks and for network driver plugins that |
|
| 96 |
+support it you can create multiple subnetworks. |
|
| 97 |
+ |
|
| 98 |
+```bash |
|
| 99 |
+$ docker network create -d overlay \ |
|
| 100 |
+ --subnet=192.168.0.0/16 \ |
|
| 101 |
+ --subnet=192.170.0.0/16 \ |
|
| 102 |
+ --gateway=192.168.0.100 \ |
|
| 103 |
+ --gateway=192.170.0.100 \ |
|
| 104 |
+ --ip-range=192.168.1.0/24 \ |
|
| 105 |
+ --aux-address="my-router=192.168.1.5" --aux-address="my-switch=192.168.1.6" \ |
|
| 106 |
+ --aux-address="my-printer=192.170.1.5" --aux-address="my-nas=192.170.1.6" \ |
|
| 107 |
+ my-multihost-network |
|
| 108 |
+``` |
|
| 109 |
+ |
|
| 110 |
+Be sure that your subnetworks do not overlap. If they do, the network create |
|
| 111 |
+fails and Engine returns an error. |
|
| 112 |
+ |
|
| 113 |
+### Network internal mode |
|
| 114 |
+ |
|
| 115 |
+By default, when you connect a container to an `overlay` network, Docker also |
|
| 116 |
+connects a bridge network to it to provide external connectivity. If you want |
|
| 117 |
+to create an externally isolated `overlay` network, you can specify the |
|
| 118 |
+`--internal` option. |
| 0 | 5 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,88 @@ |
| 0 |
+Returns information about one or more networks. By default, this command renders all results in a JSON object. For example, if you connect two containers to the default `bridge` network: |
|
| 1 |
+ |
|
| 2 |
+```bash |
|
| 3 |
+$ sudo docker run -itd --name=container1 busybox |
|
| 4 |
+f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27 |
|
| 5 |
+ |
|
| 6 |
+$ sudo docker run -itd --name=container2 busybox |
|
| 7 |
+bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727 |
|
| 8 |
+``` |
|
| 9 |
+ |
|
| 10 |
+The `network inspect` command shows the containers, by id, in its |
|
| 11 |
+results. You can specify an alternate format to execute a given |
|
| 12 |
+template for each result. Go's |
|
| 13 |
+[text/template](http://golang.org/pkg/text/template/) package |
|
| 14 |
+describes all the details of the format. |
|
| 15 |
+ |
|
| 16 |
+```bash |
|
| 17 |
+$ sudo docker network inspect bridge |
|
| 18 |
+[ |
|
| 19 |
+ {
|
|
| 20 |
+ "Name": "bridge", |
|
| 21 |
+ "Id": "b2b1a2cba717161d984383fd68218cf70bbbd17d328496885f7c921333228b0f", |
|
| 22 |
+ "Scope": "local", |
|
| 23 |
+ "Driver": "bridge", |
|
| 24 |
+ "IPAM": {
|
|
| 25 |
+ "Driver": "default", |
|
| 26 |
+ "Config": [ |
|
| 27 |
+ {
|
|
| 28 |
+ "Subnet": "172.17.42.1/16", |
|
| 29 |
+ "Gateway": "172.17.42.1" |
|
| 30 |
+ } |
|
| 31 |
+ ] |
|
| 32 |
+ }, |
|
| 33 |
+ "Internal": false, |
|
| 34 |
+ "Containers": {
|
|
| 35 |
+ "bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727": {
|
|
| 36 |
+ "Name": "container2", |
|
| 37 |
+ "EndpointID": "0aebb8fcd2b282abe1365979536f21ee4ceaf3ed56177c628eae9f706e00e019", |
|
| 38 |
+ "MacAddress": "02:42:ac:11:00:02", |
|
| 39 |
+ "IPv4Address": "172.17.0.2/16", |
|
| 40 |
+ "IPv6Address": "" |
|
| 41 |
+ }, |
|
| 42 |
+ "f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27": {
|
|
| 43 |
+ "Name": "container1", |
|
| 44 |
+ "EndpointID": "a00676d9c91a96bbe5bcfb34f705387a33d7cc365bac1a29e4e9728df92d10ad", |
|
| 45 |
+ "MacAddress": "02:42:ac:11:00:01", |
|
| 46 |
+ "IPv4Address": "172.17.0.1/16", |
|
| 47 |
+ "IPv6Address": "" |
|
| 48 |
+ } |
|
| 49 |
+ }, |
|
| 50 |
+ "Options": {
|
|
| 51 |
+ "com.docker.network.bridge.default_bridge": "true", |
|
| 52 |
+ "com.docker.network.bridge.enable_icc": "true", |
|
| 53 |
+ "com.docker.network.bridge.enable_ip_masquerade": "true", |
|
| 54 |
+ "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", |
|
| 55 |
+ "com.docker.network.bridge.name": "docker0", |
|
| 56 |
+ "com.docker.network.driver.mtu": "1500" |
|
| 57 |
+ } |
|
| 58 |
+ } |
|
| 59 |
+] |
|
| 60 |
+``` |
|
| 61 |
+ |
|
| 62 |
+Returns the information about the user-defined network: |
|
| 63 |
+ |
|
| 64 |
+```bash |
|
| 65 |
+$ docker network create simple-network |
|
| 66 |
+69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a |
|
| 67 |
+$ docker network inspect simple-network |
|
| 68 |
+[ |
|
| 69 |
+ {
|
|
| 70 |
+ "Name": "simple-network", |
|
| 71 |
+ "Id": "69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a", |
|
| 72 |
+ "Scope": "local", |
|
| 73 |
+ "Driver": "bridge", |
|
| 74 |
+ "IPAM": {
|
|
| 75 |
+ "Driver": "default", |
|
| 76 |
+ "Config": [ |
|
| 77 |
+ {
|
|
| 78 |
+ "Subnet": "172.22.0.0/16", |
|
| 79 |
+ "Gateway": "172.22.0.1" |
|
| 80 |
+ } |
|
| 81 |
+ ] |
|
| 82 |
+ }, |
|
| 83 |
+ "Containers": {},
|
|
| 84 |
+ "Options": {}
|
|
| 85 |
+ } |
|
| 86 |
+] |
|
| 87 |
+``` |
| 0 | 88 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,157 @@ |
| 0 |
+Lists all the networks the Engine `daemon` knows about. This includes the |
|
| 1 |
+networks that span across multiple hosts in a cluster, for example: |
|
| 2 |
+ |
|
| 3 |
+```bash |
|
| 4 |
+ $ docker network ls |
|
| 5 |
+ NETWORK ID NAME DRIVER SCOPE |
|
| 6 |
+ 7fca4eb8c647 bridge bridge local |
|
| 7 |
+ 9f904ee27bf5 none null local |
|
| 8 |
+ cf03ee007fb4 host host local |
|
| 9 |
+ 78b03ee04fc4 multi-host overlay swarm |
|
| 10 |
+``` |
|
| 11 |
+ |
|
| 12 |
+Use the `--no-trunc` option to display the full network id: |
|
| 13 |
+ |
|
| 14 |
+```bash |
|
| 15 |
+$ docker network ls --no-trunc |
|
| 16 |
+NETWORK ID NAME DRIVER |
|
| 17 |
+18a2866682b85619a026c81b98a5e375bd33e1b0936a26cc497c283d27bae9b3 none null |
|
| 18 |
+c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47 host host |
|
| 19 |
+7b369448dccbf865d397c8d2be0cda7cf7edc6b0945f77d2529912ae917a0185 bridge bridge |
|
| 20 |
+95e74588f40db048e86320c6526440c504650a1ff3e9f7d60a497c4d2163e5bd foo bridge |
|
| 21 |
+63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 dev bridge |
|
| 22 |
+``` |
|
| 23 |
+ |
|
| 24 |
+## Filtering |
|
| 25 |
+ |
|
| 26 |
+The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there |
|
| 27 |
+is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). |
|
| 28 |
+Multiple filter flags are combined as an `OR` filter. For example, |
|
| 29 |
+`-f type=custom -f type=builtin` returns both `custom` and `builtin` networks. |
|
| 30 |
+ |
|
| 31 |
+The currently supported filters are: |
|
| 32 |
+ |
|
| 33 |
+* driver |
|
| 34 |
+* id (network's id) |
|
| 35 |
+* label (`label=<key>` or `label=<key>=<value>`) |
|
| 36 |
+* name (network's name) |
|
| 37 |
+* type (custom|builtin) |
|
| 38 |
+ |
|
| 39 |
+#### Driver |
|
| 40 |
+ |
|
| 41 |
+The `driver` filter matches networks based on their driver. |
|
| 42 |
+ |
|
| 43 |
+The following example matches networks with the `bridge` driver: |
|
| 44 |
+ |
|
| 45 |
+```bash |
|
| 46 |
+$ docker network ls --filter driver=bridge |
|
| 47 |
+NETWORK ID NAME DRIVER |
|
| 48 |
+db9db329f835 test1 bridge |
|
| 49 |
+f6e212da9dfd test2 bridge |
|
| 50 |
+``` |
|
| 51 |
+ |
|
| 52 |
+#### ID |
|
| 53 |
+ |
|
| 54 |
+The `id` filter matches on all or part of a network's ID. |
|
| 55 |
+ |
|
| 56 |
+The following filter matches all networks with an ID containing the |
|
| 57 |
+`63d1ff1f77b0...` string. |
|
| 58 |
+ |
|
| 59 |
+```bash |
|
| 60 |
+$ docker network ls --filter id=63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 |
|
| 61 |
+NETWORK ID NAME DRIVER |
|
| 62 |
+63d1ff1f77b0 dev bridge |
|
| 63 |
+``` |
|
| 64 |
+ |
|
| 65 |
+You can also filter for a substring in an ID as this shows: |
|
| 66 |
+ |
|
| 67 |
+```bash |
|
| 68 |
+$ docker network ls --filter id=95e74588f40d |
|
| 69 |
+NETWORK ID NAME DRIVER |
|
| 70 |
+95e74588f40d foo bridge |
|
| 71 |
+ |
|
| 72 |
+$ docker network ls --filter id=95e |
|
| 73 |
+NETWORK ID NAME DRIVER |
|
| 74 |
+95e74588f40d foo bridge |
|
| 75 |
+``` |
|
| 76 |
+ |
|
| 77 |
+#### Label |
|
| 78 |
+ |
|
| 79 |
+The `label` filter matches networks based on the presence of a `label` alone or a `label` and a |
|
| 80 |
+value. |
|
| 81 |
+ |
|
| 82 |
+The following filter matches networks with the `usage` label regardless of its value. |
|
| 83 |
+ |
|
| 84 |
+```bash |
|
| 85 |
+$ docker network ls -f "label=usage" |
|
| 86 |
+NETWORK ID NAME DRIVER |
|
| 87 |
+db9db329f835 test1 bridge |
|
| 88 |
+f6e212da9dfd test2 bridge |
|
| 89 |
+``` |
|
| 90 |
+ |
|
| 91 |
+The following filter matches networks with the `usage` label with the `prod` value. |
|
| 92 |
+ |
|
| 93 |
+```bash |
|
| 94 |
+$ docker network ls -f "label=usage=prod" |
|
| 95 |
+NETWORK ID NAME DRIVER |
|
| 96 |
+f6e212da9dfd test2 bridge |
|
| 97 |
+``` |
|
| 98 |
+ |
|
| 99 |
+#### Name |
|
| 100 |
+ |
|
| 101 |
+The `name` filter matches on all or part of a network's name. |
|
| 102 |
+ |
|
| 103 |
+The following filter matches all networks with a name containing the `foobar` string. |
|
| 104 |
+ |
|
| 105 |
+```bash |
|
| 106 |
+$ docker network ls --filter name=foobar |
|
| 107 |
+NETWORK ID NAME DRIVER |
|
| 108 |
+06e7eef0a170 foobar bridge |
|
| 109 |
+``` |
|
| 110 |
+ |
|
| 111 |
+You can also filter for a substring in a name as this shows: |
|
| 112 |
+ |
|
| 113 |
+```bash |
|
| 114 |
+$ docker network ls --filter name=foo |
|
| 115 |
+NETWORK ID NAME DRIVER |
|
| 116 |
+95e74588f40d foo bridge |
|
| 117 |
+06e7eef0a170 foobar bridge |
|
| 118 |
+``` |
|
| 119 |
+ |
|
| 120 |
+#### Type |
|
| 121 |
+ |
|
| 122 |
+The `type` filter supports two values; `builtin` displays predefined networks |
|
| 123 |
+(`bridge`, `none`, `host`), whereas `custom` displays user defined networks. |
|
| 124 |
+ |
|
| 125 |
+The following filter matches all user defined networks: |
|
| 126 |
+ |
|
| 127 |
+```bash |
|
| 128 |
+$ docker network ls --filter type=custom |
|
| 129 |
+NETWORK ID NAME DRIVER |
|
| 130 |
+95e74588f40d foo bridge |
|
| 131 |
+63d1ff1f77b0 dev bridge |
|
| 132 |
+``` |
|
| 133 |
+ |
|
| 134 |
+By having this flag it allows for batch cleanup. For example, use this filter |
|
| 135 |
+to delete all user defined networks: |
|
| 136 |
+ |
|
| 137 |
+```bash |
|
| 138 |
+$ docker network rm `docker network ls --filter type=custom -q` |
|
| 139 |
+``` |
|
| 140 |
+ |
|
| 141 |
+A warning will be issued when trying to remove a network that has containers |
|
| 142 |
+attached. |
|
| 143 |
+ |
|
| 144 |
+## Format |
|
| 145 |
+ |
|
| 146 |
+Format uses a Go template to print the output. The following variables are |
|
| 147 |
+supported: |
|
| 148 |
+ |
|
| 149 |
+* .ID - Network ID |
|
| 150 |
+* .Name - Network name |
|
| 151 |
+* .Driver - Network driver |
|
| 152 |
+* .Scope - Network scope (local, global) |
|
| 153 |
+* .IPv6 - Whether IPv6 is enabled on the network or not |
|
| 154 |
+* .Internal - Whether the network is internal or not |
|
| 155 |
+* .Labels - All labels assigned to the network |
|
| 156 |
+* .Label - Value of a specific label for this network. For example `{{.Label "project.version"}}`
|
| 0 | 157 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,20 @@ |
| 0 |
+Removes one or more networks by name or identifier. To remove a network, |
|
| 1 |
+you must first disconnect any containers connected to it. |
|
| 2 |
+To remove the network named 'my-network': |
|
| 3 |
+ |
|
| 4 |
+```bash |
|
| 5 |
+ $ docker network rm my-network |
|
| 6 |
+``` |
|
| 7 |
+ |
|
| 8 |
+To delete multiple networks in a single `docker network rm` command, provide |
|
| 9 |
+multiple network names or ids. The following example deletes a network with id |
|
| 10 |
+`3695c422697f` and a network named `my-network`: |
|
| 11 |
+ |
|
| 12 |
+```bash |
|
| 13 |
+ $ docker network rm 3695c422697f my-network |
|
| 14 |
+``` |
|
| 15 |
+ |
|
| 16 |
+When you specify multiple networks, the command attempts to delete each in turn. |
|
| 17 |
+If the deletion of one network fails, the command continues to the next on the |
|
| 18 |
+list and tries to delete that. The command reports success or failure for each |
|
| 19 |
+deletion. |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,36 @@ |
| 0 |
+Search Docker Hub for images that match the specified `TERM`. The table |
|
| 1 |
+of images returned displays the name, description (truncated by default), number |
|
| 2 |
+of stars awarded, whether the image is official, and whether it is automated. |
|
| 3 |
+ |
|
| 4 |
+*Note* - Search queries will only return up to 25 results |
|
| 5 |
+ |
|
| 6 |
+## Filter |
|
| 7 |
+ |
|
| 8 |
+ Filter output based on these conditions: |
|
| 9 |
+ - stars=<numberOfStar> |
|
| 10 |
+ - is-automated=(true|false) |
|
| 11 |
+ - is-official=(true|false) |
|
| 12 |
+ |
|
| 13 |
+# EXAMPLES |
|
| 14 |
+ |
|
| 15 |
+## Search Docker Hub for ranked images |
|
| 16 |
+ |
|
| 17 |
+Search a registry for the term 'fedora' and only display those images |
|
| 18 |
+ranked 3 or higher: |
|
| 19 |
+ |
|
| 20 |
+ $ docker search --filter=stars=3 fedora |
|
| 21 |
+ NAME DESCRIPTION STARS OFFICIAL AUTOMATED |
|
| 22 |
+ mattdm/fedora A basic Fedora image corresponding roughly... 50 |
|
| 23 |
+ fedora (Semi) Official Fedora base image. 38 |
|
| 24 |
+ mattdm/fedora-small A small Fedora image on which to build. Co... 8 |
|
| 25 |
+ goldmann/wildfly A WildFly application server running on a ... 3 [OK] |
|
| 26 |
+ |
|
| 27 |
+## Search Docker Hub for automated images |
|
| 28 |
+ |
|
| 29 |
+Search Docker Hub for the term 'fedora' and only display automated images |
|
| 30 |
+ranked 1 or higher: |
|
| 31 |
+ |
|
| 32 |
+ $ docker search --filter=is-automated=true --filter=stars=1 fedora |
|
| 33 |
+ NAME DESCRIPTION STARS OFFICIAL AUTOMATED |
|
| 34 |
+ goldmann/wildfly A WildFly application server running on a ... 3 [OK] |
|
| 35 |
+ tutum/fedora-20 Fedora 20 image with SSH access. For the r... 1 [OK] |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,134 @@ |
| 0 |
+Get event information from the Docker daemon. Information can include historical |
|
| 1 |
+information and real-time information. |
|
| 2 |
+ |
|
| 3 |
+Docker containers will report the following events: |
|
| 4 |
+ |
|
| 5 |
+ attach, commit, copy, create, destroy, detach, die, exec_create, exec_detach, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update |
|
| 6 |
+ |
|
| 7 |
+Docker images report the following events: |
|
| 8 |
+ |
|
| 9 |
+ delete, import, load, pull, push, save, tag, untag |
|
| 10 |
+ |
|
| 11 |
+Docker volumes report the following events: |
|
| 12 |
+ |
|
| 13 |
+ create, mount, unmount, destroy |
|
| 14 |
+ |
|
| 15 |
+Docker networks report the following events: |
|
| 16 |
+ |
|
| 17 |
+ create, connect, disconnect, destroy |
|
| 18 |
+ |
|
| 19 |
+# OPTIONS |
|
| 20 |
+ |
|
| 21 |
+The `--since` and `--until` parameters can be Unix timestamps, date formatted |
|
| 22 |
+timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed |
|
| 23 |
+relative to the client machine's time. If you do not provide the `--since` option, |
|
| 24 |
+the command returns only new and/or live events. Supported formats for date |
|
| 25 |
+formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, |
|
| 26 |
+`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local |
|
| 27 |
+timezone on the client will be used if you do not provide either a `Z` or a |
|
| 28 |
+`+-00:00` timezone offset at the end of the timestamp. When providing Unix |
|
| 29 |
+timestamps enter seconds[.nanoseconds], where seconds is the number of seconds |
|
| 30 |
+that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap |
|
| 31 |
+seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a |
|
| 32 |
+fraction of a second no more than nine digits long. |
|
| 33 |
+ |
|
| 34 |
+# EXAMPLES |
|
| 35 |
+ |
|
| 36 |
+## Listening for Docker events |
|
| 37 |
+ |
|
| 38 |
+After running docker events a container 786d698004576 is started and stopped |
|
| 39 |
+(The container name has been shortened in the output below): |
|
| 40 |
+ |
|
| 41 |
+ # docker events |
|
| 42 |
+ 2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) start |
|
| 43 |
+ 2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) die |
|
| 44 |
+ 2015-01-28T20:21:32.000000000-08:00 59211849bc10: (from whenry/testimage:latest) stop |
|
| 45 |
+ |
|
| 46 |
+## Listening for events since a given date |
|
| 47 |
+Again the output container IDs have been shortened for the purposes of this document: |
|
| 48 |
+ |
|
| 49 |
+ # docker events --since '2015-01-28' |
|
| 50 |
+ 2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create |
|
| 51 |
+ 2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start |
|
| 52 |
+ 2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create |
|
| 53 |
+ 2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start |
|
| 54 |
+ 2015-01-28T20:25:40.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die |
|
| 55 |
+ 2015-01-28T20:25:42.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop |
|
| 56 |
+ 2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start |
|
| 57 |
+ 2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die |
|
| 58 |
+ 2015-01-28T20:25:46.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop |
|
| 59 |
+ |
|
| 60 |
+The following example outputs all events that were generated in the last 3 minutes, |
|
| 61 |
+relative to the current time on the client machine: |
|
| 62 |
+ |
|
| 63 |
+ # docker events --since '3m' |
|
| 64 |
+ 2015-05-12T11:51:30.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die |
|
| 65 |
+ 2015-05-12T15:52:12.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop |
|
| 66 |
+ 2015-05-12T15:53:45.999999999Z07:00 7805c1d35632: (from redis:2.8) die |
|
| 67 |
+ 2015-05-12T15:54:03.999999999Z07:00 7805c1d35632: (from redis:2.8) stop |
|
| 68 |
+ |
|
| 69 |
+If you do not provide the --since option, the command returns only new and/or |
|
| 70 |
+live events. |
|
| 71 |
+ |
|
| 72 |
+## Format |
|
| 73 |
+ |
|
| 74 |
+If a format (`--format`) is specified, the given template will be executed |
|
| 75 |
+instead of the default format. Go's **text/template** package describes all the |
|
| 76 |
+details of the format. |
|
| 77 |
+ |
|
| 78 |
+ # docker events --filter 'type=container' --format 'Type={{.Type}} Status={{.Status}} ID={{.ID}}'
|
|
| 79 |
+ Type=container Status=create ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 80 |
+ Type=container Status=attach ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 81 |
+ Type=container Status=start ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 82 |
+ Type=container Status=resize ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 83 |
+ Type=container Status=die ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 84 |
+ Type=container Status=destroy ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
|
| 85 |
+ |
|
| 86 |
+If a format is set to `{{json .}}`, the events are streamed as valid JSON
|
|
| 87 |
+Lines. For information about JSON Lines, please refer to http://jsonlines.org/ . |
|
| 88 |
+ |
|
| 89 |
+ # docker events --format '{{json .}}'
|
|
| 90 |
+ {"status":"create","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
|
|
| 91 |
+ {"status":"attach","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
|
|
| 92 |
+ {"Type":"network","Action":"connect","Actor":{"ID":"1b50a5bf755f6021dfa78e..
|
|
| 93 |
+ {"status":"start","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f42..
|
|
| 94 |
+ {"status":"resize","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
|
|
| 95 |
+ |
|
| 96 |
+## Filters |
|
| 97 |
+ |
|
| 98 |
+ $ docker events --filter 'event=stop' |
|
| 99 |
+ 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) |
|
| 100 |
+ 2014-09-03T17:42:14.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) |
|
| 101 |
+ |
|
| 102 |
+ $ docker events --filter 'image=ubuntu-1:14.04' |
|
| 103 |
+ 2014-05-10T17:42:14.999999999Z07:00 container start 4386fb97867d (image=ubuntu-1:14.04) |
|
| 104 |
+ 2014-05-10T17:42:14.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04) |
|
| 105 |
+ 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) |
|
| 106 |
+ |
|
| 107 |
+ $ docker events --filter 'container=7805c1d35632' |
|
| 108 |
+ 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8) |
|
| 109 |
+ 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image= redis:2.8) |
|
| 110 |
+ |
|
| 111 |
+ $ docker events --filter 'container=7805c1d35632' --filter 'container=4386fb97867d' |
|
| 112 |
+ 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04) |
|
| 113 |
+ 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) |
|
| 114 |
+ 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8) |
|
| 115 |
+ 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) |
|
| 116 |
+ |
|
| 117 |
+ $ docker events --filter 'container=7805c1d35632' --filter 'event=stop' |
|
| 118 |
+ 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) |
|
| 119 |
+ |
|
| 120 |
+ $ docker events --filter 'type=volume' |
|
| 121 |
+ 2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local) |
|
| 122 |
+ 2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, destination=/foo, driver=local, propagation=rprivate) |
|
| 123 |
+ 2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, driver=local) |
|
| 124 |
+ 2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local) |
|
| 125 |
+ |
|
| 126 |
+ $ docker events --filter 'type=network' |
|
| 127 |
+ 2015-12-23T21:38:24.705709133Z network create 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, type=bridge) |
|
| 128 |
+ 2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge) |
|
| 129 |
+ |
|
| 130 |
+ $ docker events --filter 'type=plugin' (experimental) |
|
| 131 |
+ 2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/no-remove:latest) |
|
| 132 |
+ 2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/no-remove:latest) |
|
| 133 |
+ |
| 0 | 134 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,163 @@ |
| 0 |
+This command displays system wide information regarding the Docker installation. |
|
| 1 |
+Information displayed includes the kernel version, number of containers and images. |
|
| 2 |
+The number of images shown is the number of unique images. The same image tagged |
|
| 3 |
+under different names is counted only once. |
|
| 4 |
+ |
|
| 5 |
+If a format is specified, the given template will be executed instead of the |
|
| 6 |
+default format. Go's **text/template** package |
|
| 7 |
+describes all the details of the format. |
|
| 8 |
+ |
|
| 9 |
+Depending on the storage driver in use, additional information can be shown, such |
|
| 10 |
+as pool name, data file, metadata file, data space used, total data space, metadata |
|
| 11 |
+space used, and total metadata space. |
|
| 12 |
+ |
|
| 13 |
+The data file is where the images are stored and the metadata file is where the |
|
| 14 |
+meta data regarding those images are stored. When run for the first time Docker |
|
| 15 |
+allocates a certain amount of data space and meta data space from the space |
|
| 16 |
+available on the volume where `/var/lib/docker` is mounted. |
|
| 17 |
+ |
|
| 18 |
+# EXAMPLES |
|
| 19 |
+ |
|
| 20 |
+## Display Docker system information |
|
| 21 |
+ |
|
| 22 |
+Here is a sample output for a daemon running on Ubuntu, using the overlay2 |
|
| 23 |
+storage driver: |
|
| 24 |
+ |
|
| 25 |
+ $ docker -D info |
|
| 26 |
+ Containers: 14 |
|
| 27 |
+ Running: 3 |
|
| 28 |
+ Paused: 1 |
|
| 29 |
+ Stopped: 10 |
|
| 30 |
+ Images: 52 |
|
| 31 |
+ Server Version: 1.13.0 |
|
| 32 |
+ Storage Driver: overlay2 |
|
| 33 |
+ Backing Filesystem: extfs |
|
| 34 |
+ Supports d_type: true |
|
| 35 |
+ Native Overlay Diff: false |
|
| 36 |
+ Logging Driver: json-file |
|
| 37 |
+ Cgroup Driver: cgroupfs |
|
| 38 |
+ Plugins: |
|
| 39 |
+ Volume: local |
|
| 40 |
+ Network: bridge host macvlan null overlay |
|
| 41 |
+ Swarm: active |
|
| 42 |
+ NodeID: rdjq45w1op418waxlairloqbm |
|
| 43 |
+ Is Manager: true |
|
| 44 |
+ ClusterID: te8kdyw33n36fqiz74bfjeixd |
|
| 45 |
+ Managers: 1 |
|
| 46 |
+ Nodes: 2 |
|
| 47 |
+ Orchestration: |
|
| 48 |
+ Task History Retention Limit: 5 |
|
| 49 |
+ Raft: |
|
| 50 |
+ Snapshot Interval: 10000 |
|
| 51 |
+ Number of Old Snapshots to Retain: 0 |
|
| 52 |
+ Heartbeat Tick: 1 |
|
| 53 |
+ Election Tick: 3 |
|
| 54 |
+ Dispatcher: |
|
| 55 |
+ Heartbeat Period: 5 seconds |
|
| 56 |
+ CA Configuration: |
|
| 57 |
+ Expiry Duration: 3 months |
|
| 58 |
+ Node Address: 172.16.66.128 172.16.66.129 |
|
| 59 |
+ Manager Addresses: |
|
| 60 |
+ 172.16.66.128:2477 |
|
| 61 |
+ Runtimes: runc |
|
| 62 |
+ Default Runtime: runc |
|
| 63 |
+ Init Binary: docker-init |
|
| 64 |
+ containerd version: 8517738ba4b82aff5662c97ca4627e7e4d03b531 |
|
| 65 |
+ runc version: ac031b5bf1cc92239461125f4c1ffb760522bbf2 |
|
| 66 |
+ init version: N/A (expected: v0.13.0) |
|
| 67 |
+ Security Options: |
|
| 68 |
+ apparmor |
|
| 69 |
+ seccomp |
|
| 70 |
+ Profile: default |
|
| 71 |
+ Kernel Version: 4.4.0-31-generic |
|
| 72 |
+ Operating System: Ubuntu 16.04.1 LTS |
|
| 73 |
+ OSType: linux |
|
| 74 |
+ Architecture: x86_64 |
|
| 75 |
+ CPUs: 2 |
|
| 76 |
+ Total Memory: 1.937 GiB |
|
| 77 |
+ Name: ubuntu |
|
| 78 |
+ ID: H52R:7ZR6:EIIA:76JG:ORIY:BVKF:GSFU:HNPG:B5MK:APSC:SZ3Q:N326 |
|
| 79 |
+ Docker Root Dir: /var/lib/docker |
|
| 80 |
+ Debug Mode (client): true |
|
| 81 |
+ Debug Mode (server): true |
|
| 82 |
+ File Descriptors: 30 |
|
| 83 |
+ Goroutines: 123 |
|
| 84 |
+ System Time: 2016-11-12T17:24:37.955404361-08:00 |
|
| 85 |
+ EventsListeners: 0 |
|
| 86 |
+ Http Proxy: http://test:test@proxy.example.com:8080 |
|
| 87 |
+ Https Proxy: https://test:test@proxy.example.com:8080 |
|
| 88 |
+ No Proxy: localhost,127.0.0.1,docker-registry.somecorporation.com |
|
| 89 |
+ Registry: https://index.docker.io/v1/ |
|
| 90 |
+ WARNING: No swap limit support |
|
| 91 |
+ Labels: |
|
| 92 |
+ storage=ssd |
|
| 93 |
+ staging=true |
|
| 94 |
+ Experimental: false |
|
| 95 |
+ Insecure Registries: |
|
| 96 |
+ 127.0.0.0/8 |
|
| 97 |
+ Registry Mirrors: |
|
| 98 |
+ http://192.168.1.2/ |
|
| 99 |
+ http://registry-mirror.example.com:5000/ |
|
| 100 |
+ Live Restore Enabled: false |
|
| 101 |
+ |
|
| 102 |
+ |
|
| 103 |
+ |
|
| 104 |
+The global `-D` option tells all `docker` commands to output debug information. |
|
| 105 |
+ |
|
| 106 |
+The example below shows the output for a daemon running on Red Hat Enterprise Linux, |
|
| 107 |
+using the devicemapper storage driver. As can be seen in the output, additional |
|
| 108 |
+information about the devicemapper storage driver is shown: |
|
| 109 |
+ |
|
| 110 |
+ $ docker info |
|
| 111 |
+ Containers: 14 |
|
| 112 |
+ Running: 3 |
|
| 113 |
+ Paused: 1 |
|
| 114 |
+ Stopped: 10 |
|
| 115 |
+ Untagged Images: 52 |
|
| 116 |
+ Server Version: 1.10.3 |
|
| 117 |
+ Storage Driver: devicemapper |
|
| 118 |
+ Pool Name: docker-202:2-25583803-pool |
|
| 119 |
+ Pool Blocksize: 65.54 kB |
|
| 120 |
+ Base Device Size: 10.74 GB |
|
| 121 |
+ Backing Filesystem: xfs |
|
| 122 |
+ Data file: /dev/loop0 |
|
| 123 |
+ Metadata file: /dev/loop1 |
|
| 124 |
+ Data Space Used: 1.68 GB |
|
| 125 |
+ Data Space Total: 107.4 GB |
|
| 126 |
+ Data Space Available: 7.548 GB |
|
| 127 |
+ Metadata Space Used: 2.322 MB |
|
| 128 |
+ Metadata Space Total: 2.147 GB |
|
| 129 |
+ Metadata Space Available: 2.145 GB |
|
| 130 |
+ Udev Sync Supported: true |
|
| 131 |
+ Deferred Removal Enabled: false |
|
| 132 |
+ Deferred Deletion Enabled: false |
|
| 133 |
+ Deferred Deleted Device Count: 0 |
|
| 134 |
+ Data loop file: /var/lib/docker/devicemapper/devicemapper/data |
|
| 135 |
+ Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata |
|
| 136 |
+ Library Version: 1.02.107-RHEL7 (2015-12-01) |
|
| 137 |
+ Execution Driver: native-0.2 |
|
| 138 |
+ Logging Driver: json-file |
|
| 139 |
+ Plugins: |
|
| 140 |
+ Volume: local |
|
| 141 |
+ Network: null host bridge |
|
| 142 |
+ Kernel Version: 3.10.0-327.el7.x86_64 |
|
| 143 |
+ Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo) |
|
| 144 |
+ OSType: linux |
|
| 145 |
+ Architecture: x86_64 |
|
| 146 |
+ CPUs: 1 |
|
| 147 |
+ Total Memory: 991.7 MiB |
|
| 148 |
+ Name: ip-172-30-0-91.ec2.internal |
|
| 149 |
+ ID: I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S |
|
| 150 |
+ Docker Root Dir: /var/lib/docker |
|
| 151 |
+ Debug mode (client): false |
|
| 152 |
+ Debug mode (server): false |
|
| 153 |
+ Username: gordontheturtle |
|
| 154 |
+ Registry: https://index.docker.io/v1/ |
|
| 155 |
+ Insecure registries: |
|
| 156 |
+ myinsecurehost:5000 |
|
| 157 |
+ 127.0.0.0/8 |
|
| 158 |
+ |
|
| 159 |
+You can also specify the output format: |
|
| 160 |
+ |
|
| 161 |
+ $ docker info --format '{{json .}}'
|
|
| 162 |
+ {"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...}
|
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,37 @@ |
| 0 |
+This command displays version information for both the Docker client and |
|
| 1 |
+daemon. |
|
| 2 |
+ |
|
| 3 |
+# EXAMPLES |
|
| 4 |
+ |
|
| 5 |
+## Display Docker version information |
|
| 6 |
+ |
|
| 7 |
+The default output: |
|
| 8 |
+ |
|
| 9 |
+ $ docker version |
|
| 10 |
+ Client: |
|
| 11 |
+ Version: 1.8.0 |
|
| 12 |
+ API version: 1.20 |
|
| 13 |
+ Go version: go1.4.2 |
|
| 14 |
+ Git commit: f5bae0a |
|
| 15 |
+ Built: Tue Jun 23 17:56:00 UTC 2015 |
|
| 16 |
+ OS/Arch: linux/amd64 |
|
| 17 |
+ |
|
| 18 |
+ Server: |
|
| 19 |
+ Version: 1.8.0 |
|
| 20 |
+ API version: 1.20 |
|
| 21 |
+ Go version: go1.4.2 |
|
| 22 |
+ Git commit: f5bae0a |
|
| 23 |
+ Built: Tue Jun 23 17:56:00 UTC 2015 |
|
| 24 |
+ OS/Arch: linux/amd64 |
|
| 25 |
+ |
|
| 26 |
+Get server version: |
|
| 27 |
+ |
|
| 28 |
+ $ docker version --format '{{.Server.Version}}'
|
|
| 29 |
+ 1.8.0 |
|
| 30 |
+ |
|
| 31 |
+Dump raw data: |
|
| 32 |
+ |
|
| 33 |
+To view all available fields, you can use the format `{{json .}}`.
|
|
| 34 |
+ |
|
| 35 |
+ $ docker version --format '{{json .}}'
|
|
| 36 |
+ {"Client":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"},"ServerOK":true,"Server":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","KernelVersion":"3.13.2-gentoo","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"}}
|
| 0 | 37 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,14 @@ |
| 0 |
+The `docker volume` command has subcommands for managing data volumes. A data |
|
| 1 |
+volume is a specially-designated directory that by-passes storage driver |
|
| 2 |
+management. |
|
| 3 |
+ |
|
| 4 |
+Data volumes persist data independent of a container's life cycle. When you |
|
| 5 |
+delete a container, the Docker daemon does not delete any data volumes. You can |
|
| 6 |
+share volumes across multiple containers. Moreover, you can share data volumes |
|
| 7 |
+with other computing resources in your system. |
|
| 8 |
+ |
|
| 9 |
+To see help for a subcommand, use: |
|
| 10 |
+ |
|
| 11 |
+ docker volume COMMAND --help |
|
| 12 |
+ |
|
| 13 |
+For full details on using docker volume visit Docker's online documentation. |
| 0 | 14 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,35 @@ |
| 0 |
+Creates a new volume that containers can consume and store data in. If a name |
|
| 1 |
+is not specified, Docker generates a random name. You create a volume and then |
|
| 2 |
+configure the container to use it, for example: |
|
| 3 |
+ |
|
| 4 |
+ $ docker volume create hello |
|
| 5 |
+ hello |
|
| 6 |
+ $ docker run -d -v hello:/world busybox ls /world |
|
| 7 |
+ |
|
| 8 |
+The mount is created inside the container's `/src` directory. Docker doesn't |
|
| 9 |
+not support relative paths for mount points inside the container. |
|
| 10 |
+ |
|
| 11 |
+Multiple containers can use the same volume in the same time period. This is |
|
| 12 |
+useful if two containers need access to shared data. For example, if one |
|
| 13 |
+container writes and the other reads the data. |
|
| 14 |
+ |
|
| 15 |
+## Driver specific options |
|
| 16 |
+ |
|
| 17 |
+Some volume drivers may take options to customize the volume creation. Use the |
|
| 18 |
+`-o` or `--opt` flags to pass driver options: |
|
| 19 |
+ |
|
| 20 |
+ $ docker volume create --driver fake --opt tardis=blue --opt timey=wimey |
|
| 21 |
+ |
|
| 22 |
+These options are passed directly to the volume driver. Options for different |
|
| 23 |
+volume drivers may do different things (or nothing at all). |
|
| 24 |
+ |
|
| 25 |
+The built-in `local` driver on Windows does not support any options. |
|
| 26 |
+ |
|
| 27 |
+The built-in `local` driver on Linux accepts options similar to the linux |
|
| 28 |
+`mount` command: |
|
| 29 |
+ |
|
| 30 |
+ $ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 |
|
| 31 |
+ |
|
| 32 |
+Another example: |
|
| 33 |
+ |
|
| 34 |
+ $ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 |
| 0 | 35 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,4 @@ |
| 0 |
+Returns information about one or more volumes. By default, this command renders |
|
| 1 |
+all results in a JSON array. You can specify an alternate format to execute a |
|
| 2 |
+given template is executed for each result. Go's https://golang.org/pkg/text/template/ |
|
| 3 |
+package describes all the details of the format. |
| 0 | 4 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,11 @@ |
| 0 |
+Lists all the volumes Docker manages. You can filter using the `-f` or |
|
| 1 |
+`--filter` flag. The filtering format is a `key=value` pair. To specify |
|
| 2 |
+more than one filter, pass multiple flags (for example, |
|
| 3 |
+`--filter "foo=bar" --filter "bif=baz"`) |
|
| 4 |
+ |
|
| 5 |
+The currently supported filters are: |
|
| 6 |
+ |
|
| 7 |
+* `dangling` (boolean - `true` or `false`, `1` or `0`) |
|
| 8 |
+* `driver` (a volume driver's name) |
|
| 9 |
+* `label` (`label=<key>` or `label=<key>=<value>`) |
|
| 10 |
+* `name` (a volume's name) |