[docker-io/el6] manpage modified for fedora, builds for epel7 BZ #1046882

Lokesh Mandvekar lsm5 at fedoraproject.org
Wed Jan 22 22:02:33 UTC 2014


commit 4b3a2ad1f52c998bdf34b7b3a7d63118e00aaf6e
Author: Lokesh Mandvekar <lsm5 at redhat.com>
Date:   Wed Jan 22 15:29:03 2014 -0500

    manpage modified for fedora, builds for epel7 BZ #1046882
    
    Signed-off-by: Lokesh Mandvekar <lsm5 at redhat.com>

 docker-0.7-el6-docs.patch |   13 -
 docker-io.spec            |   20 +-
 docker.1                  | 1559 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1568 insertions(+), 24 deletions(-)
---
diff --git a/docker-io.spec b/docker-io.spec
index 9e95ea0..31d61b2 100644
--- a/docker-io.spec
+++ b/docker-io.spec
@@ -14,12 +14,11 @@
 
 Name:           docker-io
 Version:        0.7.6
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Automates deployment of containerized applications
 License:        ASL 2.0
 
-Patch0:         docker-0.7-el6-docs.patch
-Patch1:         devicemapper-discard-freespace.patch
+Patch0:         devicemapper-discard-freespace.patch
 URL:            http://www.docker.io
 # only x86_64 for now: https://github.com/dotcloud/docker/issues/136
 ExclusiveArch:  x86_64
@@ -29,6 +28,7 @@ Source1:        docker.service
 # having .sysvinit and .sysconfig makes things clear
 Source2:        docker.sysconfig
 Source3:        docker.sysvinit
+Source4:        docker.1
 BuildRequires:  gcc
 BuildRequires:  glibc-static
 # ensure build uses golang 1.2 and above
@@ -40,7 +40,6 @@ BuildRequires:  golang(code.google.com/p/go.net/websocket)
 BuildRequires:  golang(code.google.com/p/gosqlite/sqlite3)
 BuildRequires:  golang(github.com/syndtr/gocapability/capability)
 BuildRequires:  device-mapper-devel
-BuildRequires:  python-sphinxcontrib-httpdomain
 %if %{with systemd}
 BuildRequires:  pkgconfig(systemd)
 Requires:       systemd-units
@@ -77,12 +76,9 @@ servers, OpenStack clusters, public instances, or combinations of the above.
 %prep
 %setup -q -n docker-%{version}
 rm -rf vendor
-%if 0%{?rhel} >= 6
-%patch0 -p1 -b docker-0.7-el6-docs
-%endif
 # discard free space after deleting image
 # https://bugzilla.redhat.com/show_bug.cgi?id=1055645
-%patch1 -p1 -b devicemapper-discard-freespace
+%patch0 -p1 -b devicemapper-discard-freespace
 
 %build
 mkdir _build
@@ -97,8 +93,6 @@ export GOPATH=$(pwd)/_build:%{gopath}
 
 hack/make.sh dynbinary
 
-make -C docs/ man
-
 %install
 install -d %{buildroot}%{_bindir}
 install -d %{buildroot}%{_libexecdir}/docker
@@ -108,7 +102,7 @@ install -d %{buildroot}%{_datadir}/zsh/site-functions
 install -d -m 700 %{buildroot}%{_sharedstatedir}/docker
 install -p -m 755 bundles/%{version}/dynbinary/docker-%{version} %{buildroot}%{_bindir}/docker
 install -p -m 755 bundles/%{version}/dynbinary/dockerinit-%{version} %{buildroot}%{_libexecdir}/docker/dockerinit
-install -p -m 644 docs/_build/man/docker.1 %{buildroot}%{_mandir}/man1
+install -p -m 644 %{SOURCE4} %{buildroot}%{_mandir}/man1
 install -p -m 644 contrib/completion/bash/docker %{buildroot}%{_sysconfdir}/bash_completion.d/docker.bash
 install -p -m 644 contrib/completion/zsh/_docker %{buildroot}%{_datadir}/zsh/site-functions
 %if %{with systemd}
@@ -173,6 +167,10 @@ fi
 %{_sysconfdir}/udev/rules.d/80-docker.rules
 
 %changelog
+* Wed Jan 22 2014 Lokesh Mandvekar <lsm5 at redhat.com> - 0.7.6-3
+- install fedora customized manpage instead of upstream provided version
+- get rid of python-sphinx* dependencies
+
 * Mon Jan 20 2014 Lokesh Mandvekar <lsm5 at redhat.com> - 0.7.6-2
 - bridge-utils only for rhel < 7
 - discard freespace when image is removed
diff --git a/docker.1 b/docker.1
new file mode 100644
index 0000000..c9bfaba
--- /dev/null
+++ b/docker.1
@@ -0,0 +1,1559 @@
+.\" Man page generated from reStructuredText and customized for Fedora.
+.
+.TH "DOCKER" "1" "January 22, 2014" "0.1" "Docker"
+.SH NAME
+docker \- Docker Documentation
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.sp
+To run docker without sudo, add user to \fBdocker\fP group.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+\fBsudo usermod -a -G docker $USERNAME\fP
+.UNINDENT
+.UNINDENT
+
+To list available commands, either run \fBdocker\fP with no parameters or execute
+\fBdocker help\fP:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker
+  Usage: docker [OPTIONS] COMMAND [arg...]
+    \-H=[unix:///var/run/docker.sock]: tcp://[host[:port]] to bind/connect to or unix://[/path/to/socket] to use. When host=[0.0.0.0], port=[4243] or path=[/var/run/docker.sock] is omitted, default values are used.
+
+  A self\-sufficient runtime for linux containers.
+
+  ...
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage of docker:
+  \-D=false: Enable debug mode
+  \-H=[unix:///var/run/docker.sock]: tcp://[host[:port]] to bind or unix://[/path/to/socket] to use. When host=[0.0.0.0], port=[4243] or path=[/var/run/docker.sock] is omitted, default values are used.
+  \-api\-enable\-cors=false: Enable CORS headers in the remote API
+  \-b="": Attach containers to a pre\-existing network bridge; use \(aqnone\(aq to disable container networking
+  \-bip="": Use the provided CIDR notation address for the dynamically created bridge (docker0); Mutually exclusive of \-b
+  \-d=false: Enable daemon mode
+  \-dns="": Force docker to use specific DNS servers
+  \-g="/var/lib/docker": Path to use as the root of the docker runtime
+  \-icc=true: Enable inter\-container communication
+  \-ip="0.0.0.0": Default IP address to use when binding container ports
+  \-iptables=true: Disable docker\(aqs addition of iptables rules
+  \-mtu=1500: Set the containers network mtu
+  \-p="/var/run/docker.pid": Path to use for daemon PID file
+  \-r=true: Restart previously running containers
+  \-s="": Force the docker runtime to use a specific storage driver
+  \-v=false: Print version information and quit
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The Docker daemon is the persistent process that manages containers.  Docker uses the same binary for both the
+daemon and client.  To run the daemon you provide the \fB\-d\fP flag.
+.sp
+To force Docker to use devicemapper as the storage driver, use \fBdocker \-d \-s devicemapper\fP\&.
+.sp
+To set the DNS server for all Docker containers, use \fBdocker \-d \-dns 8.8.8.8\fP\&.
+.sp
+To run the daemon with debug output, use \fBdocker \-d \-D\fP\&.
+.sp
+The docker client will also honor the \fBDOCKER_HOST\fP environment variable to set
+the \fB\-H\fP flag for the client.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+docker \-H tcp://0.0.0.0:4243 ps
+# or
+export DOCKER_HOST="tcp://0.0.0.0:4243"
+docker ps
+# both are equal
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker attach CONTAINER
+
+Attach to a running container.
+
+  \-nostdin=false: Do not attach stdin
+  \-sig\-proxy=true: Proxify all received signal to the process (even in non\-tty mode)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+You can detach from the container again (and leave it running) with
+\fBCTRL\-c\fP (for a quiet exit) or \fBCTRL\-\e\fP to get a stacktrace of
+the Docker client when it quits.  When you detach from the container\(aqs
+process the exit code will be returned to the client.
+.sp
+To stop a container, use \fBdocker stop\fP\&.
+.sp
+To kill the container, use \fBdocker kill\fP\&.
+.SH EXAMPLES:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ ID=$(docker run \-d fedora /usr/bin/top \-b)
+$ docker attach $ID
+top \- 02:05:52 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05
+Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
+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
+Mem:    373572k total,   355560k used,    18012k free,    27872k buffers
+Swap:   786428k total,        0k used,   786428k free,   221740k cached
+
+PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
+ 1 root      20   0 17200 1116  912 R    0  0.3   0:00.03 top
+
+ top \- 02:05:55 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05
+ Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
+ 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
+ Mem:    373572k total,   355244k used,    18328k free,    27872k buffers
+ Swap:   786428k total,        0k used,   786428k free,   221776k cached
+
+   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
+       1 root      20   0 17208 1144  932 R    0  0.3   0:00.03 top
+
+
+ top \- 02:05:58 up  3:06,  0 users,  load average: 0.01, 0.02, 0.05
+ Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
+ Cpu(s):  0.2%us,  0.3%sy,  0.0%ni, 99.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
+ Mem:    373572k total,   355780k used,    17792k free,    27880k buffers
+ Swap:   786428k total,        0k used,   786428k free,   221776k cached
+
+ PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
+      1 root      20   0 17208 1144  932 R    0  0.3   0:00.03 top
+^C$
+$ docker stop $ID
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker build [OPTIONS] PATH | URL | \-
+Build a new container image from the source code at PATH
+  \-t="": Repository name (and optionally a tag) to be applied
+         to the resulting image in case of success.
+  \-q=false: Suppress verbose build output.
+  \-no\-cache: Do not use the cache when building the image.
+  \-rm: Remove intermediate containers after a successful build
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The files at \fBPATH\fP or \fBURL\fP are called the "context" of the build. The
+build process may refer to any of the files in the context, for example when
+using an \fIADD\fP instruction.  When a single \fBDockerfile\fP
+is given as \fBURL\fP, then no context is set.  When a Git repository is set as
+\fBURL\fP, then the repository is used as the context
+.INDENT 0.0
+.INDENT 3.5
+.IP "See also"
+.sp
+\fIdockerbuilder\fP\&.
+.UNINDENT
+.UNINDENT
+.SH EXAMPLES:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker build .
+Uploading context 10.24 kB
+Uploading context 
+Step 1 : FROM fedora:20
+ \-\-\-> 924a401326b8
+Step 2 : RUN ls \-lh
+ \-\-\-> Running in e1c113bb29ad
+total 52K
+lrwxrwxrwx.   1 root root    7 Dec 25 00:39 bin \-> usr/bin
+drwxr\-xr\-x.   4 root root 4.0K Jan 22 15:37 dev
+drwxr\-xr\-x.  60 root root 4.0K Jan 22 15:37 etc
+drwxr\-xr\-x.   2 root root 4.0K Aug  7 09:10 home
+lrwxrwxrwx.   1 root root    7 Dec 25 00:39 lib \-> usr/lib
+lrwxrwxrwx.   1 root root    9 Dec 25 00:39 lib64 \-> usr/lib64
+drwx\-\-\-\-\-\-.   2 root root 4.0K Dec 25 00:36 lost+found
+drwxr\-xr\-x.   2 root root 4.0K Aug  7 09:10 media
+drwxr\-xr\-x.   2 root root 4.0K Aug  7 09:10 mnt
+drwxr\-xr\-x.   2 root root 4.0K Aug  7 09:10 opt
+dr\-xr\-xr\-x. 299 root root    0 Jan 22 15:37 proc
+dr\-xr\-x\-\-\-.   2 root root 4.0K Dec 25 00:40 root
+drwxr\-xr\-x.   8 root root 4.0K Dec 25 00:40 run
+lrwxrwxrwx.   1 root root    8 Dec 25 00:39 sbin \-> usr/sbin
+drwxr\-xr\-x.   2 root root 4.0K Aug  7 09:10 srv
+dr\-xr\-xr\-x.  13 root root    0 Jan 22 14:10 sys
+drwxrwxrwt.   2 root root 4.0K Dec 25 00:40 tmp
+drwxr\-xr\-x.  12 root root 4.0K Dec 25 00:39 usr
+drwxr\-xr\-x.  18 root root 4.0K Dec 25 00:40 var
+ \-\-\-> 5ef970867a35
+Step 3 : CMD echo Hello World
+ \-\-\-> Running in dcf923c865d5
+ \-\-\-> 9bb27bd2098f
+Successfully built 9bb27bd2098f
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This example specifies that the \fBPATH\fP is \fB\&.\fP, and so all the files in
+the local directory get tar\(aqd and sent to the Docker daemon.  The \fBPATH\fP
+specifies where to find the files for the "context" of the build on
+the Docker daemon. Remember that the daemon could be running on a
+remote machine and that no parsing of the \fBDockerfile\fP happens at the
+client side (where you\(aqre running \fBdocker build\fP). That means that
+\fIall\fP the files at \fBPATH\fP get sent, not just the ones listed to
+\fIADD\fP in the \fBDockerfile\fP\&.
+.sp
+The transfer of context from the local machine to the Docker daemon is
+what the \fBdocker\fP client means when you see the "Uploading context"
+message.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker build \-t vieux/apache:2.0 .
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This will build like the previous example, but it will then tag the
+resulting image. The repository name will be \fBvieux/apache\fP and the
+tag will be \fB2.0\fP
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker build \- < Dockerfile
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This will read a \fBDockerfile\fP from \fIstdin\fP without context. Due to
+the lack of a context, no contents of any local directory will be sent
+to the \fBdocker\fP daemon.  Since there is no context, a \fBDockerfile\fP
+\fBADD\fP only works if it refers to a remote URL.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker build github.com/creack/docker\-firefox
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This will clone the GitHub repository and use the cloned repository as
+context. The \fBDockerfile\fP at the root of the repository is used as
+\fBDockerfile\fP\&.  Note that you can specify an arbitrary Git repository
+by using the \fBgit://\fP schema.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
+
+Create a new image from a container\(aqs changes
+
+  \-m="": Commit message
+  \-author="": Author (eg. "John Hannibal Smith <hannibal at a\-team.com>"
+  \-run="": Configuration to be applied when the image is launched with \(gadocker run\(ga.
+           (ex: \-run=\(aq{"Cmd": ["cat", "/world"], "PortSpecs": ["22"]}\(aq)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH COMMIT AN EXISTING CONTAINER
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker ps
+CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
+c0dcc449046b        fedora:rawhide      /bin/bash           5 seconds ago       Up 4 seconds                            sharp_heisenberg    
+cd1c7c656560        fedora:20           /bin/bash           22 seconds ago      Up 20 seconds                           furious_torvalds
+$ docker commit c0dcc449046b  SvenDowideit/testimage:version3
+f5283438590d
+$ docker images | head
+REPOSITORY                        TAG                 ID                  CREATED             VIRTUAL SIZE
+SvenDowideit/testimage            version3            f5283438590d        16 seconds ago      335.7 MB
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH CHANGE THE COMMAND THAT A CONTAINER RUNS
+.sp
+Sometimes you have an application container running just a service and you need
+to make a quick change and then change it back.
+.sp
+In this example, we run a container with \fBls\fP and then change the image to
+run \fBls /etc\fP\&.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker run \-t \-name test fedora ls
+bin  dev  etc  home  lib  lib64  lost+found media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
+$ docker commit \-run=\(aq{"Cmd": ["ls","/etc"]}\(aq test test2
+933d16de9e70005304c1717b5c6f2f39d6fd50752834c6f34a155c70790011eb
+$ docker run \-t test2
+adduser.conf            gshadow          login.defs           rc0.d
+alternatives            gshadow\-         logrotate.d          rc1.d
+apt                     host.conf        lsb\-base             rc2.d
+\&...
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Full \-run example
+.sp
+The \fB\-run\fP JSON hash changes the \fBConfig\fP section when running \fBdocker inspect CONTAINERID\fP
+or \fBconfig\fP when running \fBdocker inspect IMAGEID\fP\&.
+.sp
+(Multiline is okay within a single quote \fB\(aq\fP)
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker commit \-run=\(aq
+{
+    "Entrypoint" : null,
+    "Privileged" : false,
+    "User" : "",
+    "VolumesFrom" : "",
+    "Cmd" : ["cat", "\-e", "/etc/resolv.conf"],
+    "Dns" : ["8.8.8.8", "8.8.4.4"],
+    "MemorySwap" : 0,
+    "AttachStdin" : false,
+    "AttachStderr" : false,
+    "CpuShares" : 0,
+    "OpenStdin" : false,
+    "Volumes" : null,
+    "Hostname" : "122612f45831",
+    "PortSpecs" : ["22", "80", "443"],
+    "Image" : "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
+    "Tty" : false,
+    "Env" : [
+       "HOME=/",
+       "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+    ],
+    "StdinOnce" : false,
+    "Domainname" : "",
+    "WorkingDir" : "/",
+    "NetworkDisabled" : false,
+    "Memory" : 0,
+    "AttachStdout" : false
+}\(aq $CONTAINER_ID
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker cp CONTAINER:PATH HOSTPATH
+
+Copy files/folders from the containers filesystem to the host
+path.  Paths are relative to the root of the filesystem.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker cp 7bb0e258aefe:/etc/debian_version .
+$ docker cp blue_frog:/etc/hosts .
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker diff CONTAINER
+
+List the changed files and directories in a container\(aqs filesystem
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+There are 3 events that are listed in the \(aqdiff\(aq:
+.INDENT 0.0
+.IP 1. 3
+\fB\(gaA\(ga\fP \- Add
+.IP 2. 3
+\fB\(gaD\(ga\fP \- Delete
+.IP 3. 3
+\fB\(gaC\(ga\fP \- Change
+.UNINDENT
+.sp
+For example:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker diff 7bb0e258aefe
+
+C /dev
+A /dev/kmsg
+C /etc
+A /etc/mtab
+A /go
+A /go/src
+A /go/src/github.com
+A /go/src/github.com/dotcloud
+A /go/src/github.com/dotcloud/docker
+A /go/src/github.com/dotcloud/docker/.git
+\&....
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker events
+
+Get real time events from the server
+
+\-since="": Show previously created events and then stream.
+           (either seconds since epoch, or date string as below)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH EXAMPLES
+.sp
+You\(aqll need two shells for this example.
+.SS Shell 1: Listening for events
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker events
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Shell 2: Start and Stop a Container
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker start 4386fb97867d
+$ docker stop 4386fb97867d
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Shell 1: (Again .. now showing events)
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[2013\-09\-03 15:49:26 +0200 CEST] 4386fb97867d: (from 12de384bfb10) start
+[2013\-09\-03 15:49:29 +0200 CEST] 4386fb97867d: (from 12de384bfb10) die
+[2013\-09\-03 15:49:29 +0200 CEST] 4386fb97867d: (from 12de384bfb10) stop
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Show events in the past from a specified time
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker events \-since 1378216169
+[2013\-09\-03 15:49:29 +0200 CEST] 4386fb97867d: (from 12de384bfb10) die
+[2013\-09\-03 15:49:29 +0200 CEST] 4386fb97867d: (from 12de384bfb10) stop
+
+$ docker events \-since \(aq2013\-09\-03\(aq
+[2013\-09\-03 15:49:26 +0200 CEST] 4386fb97867d: (from 12de384bfb10) start
+[2013\-09\-03 15:49:29 +0200 CEST] 4386fb97867d: (from 12de384bfb10) die
+[2013\-09\-03 15:49:29 +0200 CEST] 4386fb97867d: (from 12de384bfb10) stop
+
+$ docker events \-since \(aq2013\-09\-03 15:49:29 +0200 CEST\(aq
+[2013\-09\-03 15:49:29 +0200 CEST] 4386fb97867d: (from 12de384bfb10) die
+[2013\-09\-03 15:49:29 +0200 CEST] 4386fb97867d: (from 12de384bfb10) stop
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker export CONTAINER
+
+Export the contents of a filesystem as a tar archive to STDOUT
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+For example:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker export red_panda > latest.tar
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker history [OPTIONS] IMAGE
+
+Show the history of an image
+
+  \-notrunc=false: Don\(aqt truncate output
+  \-q=false: only show numeric IDs
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+To see how the \fBdocker:latest\fP image was built:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker history docker
+ID                  CREATED             CREATED BY
+docker:latest       19 hours ago        /bin/sh \-c #(nop) ADD . in /go/src/github.com/dotcloud/docker
+cf5f2467662d        2 weeks ago         /bin/sh \-c #(nop) ENTRYPOINT ["hack/dind"]
+3538fbe372bf        2 weeks ago         /bin/sh \-c #(nop) WORKDIR /go/src/github.com/dotcloud/docker
+7450f65072e5        2 weeks ago         /bin/sh \-c #(nop) VOLUME /var/lib/docker
+b79d62b97328        2 weeks ago         /bin/sh \-c apt\-get install \-y \-q lxc
+36714852a550        2 weeks ago         /bin/sh \-c apt\-get install \-y \-q iptables
+8c4c706df1d6        2 weeks ago         /bin/sh \-c /bin/echo \-e \(aq[default]\enaccess_key=$AWS_ACCESS_KEY\ensecret_key=$AWS_SECRET_KEYn\(aq > /.s3cfg
+b89989433c48        2 weeks ago         /bin/sh \-c pip install python\-magic
+a23e640d85b5        2 weeks ago         /bin/sh \-c pip install s3cmd
+41f54fec7e79        2 weeks ago         /bin/sh \-c apt\-get install \-y \-q python\-pip
+d9bc04add907        2 weeks ago         /bin/sh \-c apt\-get install \-y \-q reprepro dpkg\-sig
+e74f4760fa70        2 weeks ago         /bin/sh \-c gem install \-\-no\-rdoc \-\-no\-ri fpm
+1e43224726eb        2 weeks ago         /bin/sh \-c apt\-get install \-y \-q ruby1.9.3 rubygems libffi\-dev
+460953ae9d7f        2 weeks ago         /bin/sh \-c #(nop) ENV GOPATH=/go:/go/src/github.com/dotcloud/docker/vendor
+8b63eb1d666b        2 weeks ago         /bin/sh \-c #(nop) ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/goroot/bin
+3087f3bcedf2        2 weeks ago         /bin/sh \-c #(nop) ENV GOROOT=/goroot
+635840d198e5        2 weeks ago         /bin/sh \-c cd /goroot/src && ./make.bash
+439f4a0592ba        2 weeks ago         /bin/sh \-c curl \-s https://go.googlecode.com/files/go1.1.2.src.tar.gz | tar \-v \-C / \-xz && mv /go /goroot
+13967ed36e93        2 weeks ago         /bin/sh \-c #(nop) ENV CGO_ENABLED=0
+bf7424458437        2 weeks ago         /bin/sh \-c apt\-get install \-y \-q build\-essential
+a89ec997c3bf        2 weeks ago         /bin/sh \-c apt\-get install \-y \-q mercurial
+b9f165c6e749        2 weeks ago         /bin/sh \-c apt\-get install \-y \-q git
+17a64374afa7        2 weeks ago         /bin/sh \-c apt\-get install \-y \-q curl
+d5e85dc5b1d8        2 weeks ago         /bin/sh \-c apt\-get update
+13e642467c11        2 weeks ago         /bin/sh \-c echo \(aqdeb http://archive.fedora.com/ubuntu precise main universe\(aq > /etc/apt/sources.list
+ae6dde92a94e        2 weeks ago         /bin/sh \-c #(nop) MAINTAINER Solomon Hykes <solomon at dotcloud.com>
+fedora:20        6 months ago
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker images [OPTIONS] [NAME]
+
+List images
+
+  \-a=false: show all images (by default filter out the intermediate images used to build)
+  \-notrunc=false: Don\(aqt truncate output
+  \-q=false: only show numeric IDs
+  \-tree=false: output graph in tree format
+  \-viz=false: output graph in graphviz format
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH LISTING THE MOST RECENTLY CREATED IMAGES
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker images | head
+REPOSITORY                    TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
+<none>                        <none>              77af4d6b9913        19 hours ago        1.089 GB
+committest                    latest              b6fa739cedf5        19 hours ago        1.089 GB
+<none>                        <none>              78a85c484f71        19 hours ago        1.089 GB
+docker                        latest              30557a29d5ab        20 hours ago        1.089 GB
+<none>                        <none>              0124422dd9f9        20 hours ago        1.089 GB
+<none>                        <none>              18ad6fad3402        22 hours ago        1.082 GB
+<none>                        <none>              f9f1e26352f0        23 hours ago        1.089 GB
+tryout                        latest              2629d1fa0b81        23 hours ago        131.5 MB
+<none>                        <none>              5ed6274db6ce        24 hours ago        1.089 GB
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH LISTING THE FULL LENGTH IMAGE IDS
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker images \-notrunc | head
+REPOSITORY                    TAG                 IMAGE ID                                                           CREATED             VIRTUAL SIZE
+<none>                        <none>              77af4d6b9913e693e8d0b4b294fa62ade6054e6b2f1ffb617ac955dd63fb0182   19 hours ago        1.089 GB
+committest                    latest              b6fa739cedf5ea12a620a439402b6004d057da800f91c7524b5086a5e4749c9f   19 hours ago        1.089 GB
+<none>                        <none>              78a85c484f71509adeaace20e72e941f6bdd2b25b4c75da8693efd9f61a37921   19 hours ago        1.089 GB
+docker                        latest              30557a29d5abc51e5f1d5b472e79b7e296f595abcf19fe6b9199dbbc809c6ff4   20 hours ago        1.089 GB
+<none>                        <none>              0124422dd9f9cf7ef15c0617cda3931ee68346455441d66ab8bdc5b05e9fdce5   20 hours ago        1.089 GB
+<none>                        <none>              18ad6fad340262ac2a636efd98a6d1f0ea775ae3d45240d3418466495a19a81b   22 hours ago        1.082 GB
+<none>                        <none>              f9f1e26352f0a3ba6a0ff68167559f64f3e21ff7ada60366e2d44a04befd1d3a   23 hours ago        1.089 GB
+tryout                        latest              2629d1fa0b81b222fca63371ca16cbf6a0772d07759ff80e8d1369b926940074   23 hours ago        131.5 MB
+<none>                        <none>              5ed6274db6ceb2397844896966ea239290555e74ef307030ebb01ff91b1914df   24 hours ago        1.089 GB
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH DISPLAYING IMAGES VISUALLY
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker images \-viz | dot \-Tpng \-o docker.png
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+[image: Example inheritance graph of Docker images.]
+[image]
+.SH DISPLAYING IMAGE HIERARCHY
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker images \-tree
+└─511136ea3c5a Virtual Size: 0 B
+  └─4a646dfe724f Virtual Size: 0 B
+    ├─783f460032a8 Virtual Size: 387 MB Tags: fedora:rawhide
+    └─924a401326b8 Virtual Size: 385.5 MB Tags: fedora:20, fedora:heisenbug, fedora:latest
+      ├─ca1a85fb2f1a Virtual Size: 391.4 MB Tags: lsm5/test:latest
+      ├─5ef970867a35 Virtual Size: 385.5 MB
+      │ └─9bb27bd2098f Virtual Size: 385.5 MB
+      ├─4e751ac48df3 Virtual Size: 385.5 MB
+      │ └─586c3c06681e Virtual Size: 385.5 MB
+      │   └─11a529e16354 Virtual Size: 385.5 MB
+      └─f47d419b7789 Virtual Size: 385.5 MB
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker import URL|\- [REPOSITORY[:TAG]]
+
+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.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+At this time, the URL must start with \fBhttp\fP and point to a single
+file archive (.tar, .tar.gz, .tgz, .bzip, .tar.xz, or .txz) containing a
+root filesystem. If you would like to import from a local directory or
+archive, you can use the \fB\-\fP parameter to take the data from \fIstdin\fP\&.
+.SH EXAMPLES
+.SS Import from a remote location
+.sp
+This will create a new untagged image.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker import http://example.com/exampleimage.tgz
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Import from a local file
+.sp
+Import to docker via pipe and \fIstdin\fP\&.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ cat exampleimage.tgz | docker import \- exampleimagelocal:new
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Import from a local directory
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ sudo tar \-c . | docker import \- exampleimagedir
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Note the \fBsudo\fP in this example \-\- you must preserve the ownership of the
+files (especially root ownership) during the archiving with tar. If you are not
+root (or the sudo command) when you tar, then the ownerships might not get
+preserved.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker info
+
+Display system\-wide information.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker info
+Containers: 292
+Images: 194
+Debug mode (server): false
+Debug mode (client): false
+Fds: 22
+Goroutines: 67
+LXC Version: 0.9.0
+EventsListeners: 115
+Kernel Version: 3.8.0\-33\-generic
+WARNING: No swap limit support
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker insert IMAGE URL PATH
+
+Insert a file from URL in the IMAGE at PATH
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Use the specified \fBIMAGE\fP as the parent for a new image which adds a
+\fIlayer\fP containing the new file. The \fBinsert\fP command does
+not modify the original image, and the new image has the contents of the parent
+image, plus the new file.
+.SH EXAMPLES
+.SS Insert file from GitHub
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker insert 8283e18b24bc https://raw.github.com/metalivedev/django/master/postinstall /tmp/postinstall.sh
+06fd35556d7b
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker inspect CONTAINER|IMAGE [CONTAINER|IMAGE...]
+
+Return low\-level information on a container/image
+
+  \-format="": Format the output using the given go template.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+By default, this will render all results in a JSON array.  If a format
+is specified, the given template will be executed for each result.
+.sp
+Go\(aqs \fI\%text/template\fP package
+describes all the details of the format.
+.SH EXAMPLES
+.SS Get an instance\(aqs IP Address
+.sp
+For the most part, you can pick out any field from the JSON in a
+fairly straightforward manner.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker inspect \-format=\(aq{{.NetworkSettings.IPAddress}}\(aq $INSTANCE_ID
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS List All Port Bindings
+.sp
+One can loop over arrays and maps in the results to produce simple
+text output:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker inspect \-format=\(aq{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} \-> {{(index $conf 0).HostPort}} {{end}}\(aq $INSTANCE_ID
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Find a Specific Port Mapping
+.sp
+The \fB\&.Field\fP syntax doesn\(aqt work when the field name begins with a
+number, but the template language\(aqs \fBindex\fP function does.  The
+\fB\&.NetworkSettings.Ports\fP section contains a map of the internal port
+mappings to a list of external address/port objects, so to grab just
+the numeric public port, you use \fBindex\fP to find the specific port
+map, and then \fBindex\fP 0 contains first object inside of that.  Then
+we ask for the \fBHostPort\fP field to get the public address.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker inspect \-format=\(aq{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}\(aq $INSTANCE_ID
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker kill CONTAINER [CONTAINER...]
+
+Kill a running container (Send SIGKILL)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The main process inside the container will be sent SIGKILL.
+.SH KNOWN ISSUES (KILL)
+.INDENT 0.0
+.IP \(bu 2
+\fI\%Issue 197\fP indicates that \fBdocker kill\fP may leave directories
+behind and make it difficult to remove the container.
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker load < repository.tar
+
+Loads a tarred repository from the standard input stream.
+Restores both images and tags.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker login [OPTIONS] [SERVER]
+
+Register or Login to the docker registry server
+
+\-e="": email
+\-p="": password
+\-u="": username
+
+If you want to login to a private registry you can
+specify this by adding the server name.
+
+example:
+docker login localhost:8080
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker logs [OPTIONS] CONTAINER
+
+Fetch the logs of a container
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The \fBdocker logs\fP command is a convenience which batch\-retrieves whatever
+logs are present at the time of execution. This does not guarantee execution
+order when combined with a \fBdocker run\fP (i.e. your run may not have generated
+any logs at the time you execute \fBdocker logs\fP).
+.sp
+The \fBdocker logs \-f\fP command combines \fBdocker logs\fP and \fBdocker attach\fP:
+it will first return all logs from the beginning and then continue streaming
+new output from the container\(aqs stdout and stderr.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker port [OPTIONS] CONTAINER PRIVATE_PORT
+
+Lookup the public\-facing port which is NAT\-ed to PRIVATE_PORT
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker ps [OPTIONS]
+
+List containers
+
+  \-a=false: Show all containers. Only running containers are shown by default.
+  \-notrunc=false: Don\(aqt truncate output
+  \-q=false: Only display numeric IDs
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Running \fBdocker ps\fP showing 2 linked containers.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker ps
+CONTAINER ID        IMAGE                        COMMAND                CREATED              STATUS              PORTS               NAMES
+4c01db0b339c        fedora:20                 bash                   17 seconds ago       Up 16 seconds                           webapp
+d7886598dbe2        crosbymichael/redis:latest   /redis\-server \-\-dir    33 minutes ago       Up 33 minutes       6379/tcp            redis,webapp/db
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker pull NAME
+
+Pull an image or a repository from the registry
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker push NAME
+
+Push an image or a repository to the registry
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker restart [OPTIONS] NAME
+
+Restart a running container
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker rm [OPTIONS] CONTAINER
+
+Remove one or more containers
+    \-link="": Remove the link instead of the actual container
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH KNOWN ISSUES (RM)
+.INDENT 0.0
+.IP \(bu 2
+\fI\%Issue 197\fP indicates that \fBdocker kill\fP may leave directories
+behind and make it difficult to remove the container.
+.UNINDENT
+.SH EXAMPLES:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker rm /redis
+/redis
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This will remove the container referenced under the link \fB/redis\fP\&.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker rm \-link /webapp/redis
+/webapp/redis
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This will remove the underlying link between \fB/webapp\fP and the \fB/redis\fP containers removing all
+network communication.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker rm \(gadocker ps \-a \-q\(ga
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This command will delete all stopped containers. The command \fBdocker ps \-a \-q\fP will return all
+existing container IDs and pass them to the \fBrm\fP command which will delete them. Any running
+containers will not be deleted.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker rmi IMAGE [IMAGE...]
+
+Remove one or more images
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH REMOVING TAGGED IMAGES
+.sp
+Images can be removed either by their short or long ID\(aqs, or their image names.
+If an image has more than one name, each of them needs to be removed before the
+image is removed.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker images
+REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
+test1                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
+test                      latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
+test2                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
+
+$ docker rmi fd484f19954f
+Error: Conflict, cannot delete image fd484f19954f because it is tagged in multiple repositories
+2013/12/11 05:47:16 Error: failed to remove one or more images
+
+$ docker rmi test1
+Untagged: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8
+$ docker rmi test2
+Untagged: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8
+
+$ docker images
+REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
+test1                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
+$ docker rmi test
+Untagged: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8
+Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...]
+
+Run a command in a new container
+
+  \-a=map[]: Attach to stdin, stdout or stderr
+  \-c=0: CPU shares (relative weight)
+  \-cidfile="": Write the container ID to the file
+  \-d=false: Detached mode: Run container in the background, print new container id
+  \-e=[]: Set environment variables
+  \-h="": Container host name
+  \-i=false: Keep stdin open even if not attached
+  \-privileged=false: Give extended privileges to this container
+  \-m="": Memory limit (format: <number><optional unit>, where unit = b, k, m or g)
+  \-n=true: Enable networking for this container
+  \-p=[]: Map a network port to the container
+  \-rm=false: Automatically remove the container when it exits (incompatible with \-d)
+  \-t=false: Allocate a pseudo\-tty
+  \-u="": Username or UID
+  \-dns=[]: Set custom dns servers for the container
+  \-v=[]: Create a bind mount with: [host\-dir]:[container\-dir]:[rw|ro]. If "container\-dir" is missing, then docker creates a new volume.
+  \-volumes\-from="": Mount all volumes from the given container(s)
+  \-entrypoint="": Overwrite the default entrypoint set by the image
+  \-w="": Working directory inside the container
+  \-lxc\-conf=[]: Add custom lxc options \-lxc\-conf="lxc.cgroup.cpuset.cpus = 0,1"
+  \-sig\-proxy=true: Proxify all received signal to the process (even in non\-tty mode)
+  \-expose=[]: Expose a port from the container without publishing it to your host
+  \-link="": Add link to another container (name:alias)
+  \-name="": Assign the specified name to the container. If no name is specific docker will generate a random name
+  \-P=false: Publish all exposed ports to the host interfaces
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The \fBdocker run\fP command first \fBcreates\fP a writeable container layer over
+the specified image, and then \fBstarts\fP it using the specified command. That
+is, \fBdocker run\fP is equivalent to the API \fB/containers/create\fP then
+\fB/containers/(id)/start\fP\&.
+.sp
+The \fBdocker run\fP command can be used in combination with \fBdocker commit\fP to
+\fI\%change the command that a container runs\fP\&.
+.SH KNOWN ISSUES (RUN -VOLUMES-FROM)
+.INDENT 0.0
+.IP \(bu 2
+\fI\%Issue 2702\fP: "lxc\-start: Permission denied \- failed to mount"
+could indicate a permissions problem with AppArmor. Please see the
+issue for a workaround.
+.UNINDENT
+.SH EXAMPLES:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker run \-cidfile /tmp/docker_test.cid fedora echo "test"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This will create a container and print \fBtest\fP to the console. The
+\fBcidfile\fP flag makes Docker attempt to create a new file and write the
+container ID to it. If the file exists already, Docker will return an
+error. Docker will close this file when \fBdocker run\fP exits.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker run \-t \-i \-rm fedora bash
+root at bc338942ef20:/# mount \-t tmpfs none /mnt
+mount: permission denied
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This will \fInot\fP work, because by default, most potentially dangerous
+kernel capabilities are dropped; including \fBcap_sys_admin\fP (which is
+required to mount filesystems). However, the \fB\-privileged\fP flag will
+allow it to run:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker run \-privileged fedora bash
+root at 50e3f57e16e6:/# mount \-t tmpfs none /mnt
+root at 50e3f57e16e6:/# df \-h
+Filesystem      Size  Used Avail Use% Mounted on
+none            1.9G     0  1.9G   0% /mnt
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The \fB\-privileged\fP flag gives \fIall\fP capabilities to the container,
+and it also lifts all the limitations enforced by the \fBdevice\fP
+cgroup controller. In other words, the container can then do almost
+everything that the host can do. This flag exists to allow special
+use\-cases, like running Docker within Docker.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker  run \-w /path/to/dir/ \-i \-t  fedora pwd
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The \fB\-w\fP lets the command being executed inside directory given,
+here \fB/path/to/dir/\fP\&. If the path does not exists it is created inside the
+container.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker  run  \-v \(gapwd\(ga:\(gapwd\(ga \-w \(gapwd\(ga \-i \-t  fedora pwd
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The \fB\-v\fP flag mounts the current working directory into the container.
+The \fB\-w\fP lets the command being executed inside the current
+working directory, by changing into the directory to the value
+returned by \fBpwd\fP\&. So this combination executes the command
+using the container, but inside the current working directory.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker run \-p 127.0.0.1:80:8080 fedora bash
+.ft P
+.f
+.UNINDENT
+.UNINDENT
+.sp
+This binds port \fB8080\fP of the container to port \fB80\fP on \fB127.0.0.1\fP of the
+host machine. \fIport_redirection\fP explains in detail how to manipulate ports
+in Docker.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker run \-expose 80 fedora bash
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This exposes port \fB80\fP of the container for use within a link without
+publishing the port to the host system\(aqs interfaces. \fIport_redirection\fP
+explains in detail how to manipulate ports in Docker.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker run \-name console \-t \-i fedora bash
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This will create and run a new container with the container name
+being \fBconsole\fP\&.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker run \-link /redis:redis \-name console fedora bash
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The \fB\-link\fP flag will link the container named \fB/redis\fP into the
+newly created container with the alias \fBredis\fP\&.  The new container
+can access the network and environment of the redis container via
+environment variables.  The \fB\-name\fP flag will assign the name \fBconsole\fP
+to the newly created container.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker run \-volumes\-from 777f7dc92da7,ba8c0c54f0f2:ro \-i \-t fedora pwd
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The \fB\-volumes\-from\fP flag mounts all the defined volumes from the
+referenced containers. Containers can be specified by a comma seperated
+list or by repetitions of the \fB\-volumes\-from\fP argument. The container
+ID may be optionally suffixed with \fB:ro\fP or \fB:rw\fP to mount the volumes in
+read\-only or read\-write mode, respectively. By default, the volumes are mounted
+in the same mode (read write or read only) as the reference container.
+.SS A complete example
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ docker run \-d \-name static static\-web\-files sh
+$ docker run \-d \-expose=8098 \-name riak riakserver
+$ docker run \-d \-m 100m \-e DEVELOPMENT=1 \-e BRANCH=example\-code \-v $(pwd):/app/bin:ro \-name app appserver
+$ docker run \-d \-p 1443:443 \-dns=dns.dev.org \-v /var/log/httpd \-volumes\-from static \-link riak \-link app \-h www.sven.dev.org \-name web webserver
+$ docker run \-t \-i \-rm \-volumes\-from web \-w /var/log/httpd busybox tail \-f access.log
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This example shows 5 containers that might be set up to test a web application change:
+.INDENT 0.0
+.IP 1. 3
+Start a pre\-prepared volume image \fBstatic\-web\-files\fP (in the background) that has CSS, image and static HTML in it, (with a \fBVOLUME\fP instruction in the \fBDockerfile\fP to allow the web server to use those files);
+.IP 2. 3
+Start a pre\-prepared \fBriakserver\fP image, give the container name \fBriak\fP and expose port \fB8098\fP to any containers that link to it;
+.IP 3. 3
+Start the \fBappserver\fP image, restricting its memory usage to 100MB, setting two environment variables \fBDEVELOPMENT\fP and \fBBRANCH\fP and bind\-mounting the current directory (\fB$(pwd)\fP) in the container in read\-only mode as \fB/app/bin\fP;
+.IP 4. 3
+Start the \fBwebserver\fP, mapping port \fB443\fP in the container to port \fB1443\fP on the Docker server, setting the DNS server to \fBdns.dev.org\fP, creating a volume to put the log files into (so we can access it from another container), then importing the files from the volume exposed by the \fBstatic\fP container, and linking to all exposed ports from \fBriak\fP and \fBapp\fP\&. Lastly, we set the hostname to \fBweb.sven.dev.org\fP so its consistent with the pre\-generated SSL certificate;
+.IP 5. 3
+Finally, we create a container that runs \fBtail \-f access.log\fP using the logs volume from the \fBweb\fP container, setting the workdir to \fB/var/log/httpd\fP\&. The \fB\-rm\fP option means that when the container exits, the container\(aqs layer is removed.
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker save image > repository.tar
+
+Streams a tarred repository to the standard output stream.
+Contains all parent layers, and all tags + versions.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker search TERM
+
+Search the docker index for images
+
+ \-notrunc=false: Don\(aqt truncate output
+ \-stars=0: Only displays with at least xxx stars
+ \-trusted=false: Only show trusted builds
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker start [OPTIONS] CONTAINER
+
+Start a stopped container
+
+  \-a=false: Attach container\(aqs stdout/stderr and forward all signals to the process
+  \-i=false: Attach container\(aqs stdin
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]
+
+Stop a running container (Send SIGTERM, and then SIGKILL after grace period)
+
+  \-t=10: Number of seconds to wait for the container to stop before killing it.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The main process inside the container will receive SIGTERM, and after a grace period, SIGKILL
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker tag [OPTIONS] IMAGE REPOSITORY[:TAG]
+
+Tag an image into a repository
+
+  \-f=false: Force
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker top CONTAINER [ps OPTIONS]
+
+Lookup the running processes of a container
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Show the version of the Docker client, daemon, and latest released version.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Usage: docker wait [OPTIONS] NAME
+
+Block until a container stops, then print its exit code.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH AUTHORS
+Team Docker
+
+Lokesh Mandvekar <lsm5 at redhat.com>
+.SH COPYRIGHT
+2013, Team Docker
+.\" Generated by docutils manpage writer.
+.


More information about the scm-commits mailing list