diff --git a/Dockerfile b/Dockerfile index ab82dfa700..be2233ff87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,6 +42,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq \ libcap-dev \ libsqlite3-dev \ mercurial \ + pandoc \ reprepro \ ruby1.9.1 \ ruby1.9.1-dev \ diff --git a/contrib/man/.gitignore b/contrib/man/.gitignore new file mode 100644 index 0000000000..c2c63b5d2e --- /dev/null +++ b/contrib/man/.gitignore @@ -0,0 +1,2 @@ +# these are generated by the md/md2man-all.sh script +man* diff --git a/contrib/man/md/Dockerfile b/contrib/man/md/Dockerfile new file mode 100644 index 0000000000..438227df89 --- /dev/null +++ b/contrib/man/md/Dockerfile @@ -0,0 +1,5 @@ +FROM fedora:20 +MAINTAINER ipbabble +# Update and install pandoc +RUN yum -y update; yum clean all; +RUN yum -y install pandoc; diff --git a/contrib/man/md/README.md b/contrib/man/md/README.md new file mode 100644 index 0000000000..d49b39b7a2 --- /dev/null +++ b/contrib/man/md/README.md @@ -0,0 +1,71 @@ +Docker Documentation +==================== + +This directory contains the Docker user manual in the Markdown format. +Do *not* edit the man pages in the man1 directory. Instead, amend the +Markdown (*.md) files. + +# File List + + docker.md + docker-attach.md + docker-build.md + docker-commit.md + docker-cp.md + docker-diff.md + docker-events.md + docker-export.md + docker-history.md + docker-images.md + docker-import.md + docker-info.md + docker-inspect.md + docker-kill.md + docker-load.md + docker-login.md + docker-logs.md + docker-port.md + docker-ps.md + docker-pull.md + docker-push.md + docker-restart.md + docker-rmi.md + docker-rm.md + docker-run.md + docker-save.md + docker-search.md + docker-start.md + docker-stop.md + docker-tag.md + docker-top.md + docker-wait.md + Dockerfile + md2man-all.sh + +# Generating man pages from the Markdown files + +The recommended approach for generating the man pages is via a Docker +container. Using the supplied Dockerfile, Docker will create a Fedora based +container and isolate the Pandoc installation. This is a seamless process, +saving you from dealing with Pandoc and dependencies on your own computer. + +## Building the Fedora / Pandoc image + +There is a Dockerfile provided in the `docker/contrib/man/md` directory. + +Using this Dockerfile, create a Docker image tagged `fedora/pandoc`: + + docker build -t fedora/pandoc . + +## Utilizing the Fedora / Pandoc image + +Once the image is built, run a container using the image with *volumes*: + + docker run -v //docker/contrib/man:/pandoc:rw \ + -w /pandoc -i fedora/pandoc /pandoc/md/md2man-all.sh + +The Pandoc Docker container will process the Markdown files and generate +the man pages inside the `docker/contrib/man/man1` directory using +Docker volumes. For more information on Docker volumes see the man page for +`docker run` and also look at the article [Sharing Directories via Volumes] +(http://docs.docker.io/use/working_with_volumes/). diff --git a/contrib/man/md/docker-attach.md b/contrib/man/md/docker-attach.md new file mode 100644 index 0000000000..2755fd27f5 --- /dev/null +++ b/contrib/man/md/docker-attach.md @@ -0,0 +1,57 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-attach - Attach to a running container + +# SYNOPSIS +**docker attach** **--no-stdin**[=*false*] **--sig-proxy**[=*true*] CONTAINER + +# DESCRIPTION +If you **docker run** a container in detached mode (**-d**), you can reattach to + the detached container with **docker attach** using the container's ID or name. + +You can detach from the container again (and leave it running) with `CTRL-c` (for +a quiet exit) or `CTRL-\` to get a stacktrace of the Docker client when it quits. +When you detach from a container the exit code will be returned to +the client. + +# OPTIONS +**--no-stdin**=*true*|*false* +When set to true, do not attach to stdin. The default is *false*. + +**--sig-proxy**=*true*|*false*: +When set to true, proxify all received signal to the process (even in non-tty +mode). The default is *true*. + +# EXAMPLES + +## Attaching to a container + +In this example the top command is run inside a container, from an image called +fedora, in detached mode. The ID from the container is passed into the **docker +attach** command: + + # ID=$(sudo docker run -d fedora /usr/bin/top -b) + # sudo 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 + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-build.md b/contrib/man/md/docker-build.md new file mode 100644 index 0000000000..679dc577c4 --- /dev/null +++ b/contrib/man/md/docker-build.md @@ -0,0 +1,82 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-build - Build a container image from a Dockerfile source at PATH + +# SYNOPSIS +**docker build** [**--no-cache**[=*false*] [**-q**|**--quiet**[=*false*] + [**-rm**] [**-t**|**--tag**=*tag*] PATH | URL | - + +# DESCRIPTION +This will read the Dockerfile from the directory specified in **PATH**. +It also sends any other files and directories found in the current +directory to the Docker daemon. The contents of this directory would +be used by **ADD** commands found within the Dockerfile. + +Warning, this will send a lot of data to the Docker daemon depending +on the contents of the current directory. The build is run by the Docker +daemon, not by the CLI, so the whole context must be transferred to the daemon. +The Docker CLI reports "Uploading context" when the context is sent to +the daemon. + +When a single Dockerfile is given as the URL, then no context is set. +When a Git repository is set as the **URL**, the repository is used +as context. + +# OPTIONS + +**-q**, **--quiet**=*true*|*false* + When set to true, suppress verbose build output. Default is *false*. + +**--rm**=*true*|*false* + When true, remove intermediate containers that are created during the +build process. The default is true. + +**-t**, **--tag**=*tag* + Tag to be applied to the resulting image on successful completion of +the build. + +**--no-cache**=*true*|*false* + When set to true, do not use a cache when building the image. The +default is *false*. + +# EXAMPLES + +## Building an image using a Dockefile located inside the current directory + +Docker images can be built using the build command and a Dockerfile: + + docker build . + +During the build process Docker creates intermediate images. In order to +keep them, you must explicitly set `--rm=false`. + + docker build --rm=false . + +A good practice is to make a sub-directory with a related name and create +the Dockerfile in that directory. For example, a directory called mongo may +contain a Dockerfile to create a Docker MongoDB image. Likewise, another +directory called httpd may be used to store Dockerfiles for Apache web +server images. + +It is also a good practice to add the files required for the image to the +sub-directory. These files will then be specified with the `ADD` instruction +in the Dockerfile. Note: If you include a tar file (a good practice!), then +Docker will automatically extract the contents of the tar file +specified within the `ADD` instruction into the specified target. + +## Building an image using a URL + +This will clone the specified Github repository from the URL and use it +as context. The Dockerfile at the root of the repository is used as +Dockerfile. This only works if the Github repository is a dedicated +repository. + + docker build github.com/scollier/Fedora-Dockerfiles/tree/master/apache + +Note: You can set an arbitrary Git repository via the `git://` schema. + +# HISTORY +March 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-commit.md b/contrib/man/md/docker-commit.md new file mode 100644 index 0000000000..84cdca6137 --- /dev/null +++ b/contrib/man/md/docker-commit.md @@ -0,0 +1,34 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-commit - Create a new image from the changes to an existing +container + +# SYNOPSIS +**docker commit** **-a**|**--author**[=""] **-m**|**--message**[=""] +CONTAINER [REPOSITORY[:TAG]] + +# DESCRIPTION +Using an existing container's name or ID you can create a new image. + +# OPTIONS +**-a, --author**="" + Author name. (eg. "John Hannibal Smith " + +**-m, --message**="" + Commit message + +# EXAMPLES + +## Creating a new image from an existing container +An existing Fedora based container has had Apache installed while running +in interactive mode with the bash shell. Apache is also running. To +create a new image run docker ps to find the container's ID and then run: + + # docker commit -me= "Added Apache to Fedora base image" \ + --a="A D Ministrator" 98bd7fc99854 fedora/fedora_httpd:20 + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and in \ No newline at end of file diff --git a/contrib/man/md/docker-cp.md b/contrib/man/md/docker-cp.md new file mode 100644 index 0000000000..f787198669 --- /dev/null +++ b/contrib/man/md/docker-cp.md @@ -0,0 +1,24 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-cp - Copy files/folders from the PATH to the HOSTPATH + +# SYNOPSIS +**docker cp** CONTAINER:PATH HOSTPATH + +# DESCRIPTION +Copy files/folders from the containers filesystem to the host +path. Paths are relative to the root of the filesystem. Files +can be copied from a running or stopped container. + +# EXAMPLE +An important shell script file, created in a bash shell, is copied from +the exited container to the current dir on the host: + + # docker cp c071f3c3ee81:setup.sh . + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. + diff --git a/contrib/man/md/docker-diff.md b/contrib/man/md/docker-diff.md new file mode 100644 index 0000000000..2053f2c3d2 --- /dev/null +++ b/contrib/man/md/docker-diff.md @@ -0,0 +1,44 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-diff - Inspect changes on a container's filesystem + +# SYNOPSIS +**docker diff** CONTAINER + +# DESCRIPTION +Inspect changes on a container's filesystem. You can use the full or +shortened container ID or the container name set using +**docker run --name** option. + +# EXAMPLE +Inspect the changes to on a nginx container: + + # docker diff 1fdfd1f54c1b + C /dev + C /dev/console + C /dev/core + C /dev/stdout + C /dev/fd + C /dev/ptmx + C /dev/stderr + C /dev/stdin + C /run + A /run/nginx.pid + C /var/lib/nginx/tmp + A /var/lib/nginx/tmp/client_body + A /var/lib/nginx/tmp/fastcgi + A /var/lib/nginx/tmp/proxy + A /var/lib/nginx/tmp/scgi + A /var/lib/nginx/tmp/uwsgi + C /var/log/nginx + A /var/log/nginx/access.log + A /var/log/nginx/error.log + + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. + + diff --git a/contrib/man/md/docker-events.md b/contrib/man/md/docker-events.md new file mode 100644 index 0000000000..c9bfdec9e8 --- /dev/null +++ b/contrib/man/md/docker-events.md @@ -0,0 +1,46 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-events - Get real time events from the server + +**docker events** **--since**=""|*epoch-time* + +# DESCRIPTION +Get event information from the Docker daemon. Information can include historical +information and real-time information. + +# OPTIONS +**--since**="" +Show previously created events and then stream. This can be in either +seconds since epoch, or date string. + +# EXAMPLES + +## Listening for Docker events + +After running docker events a container 786d698004576 is started and stopped +(The container name has been shortened in the ouput below): + + # docker events + [2014-04-12 18:23:04 -0400 EDT] 786d69800457: (from whenry/testimage:latest) start + [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) die + [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) stop + +## Listening for events since a given date +Again the output container IDs have been shortened for the purposes of this document: + + # docker events --since '2014-04-12' + [2014-04-12 18:11:28 -0400 EDT] c655dbf640dc: (from whenry/testimage:latest) create + [2014-04-12 18:11:28 -0400 EDT] c655dbf640dc: (from whenry/testimage:latest) start + [2014-04-12 18:14:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) create + [2014-04-12 18:14:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) start + [2014-04-12 18:22:44 -0400 EDT] 786d69800457: (from whenry/testimage:latest) die + [2014-04-12 18:22:44 -0400 EDT] 786d69800457: (from whenry/testimage:latest) stop + [2014-04-12 18:23:04 -0400 EDT] 786d69800457: (from whenry/testimage:latest) start + [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) die + [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) stop + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. \ No newline at end of file diff --git a/contrib/man/md/docker-export.md b/contrib/man/md/docker-export.md new file mode 100644 index 0000000000..ab11aa1266 --- /dev/null +++ b/contrib/man/md/docker-export.md @@ -0,0 +1,26 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-export - Export the contents of a filesystem as a tar archive to +STDOUT. + +# SYNOPSIS +**docker export** CONTAINER + +# DESCRIPTION +Export the contents of a container's filesystem using the full or shortened +container ID or container name. The output is exported to STDOUT and can be +redirected to a tar file. + +# EXAMPLE +Export the contents of the container called angry_bell to a tar file +called test.tar: + + # docker export angry_bell > test.tar + # ls *.tar + test.tar + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-history.md b/contrib/man/md/docker-history.md new file mode 100644 index 0000000000..1b3a9858b5 --- /dev/null +++ b/contrib/man/md/docker-history.md @@ -0,0 +1,32 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-history - Show the history of an image + +# SYNOPSIS +**docker history** **--no-trunc**[=*false*] [**-q**|**--quiet**[=*false*]] + IMAGE + +# DESCRIPTION + +Show the history of when and how an image was created. + +# OPTIONS + +**--no-trunc**=*true*|*false* + When true don't truncate output. Default is false + +**-q**, **--quiet=*true*|*false* + When true only show numeric IDs. Default is false. + +# EXAMPLE + $ sudo docker history fedora + IMAGE CREATED CREATED BY SIZE + 105182bb5e8b 5 days ago /bin/sh -c #(nop) ADD file:71356d2ad59aa3119d 372.7 MB + 73bd853d2ea5 13 days ago /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar 0 B + 511136ea3c5a 10 months ago 0 B + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-images.md b/contrib/man/md/docker-images.md new file mode 100644 index 0000000000..a466798096 --- /dev/null +++ b/contrib/man/md/docker-images.md @@ -0,0 +1,99 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-images - List the images in the local repository + +# SYNOPSIS +**docker images** +[**-a**|**--all**=*false*] +[**--no-trunc**[=*false*] +[**-q**|**--quiet**[=*false*] +[**-t**|**--tree**=*false*] +[**-v**|**--viz**=*false*] +[NAME] + +# DESCRIPTION +This command lists the images stored in the local Docker repository. + +By default, intermediate images, used during builds, are not listed. Some of the +output, e.g. image ID, is truncated, for space reasons. However the truncated +image ID, and often the first few characters, are enough to be used in other +Docker commands that use the image ID. The output includes repository, tag, image +ID, date created and the virtual size. + +The title REPOSITORY for the first title may seem confusing. It is essentially +the image name. However, because you can tag a specific image, and multiple tags +(image instances) can be associated with a single name, the name is really a +repository for all tagged images of the same name. For example consider an image +called fedora. It may be tagged with 18, 19, or 20, etc. to manage different +versions. + +# OPTIONS + +**-a**, **--all**=*true*|*false* + When set to true, also include all intermediate images in the list. The +default is false. + +**--no-trunc**=*true*|*false* + When set to true, list the full image ID and not the truncated ID. The +default is false. + +**-q**, **--quiet**=*true*|*false* + When set to true, list the complete image ID as part of the output. The +default is false. + +**-t**, **--tree**=*true*|*false* + When set to true, list the images in a tree dependency tree (hierarchy) +format. The default is false. + +**-v**, **--viz**=*true*|*false* + When set to true, list the graph in graphviz format. The default is +*false*. + +# EXAMPLES + +## Listing the images + +To list the images in a local repository (not the registry) run: + + docker images + +The list will contain the image repository name, a tag for the image, and an +image ID, when it was created and its virtual size. Columns: REPOSITORY, TAG, +IMAGE ID, CREATED, and VIRTUAL SIZE. + +To get a verbose list of images which contains all the intermediate images +used in builds use **-a**: + + docker images -a + +## List images dependency tree hierarchy + +To list the images in the local repository (not the registry) in a dependency +tree format, use the **-t** option. + + docker images -t + +This displays a staggered hierarchy tree where the less indented image is +the oldest with dependent image layers branching inward (to the right) on +subsequent lines. The newest or top level image layer is listed last in +any tree branch. + +## List images in GraphViz format + +To display the list in a format consumable by a GraphViz tools run with +**-v**. For example to produce a .png graph file of the hierarchy use: + + docker images --viz | dot -Tpng -o docker.png + +## Listing only the shortened image IDs + +Listing just the shortened image IDs. This can be useful for some automated +tools. + + docker images -q + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-import.md b/contrib/man/md/docker-import.md new file mode 100644 index 0000000000..a0db89eef4 --- /dev/null +++ b/contrib/man/md/docker-import.md @@ -0,0 +1,39 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-import - Create an empty filesystem image and import the contents +of the tarball into it. + +# SYNOPSIS +**docker import** URL|- [REPOSITORY[:TAG]] + +# DESCRIPTION +Create a new filesystem image from the contents of a tarball (.tar, +.tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then optionally tag it. + +# EXAMPLES + +## Import from a remote location + + # docker import http://example.com/exampleimage.tgz example/imagerepo + +## Import from a local file + +Import to docker via pipe and stdin: + + # cat exampleimage.tgz | docker import - example/imagelocal + +## Import from a local file and tag + +Import to docker via pipe and stdin: + + # cat exampleimageV2.tgz | docker import - example/imagelocal:V-2.0 + +## Import from a local directory + + # tar -c . | docker import - exampleimagedir + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-info.md b/contrib/man/md/docker-info.md new file mode 100644 index 0000000000..8c03945dbe --- /dev/null +++ b/contrib/man/md/docker-info.md @@ -0,0 +1,46 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-info - Display system wide information + +# SYNOPSIS +**docker info** + +# DESCRIPTION +This command displays system wide information regarding the Docker installation. +Information displayed includes the number of containers and images, pool name, +data file, metadata file, data space used, total data space, metadata space used +, total metadata space, execution driver, and the kernel version. + +The data file is where the images are stored and the metadata file is where the +meta data regarding those images are stored. When run for the first time Docker +allocates a certain amount of data space and meta data space from the space +available on the volume where `/var/lib/docker` is mounted. + +# OPTIONS +There are no available options. + +# EXAMPLES + +## Display Docker system information + +Here is a sample output: + + # docker info + Containers: 18 + Images: 95 + Storage Driver: devicemapper + Pool Name: docker-8:1-170408448-pool + Data file: /var/lib/docker/devicemapper/devicemapper/data + Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata + Data Space Used: 9946.3 Mb + Data Space Total: 102400.0 Mb + Metadata Space Used: 9.9 Mb + Metadata Space Total: 2048.0 Mb + Execution Driver: native-0.1 + Kernel Version: 3.10.0-116.el7.x86_64 + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-inspect.md b/contrib/man/md/docker-inspect.md new file mode 100644 index 0000000000..a49e42138f --- /dev/null +++ b/contrib/man/md/docker-inspect.md @@ -0,0 +1,229 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-inspect - Return low-level information on a container/image + +# SYNOPSIS +**docker inspect** [**-f**|**--format**="" CONTAINER|IMAGE +[CONTAINER|IMAGE...] + +# DESCRIPTION + +This displays all the information available in Docker for a given +container or image. 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. + +# OPTIONS +**-f**, **--format**="" + The text/template package of Go describes all the details of the +format. See examples section + +# EXAMPLES + +## Getting information on a container + +To get information on a container use it's ID or instance name: + + #docker inspect 1eb5fabf5a03 + [{ + "ID": "1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b", + "Created": "2014-04-04T21:33:52.02361335Z", + "Path": "/usr/sbin/nginx", + "Args": [], + "Config": { + "Hostname": "1eb5fabf5a03", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 0, + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "PortSpecs": null, + "ExposedPorts": { + "80/tcp": {} + }, + "Tty": true, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "HOME=/", + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Cmd": [ + "/usr/sbin/nginx" + ], + "Dns": null, + "DnsSearch": null, + "Image": "summit/nginx", + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "", + "Entrypoint": null, + "NetworkDisabled": false, + "OnBuild": null, + "Context": { + "mount_label": "system_u:object_r:svirt_sandbox_file_t:s0:c0,c650", + "process_label": "system_u:system_r:svirt_lxc_net_t:s0:c0,c650" + } + }, + "State": { + "Running": true, + "Pid": 858, + "ExitCode": 0, + "StartedAt": "2014-04-04T21:33:54.16259207Z", + "FinishedAt": "0001-01-01T00:00:00Z", + "Ghost": false + }, + "Image": "df53773a4390e25936f9fd3739e0c0e60a62d024ea7b669282b27e65ae8458e6", + "NetworkSettings": { + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "Gateway": "172.17.42.1", + "Bridge": "docker0", + "PortMapping": null, + "Ports": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + } + ] + } + }, + "ResolvConfPath": "/etc/resolv.conf", + "HostnamePath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/hostname", + "HostsPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/hosts", + "Name": "/ecstatic_ptolemy", + "Driver": "devicemapper", + "ExecDriver": "native-0.1", + "Volumes": {}, + "VolumesRW": {}, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Privileged": false, + "PortBindings": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + } + ] + }, + "Links": null, + "PublishAllPorts": false, + "DriverOptions": { + "lxc": null + }, + "CliAddress": "" + } + +## Getting the IP address of a container instance + +To get the IP address of a container use: + + # docker inspect --format='{{.NetworkSettings.IPAddress}}' 1eb5fabf5a03 + 172.17.0.2 + +## Listing all port bindings + +One can loop over arrays and maps in the results to produce simple text +output: + + # docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} \ + {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' 1eb5fabf5a03 + + 80/tcp -> 80 + +## Getting information on an image + +Use an image's ID or name (e.g. repository/name[:tag]) to get information + on it. + + # docker inspect 58394af37342 + [{ + "id": "58394af373423902a1b97f209a31e3777932d9321ef10e64feaaa7b4df609cf9", + "parent": "8abc22bad04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", + "created": "2014-02-03T16:10:40.500814677Z", + "container": "f718f19a28a5147da49313c54620306243734bafa63c76942ef6f8c4b4113bc5", + "container_config": { + "Hostname": "88807319f25e", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 0, + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "PortSpecs": null, + "ExposedPorts": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "HOME=/", + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Cmd": [ + "/bin/sh", + "-c", + "#(nop) ADD fedora-20-dummy.tar.xz in /" + ], + "Dns": null, + "DnsSearch": null, + "Image": "8abc22bad04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "", + "Entrypoint": null, + "NetworkDisabled": false, + "OnBuild": null, + "Context": null + }, + "docker_version": "0.6.3", + "author": "I P Babble \u003clsm5@ipbabble.com\u003e - ./buildcontainers.sh", + "config": { + "Hostname": "88807319f25e", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 0, + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "PortSpecs": null, + "ExposedPorts": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "HOME=/", + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Cmd": null, + "Dns": null, + "DnsSearch": null, + "Image": "8abc22bad04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "", + "Entrypoint": null, + "NetworkDisabled": false, + "OnBuild": null, + "Context": null + }, + "architecture": "x86_64", + "Size": 385520098 + }] + +# HISTORY + +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-kill.md b/contrib/man/md/docker-kill.md new file mode 100644 index 0000000000..8175002d33 --- /dev/null +++ b/contrib/man/md/docker-kill.md @@ -0,0 +1,21 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-kill - Kill a running container (send SIGKILL, or specified signal) + +# SYNOPSIS +**docker kill** **--signal**[=*"KILL"*] CONTAINER [CONTAINER...] + +# DESCRIPTION + +The main process inside each container specified will be sent SIGKILL, + or any signal specified with option --signal. + +# OPTIONS +**-s**, **--signal**=*"KILL"* + Signal to send to the container + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) + based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-load.md b/contrib/man/md/docker-load.md new file mode 100644 index 0000000000..535b701cca --- /dev/null +++ b/contrib/man/md/docker-load.md @@ -0,0 +1,36 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-load - Load an image from a tar archive on STDIN + +# SYNOPSIS +**docker load** **--input**="" + +# DESCRIPTION + +Loads a tarred repository from a file or the standard input stream. +Restores both images and tags. + +# OPTIONS + +**-i**, **--input**="" + Read from a tar archive file, instead of STDIN + +# EXAMPLE + + $ sudo docker images + REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE + busybox latest 769b9341d937 7 weeks ago 2.489 MB + $ sudo docker load --input fedora.tar + $ sudo docker images + REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE + busybox latest 769b9341d937 7 weeks ago 2.489 MB + fedora rawhide 0d20aec6529d 7 weeks ago 387 MB + fedora 20 58394af37342 7 weeks ago 385.5 MB + fedora heisenbug 58394af37342 7 weeks ago 385.5 MB + fedora latest 58394af37342 7 weeks ago 385.5 MB + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-login.md b/contrib/man/md/docker-login.md new file mode 100644 index 0000000000..0a9cb283dd --- /dev/null +++ b/contrib/man/md/docker-login.md @@ -0,0 +1,35 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-login - Register or Login to a docker registry server. + +# SYNOPSIS +**docker login** [**-e**|**-email**=""] [**-p**|**--password**=""] + [**-u**|**--username**=""] [SERVER] + +# DESCRIPTION +Register or Login to a docker registry server, if no server is +specified "https://index.docker.io/v1/" is the default. If you want to +login to a private registry you can specify this by adding the server name. + +# OPTIONS +**-e**, **--email**="" + Email address + +**-p**, **--password**="" + Password + +**-u**, **--username**="" + Username + +# EXAMPLE + +## Login to a local registry + + # docker login localhost:8080 + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. + diff --git a/contrib/man/md/docker-logs.md b/contrib/man/md/docker-logs.md new file mode 100644 index 0000000000..0b9ce867e9 --- /dev/null +++ b/contrib/man/md/docker-logs.md @@ -0,0 +1,26 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-logs - Fetch the logs of a container + +# SYNOPSIS +**docker logs** **--follow**[=*false*] CONTAINER + +# DESCRIPTION +The **docker logs** command batch-retrieves whatever logs are present for +a container at the time of execution. This does not guarantee execution +order when combined with a docker run (i.e. your run may not have generated +any logs at the time you execute docker logs). + +The **docker logs --follow** command combines commands **docker logs** and +**docker attach**. It will first return all logs from the beginning and +then continue streaming new output from the container’s stdout and stderr. + +# OPTIONS +**-f, --follow**=*true*|*false* + When *true*, follow log output. The default is false. + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-port.md b/contrib/man/md/docker-port.md new file mode 100644 index 0000000000..9773e4d80c --- /dev/null +++ b/contrib/man/md/docker-port.md @@ -0,0 +1,15 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-port - Lookup the public-facing port which is NAT-ed to PRIVATE_PORT + +# SYNOPSIS +**docker port** CONTAINER PRIVATE_PORT + +# DESCRIPTION +Lookup the public-facing port which is NAT-ed to PRIVATE_PORT + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-ps.md b/contrib/man/md/docker-ps.md new file mode 100644 index 0000000000..60fce0213a --- /dev/null +++ b/contrib/man/md/docker-ps.md @@ -0,0 +1,68 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-ps - List containers + +# SYNOPSIS +**docker ps** [**-a**|**--all**=*false*] [**--before**=""] +[**-l**|**--latest**=*false*] [**-n**=*-1*] [**--no-trunc**=*false*] +[**-q**|**--quiet**=*false*] [**-s**|**--size**=*false*] +[**--since**=""] + +# DESCRIPTION + +List the containers in the local repository. By default this show only +the running containers. + +# OPTIONS + +**-a**, **--all**=*true*|*false* + When true show all containers. Only running containers are shown by +default. Default is false. + +**--before**="" + Show only container created before Id or Name, include non-running +ones. + +**-l**, **--latest**=*true*|*false* + When true show only the latest created container, include non-running +ones. The default is false. + +**-n**=NUM + Show NUM (integer) last created containers, include non-running ones. +The default is -1 (none) + +**--no-trunc**=*true*|*false* + When true truncate output. Default is false. + +**-q**, **--quiet**=*true*|*false* + When false only display numeric IDs. Default is false. + +**-s**, **--size**=*true*|*false* + When true display container sizes. Default is false. + +**--since**="" + Show only containers created since Id or Name, include non-running ones. + +# EXAMPLE +# Display all containers, including non-running + + # docker ps -a + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + a87ecb4f327c fedora:20 /bin/sh -c #(nop) MA 20 minutes ago Exit 0 desperate_brattain + 01946d9d34d8 vpavlin/rhel7:latest /bin/sh -c #(nop) MA 33 minutes ago Exit 0 thirsty_bell + c1d3b0166030 acffc0358b9e /bin/sh -c yum -y up 2 weeks ago Exit 1 determined_torvalds + 41d50ecd2f57 fedora:20 /bin/sh -c #(nop) MA 2 weeks ago Exit 0 drunk_pike + +# Display only IDs of all containers, including non-running + + # docker ps -a -q + a87ecb4f327c + 01946d9d34d8 + c1d3b0166030 + 41d50ecd2f57 + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-pull.md b/contrib/man/md/docker-pull.md new file mode 100644 index 0000000000..1f64d3f648 --- /dev/null +++ b/contrib/man/md/docker-pull.md @@ -0,0 +1,37 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-pull - Pull an image or a repository from the registry + +# SYNOPSIS +**docker pull** NAME[:TAG] + +# DESCRIPTION + +This command pulls down an image or a repository from the registry. If +there is more than one image for a repository (e.g. fedora) then all +images for that repository name are pulled down including any tags. + +# EXAMPLE + +# Pull a reposiotry with multiple images + + $ sudo docker pull fedora + Pulling repository fedora + ad57ef8d78d7: Download complete + 105182bb5e8b: Download complete + 511136ea3c5a: Download complete + 73bd853d2ea5: Download complete + + $ sudo docker images + REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE + fedora rawhide ad57ef8d78d7 5 days ago 359.3 MB + fedora 20 105182bb5e8b 5 days ago 372.7 MB + fedora heisenbug 105182bb5e8b 5 days ago 372.7 MB + fedora latest 105182bb5e8b 5 days ago 372.7 MB + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. + diff --git a/contrib/man/md/docker-push.md b/contrib/man/md/docker-push.md new file mode 100644 index 0000000000..dbb6e7d1b1 --- /dev/null +++ b/contrib/man/md/docker-push.md @@ -0,0 +1,44 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-push - Push an image or a repository to the registry + +# SYNOPSIS +**docker push** NAME[:TAG] + +# DESCRIPTION +Push an image or a repository to a registry. The default registry is the Docker +Index located at [index.docker.io](https://index.docker.io/v1/). However the +image can be pushed to another, perhaps private, registry as demonstrated in +the example below. + +# EXAMPLE + +# Pushing a new image to a registry + +First save the new image by finding the container ID (using **docker ps**) +and then committing it to a new image name: + + # docker commit c16378f943fe rhel-httpd + +Now push the image to the registry using the image ID. In this example +the registry is on host named registry-host and listening on port 5000. +Default Docker commands will push to the default `index.docker.io` +registry. Instead, push to the local registry, which is on a host called +registry-host*. To do this, tag the image with the host name or IP +address, and the port of the registry: + + # docker tag rhel-httpd registry-host:5000/myadmin/rhel-httpd + # docker push registry-host:5000/myadmin/rhel-httpd + +Check that this worked by running: + + # docker images + +You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd` +listed. + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-restart.md b/contrib/man/md/docker-restart.md new file mode 100644 index 0000000000..44634f6613 --- /dev/null +++ b/contrib/man/md/docker-restart.md @@ -0,0 +1,21 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-restart - Restart a running container + +# SYNOPSIS +**docker restart** [**-t**|**--time**[=*10*]] CONTAINER [CONTAINER...] + +# DESCRIPTION +Restart each container listed. + +# OPTIONS +**-t**, **--time**=NUM + Number of seconds to try to stop for before killing the container. Once +killed it will then be restarted. Default=10 + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. + diff --git a/contrib/man/md/docker-rm.md b/contrib/man/md/docker-rm.md new file mode 100644 index 0000000000..ae85af5277 --- /dev/null +++ b/contrib/man/md/docker-rm.md @@ -0,0 +1,56 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 + +# NAME + +docker-rm - Remove one or more containers. + +# SYNOPSIS + +**docker rm** [**-f**|**--force**[=*false*] [**-l**|**--link**[=*false*] [**-v**| +**--volumes**[=*false*] +CONTAINER [CONTAINER...] + +# DESCRIPTION + +**docker rm** will remove one or more containers from the host node. The +container name or ID can be used. This does not remove images. You cannot +remove a running container unless you use the \fB-f\fR option. To see all +containers on a host use the **docker ps -a** command. + +# OPTIONS + +**-f**, **--force**=*true*|*false* + When set to true, force the removal of the container. The default is +*false*. + +**-l**, **--link**=*true*|*false* + When set to true, remove the specified link and not the underlying +container. The default is *false*. + +**-v**, **--volumes**=*true*|*false* + When set to true, remove the volumes associated to the container. The +default is *false*. + +# EXAMPLES + +##Removing a container using its ID## + +To remove a container using its ID, find either from a **docker ps -a** +command, or use the ID returned from the **docker run** command, or retrieve +it from a file used to store it using the **docker run --cidfile**: + + docker rm abebf7571666 + +##Removing a container using the container name## + +The name of the container can be found using the **docker ps -a** +command. The use that name as follows: + + docker rm hopeful_morse + +# HISTORY + +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-rmi.md b/contrib/man/md/docker-rmi.md new file mode 100644 index 0000000000..b728dc16a9 --- /dev/null +++ b/contrib/man/md/docker-rmi.md @@ -0,0 +1,35 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-rmi \- Remove one or more images. + +# SYNOPSIS + +**docker rmi** [**-f**|**--force**[=*false*] IMAGE [IMAGE...] + +# DESCRIPTION + +This will remove one or more images from the host node. This does not +remove images from a registry. You cannot remove an image of a running +container unless you use the **-f** option. To see all images on a host +use the **docker images** command. + +# OPTIONS + +**-f**, **--force**=*true*|*false* + When set to true, force the removal of the image. The default is +*false*. + +# EXAMPLES + +## Removing an image + +Here is an example of removing and image: + + docker rmi fedora/httpd + +# HISTORY + +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-run.md b/contrib/man/md/docker-run.md new file mode 100644 index 0000000000..56364f9d5f --- /dev/null +++ b/contrib/man/md/docker-run.md @@ -0,0 +1,343 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-run - Run a process in an isolated container + +# SYNOPSIS +**docker run** +[**-a**|**--attach**[=]] [**-c**|**--cpu-shares**[=0] +[**-m**|**--memory**=*memory-limit*] +[**--cidfile**=*file*] [**-d**|**--detach**[=*false*]] [**--dns**=*IP-address*] +[**--name**=*name*] [**-u**|**--user**=*username*|*uid*] +[**--link**=*name*:*alias*] +[**-e**|**--env**=*environment*] [**--entrypoint**=*command*] +[**--expose**=*port*] [**-P**|**--publish-all**[=*false*]] +[**-p**|**--publish**=*port-mappping*] [**-h**|**--hostname**=*hostname*] +[**--rm**[=*false*]] [**--priviledged**[=*false*] +[**-i**|**--interactive**[=*false*] +[**-t**|**--tty**[=*false*]] [**--lxc-conf**=*options*] +[**-n**|**--networking**[=*true*]] +[**-v**|**--volume**=*volume*] [**--volumes-from**=*container-id*] +[**-w**|**--workdir**=*directory*] [**--sig-proxy**[=*true*]] +IMAGE [COMMAND] [ARG...] + +# DESCRIPTION + +Run a process in a new container. **docker run** starts a process with its own +file system, its own networking, and its own isolated process tree. The IMAGE +which starts the process may define defaults related to the process that will be +run in the container, the networking to expose, and more, but **docker run** +gives final control to the operator or administrator who starts the container +from the image. For that reason **docker run** has more options than any other +Docker command. + +If the IMAGE is not already loaded then **docker run** will pull the IMAGE, and +all image dependencies, from the repository in the same way running **docker +pull** IMAGE, before it starts the container from that image. + +# OPTIONS + +**-a**, **--attach**=*stdin*|*stdout*|*stderr* + Attach to stdin, stdout or stderr. In foreground mode (the default when +**-d** is not specified), **docker run** can start the process in the container +and attach the console to the process’s standard input, output, and standard +error. It can even pretend to be a TTY (this is what most commandline +executables expect) and pass along signals. The **-a** option can be set for +each of stdin, stdout, and stderr. + +**-c**, **--cpu-shares**=0 + CPU shares in relative weight. You can increase the priority of a container +with the -c option. By default, all containers run at the same priority and get +the same proportion of CPU cycles, but you can tell the kernel to give more +shares of CPU time to one or more containers when you start them via **docker +run**. + +**--cidfile**=*file* + Write the container ID to the file specified. + + +**-d**, **-detach**=*true*|*false* + Detached mode. This runs the container in the background. It outputs the new +container's ID and any error messages. At any time you can run **docker ps** in +the other shell to view a list of the running containers. You can reattach to a +detached container with **docker attach**. If you choose to run a container in +the detached mode, then you cannot use the **-rm** option. + + +**--dns**=*IP-address* + Set custom DNS servers. This option can be used to override the DNS +configuration passed to the container. Typically this is necessary when the +host DNS configuration is invalid for the container (eg. 127.0.0.1). When this +is the case the **-dns** flags is necessary for every run. + + +**-e**, **-env**=*environment* + Set environment variables. This option allows you to specify arbitrary +environment variables that are available for the process that will be launched +inside of the container. + + +**--entrypoint**=*command* + This option allows you to overwrite the default entrypoint of the image that +is set in the Dockerfile. The ENTRYPOINT of an image is similar to a COMMAND +because it specifies what executable to run when the container starts, but it is +(purposely) more difficult to override. The ENTRYPOINT gives a container its +default nature or behavior, so that when you set an ENTRYPOINT you can run the +container as if it were that binary, complete with default options, and you can +pass in more options via the COMMAND. But, sometimes an operator may want to run +something else inside the container, so you can override the default ENTRYPOINT +at runtime by using a **--entrypoint** and a string to specify the new +ENTRYPOINT. + +**--expose**=*port* + Expose a port from the container without publishing it to your host. A +containers port can be exposed to other containers in three ways: 1) The +developer can expose the port using the EXPOSE parameter of the Dockerfile, 2) +the operator can use the **--expose** option with **docker run**, or 3) the +container can be started with the **--link**. + +**-m**, **-memory**=*memory-limit* + Allows you to constrain the memory available to a container. If the host +supports swap memory, then the -m memory setting can be larger than physical +RAM. The memory limit format: , where unit = b, k, m or +g. + +**-P**, **-publish-all**=*true*|*false* + When set to true publish all exposed ports to the host interfaces. The +default is false. If the operator uses -P (or -p) then Docker will make the +exposed port accessible on the host and the ports will be available to any +client that can reach the host. To find the map between the host ports and the +exposed ports, use **docker port**. + + +**-p**, **-publish**=[] + Publish a container's port to the host (format: ip:hostPort:containerPort | +ip::containerPort | hostPort:containerPort) (use **docker port** to see the +actual mapping) + + +**-h**, **-hostname**=*hostname* + Sets the container host name that is available inside the container. + + +**-i**, **-interactive**=*true*|*false* + When set to true, keep stdin open even if not attached. The default is false. + + +**--link**=*name*:*alias* + Add link to another container. The format is name:alias. If the operator +uses **--link** when starting the new client container, then the client +container can access the exposed port via a private networking interface. Docker +will set some environment variables in the client container to help indicate +which interface and port to use. + + +**-n**, **-networking**=*true*|*false* + By default, all containers have networking enabled (true) and can make +outgoing connections. The operator can disable networking with **--networking** +to false. This disables all incoming and outgoing networking. In cases like this +, I/O can only be performed through files or by using STDIN/STDOUT. + +Also by default, the container will use the same DNS servers as the host. The +operator may override this with **-dns**. + + +**--name**=*name* + Assign a name to the container. The operator can identify a container in +three ways: + + UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”) + UUID short identifier (“f78375b1c487”) + Name (“jonah”) + +The UUID identifiers come from the Docker daemon, and if a name is not assigned +to the container with **--name** then the daemon will also generate a random +string name. The name is useful when defining links (see **--link**) (or any +other place you need to identify a container). This works for both background +and foreground Docker containers. + + +**--privileged**=*true*|*false* + Give extended privileges to this container. By default, Docker containers are +“unprivileged” (=false) and cannot, for example, run a Docker daemon inside the +Docker container. This is because by default a container is not allowed to +access any devices. A “privileged” container is given access to all devices. + +When the operator executes **docker run -privileged**, Docker will enable access +to all devices on the host as well as set some configuration in AppArmor to +allow the container nearly all the same access to the host as processes running +outside of a container on the host. + + +**--rm**=*true*|*false* + If set to *true* the container is automatically removed when it exits. The +default is *false*. This option is incompatible with **-d**. + + +**--sig-proxy**=*true*|*false* + When set to true, proxify all received signals to the process (even in +non-tty mode). The default is true. + + +**-t**, **-tty**=*true*|*false* + When set to true Docker can allocate a pseudo-tty and attach to the standard +input of any container. This can be used, for example, to run a throwaway +interactive shell. The default is value is false. + + +**-u**, **-user**=*username*,*uid* + Set a username or UID for the container. + + +**-v**, **-volume**=*volume* + Bind mount a volume to the container. The **-v** option can be used one or +more times to add one or more mounts to a container. These mounts can then be +used in other containers using the **--volumes-from** option. See examples. + + +**--volumes-from**=*container-id* + Will mount volumes from the specified container identified by container-id. +Once a volume is mounted in a one container it can be shared with other +containers using the **--volumes-from** option when running those other +containers. The volumes can be shared even if the original container with the +mount is not running. + + +**-w**, **-workdir**=*directory* + Working directory inside the container. The default working directory for +running binaries within a container is the root directory (/). The developer can +set a different default with the Dockerfile WORKDIR instruction. The operator +can override the working directory by using the **-w** option. + + +**IMAGE** + The image name or ID. + + +**COMMAND** + The command or program to run inside the image. + + +**ARG** + The arguments for the command to be run in the container. + +# EXAMPLES + +## Exposing log messages from the container to the host's log + +If you want messages that are logged in your container to show up in the host's +syslog/journal then you should bind mount the /var/log directory as follows. + + # docker run -v /dev/log:/dev/log -i -t fedora /bin/bash + +From inside the container you can test this by sending a message to the log. + + (bash)# logger "Hello from my container" + +Then exit and check the journal. + + # exit + + # journalctl -b | grep Hello + +This should list the message sent to logger. + +## Attaching to one or more from STDIN, STDOUT, STDERR + +If you do not specify -a then Docker will attach everything (stdin,stdout,stderr) +. You can specify to which of the three standard streams (stdin, stdout, stderr) +you’d like to connect instead, as in: + + # docker run -a stdin -a stdout -i -t fedora /bin/bash + +## Linking Containers + +The link feature allows multiple containers to communicate with each other. For +example, a container whose Dockerfile has exposed port 80 can be run and named +as follows: + + # docker run --name=link-test -d -i -t fedora/httpd + +A second container, in this case called linker, can communicate with the httpd +container, named link-test, by running with the **--link=:** + + # docker run -t -i --link=link-test:lt --name=linker fedora /bin/bash + +Now the container linker is linked to container link-test with the alias lt. +Running the **env** command in the linker container shows environment variables + with the LT (alias) context (**LT_**) + + # env + HOSTNAME=668231cb0978 + TERM=xterm + LT_PORT_80_TCP=tcp://172.17.0.3:80 + LT_PORT_80_TCP_PORT=80 + LT_PORT_80_TCP_PROTO=tcp + LT_PORT=tcp://172.17.0.3:80 + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + PWD=/ + LT_NAME=/linker/lt + SHLVL=1 + HOME=/ + LT_PORT_80_TCP_ADDR=172.17.0.3 + _=/usr/bin/env + +When linking two containers Docker will use the exposed ports of the container +to create a secure tunnel for the parent to access. + + +## Mapping Ports for External Usage + +The exposed port of an application can be mapped to a host port using the **-p** +flag. For example a httpd port 80 can be mapped to the host port 8080 using the +following: + + # docker run -p 8080:80 -d -i -t fedora/httpd + +## Creating and Mounting a Data Volume Container + +Many applications require the sharing of persistent data across several +containers. Docker allows you to create a Data Volume Container that other +containers can mount from. For example, create a named container that contains +directories /var/volume1 and /tmp/volume2. The image will need to contain these +directories so a couple of RUN mkdir instructions might be required for you +fedora-data image: + + # docker run --name=data -v /var/volume1 -v /tmp/volume2 -i -t fedora-data true + # docker run --volumes-from=data --name=fedora-container1 -i -t fedora bash + +Multiple -volumes-from parameters will bring together multiple data volumes from +multiple containers. And it's possible to mount the volumes that came from the +DATA container in yet another container via the fedora-container1 intermidiery +container, allowing to abstract the actual data source from users of that data: + + # docker run --volumes-from=fedora-container1 --name=fedora-container2 -i -t fedora bash + +## Mounting External Volumes + +To mount a host directory as a container volume, specify the absolute path to +the directory and the absolute path for the container directory separated by a +colon: + + # docker run -v /var/db:/data1 -i -t fedora bash + +When using SELinux, be aware that the host has no knowledge of container SELinux +policy. Therefore, in the above example, if SELinux policy is enforced, the +`/var/db` directory is not writable to the container. A "Permission Denied" +message will occur and an avc: message in the host's syslog. + + +To work around this, at time of writing this man page, the following command +needs to be run in order for the proper SELinux policy type label to be attached +to the host directory: + + # chcon -Rt svirt_sandbox_file_t /var/db + + +Now, writing to the /data1 volume in the container will be allowed and the +changes will also be reflected on the host in /var/db. + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-save.md b/contrib/man/md/docker-save.md new file mode 100644 index 0000000000..126af6b154 --- /dev/null +++ b/contrib/man/md/docker-save.md @@ -0,0 +1,35 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-save - Save an image to a tar archive (streamed to STDOUT by default) + +# SYNOPSIS +**docker save** [**-o**|**--output**=""] IMAGE + +# DESCRIPTION +Produces a tarred repository to the standard output stream. Contains all +parent layers, and all tags + versions, or specified repo:tag. + +Stream to a file instead of STDOUT by using **-o**. + +# OPTIONS +**-o**, **--output**="" + Write to an file, instead of STDOUT + +# EXAMPLE + +Save all fedora repository images to a fedora-all.tar and save the latest +fedora image to a fedora-latest.tar: + + $ sudo docker save fedora > fedora-all.tar + $ sudo docker save --output=fedora-latest.tar fedora:latest + $ ls -sh fedora-all.tar + 721M fedora-all.tar + $ ls -sh fedora-latest.tar + 367M fedora-latest.tar + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. + diff --git a/contrib/man/md/docker-search.md b/contrib/man/md/docker-search.md new file mode 100644 index 0000000000..fb2c921f8a --- /dev/null +++ b/contrib/man/md/docker-search.md @@ -0,0 +1,55 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-search - Search the docker index for images + +# SYNOPSIS +**docker search** **--no-trunc**[=*false*] **-t**|**--trusted**[=*false*] + **-s**|**--stars**[=*0*] TERM + +# DESCRIPTION + +Search an index for an image with that matches the term TERM. The table +of images returned displays the name, description (truncated by default), +number of stars awarded, whether the image is official, and whether it +is trusted. + +# OPTIONS +**--no-trunc**=*true*|*false* + When true display the complete description. The default is false. + +**-s**, **--stars**=NUM + Only displays with at least NUM (integer) stars. I.e. only those images +ranked >=NUM. + +**-t**, **--trusted**=*true*|*false* + When true only show trusted builds. The default is false. + +# EXAMPLE + +## Search the registry for ranked images + +Search the registry for the term 'fedora' and only display those images +ranked 3 or higher: + + $ sudo docker search -s 3 fedora + NAME DESCRIPTION STARS OFFICIAL TRUSTED + mattdm/fedora A basic Fedora image corresponding roughly... 50 + fedora (Semi) Official Fedora base image. 38 + mattdm/fedora-small A small Fedora image on which to build. Co... 8 + goldmann/wildfly A WildFly application server running on a ... 3 [OK] + +## Search the registry for trusted images + +Search the registry for the term 'fedora' and only display trusted images +ranked 1 or higher: + + $ sudo docker search -s 1 -t fedora + NAME DESCRIPTION STARS OFFICIAL TRUSTED + goldmann/wildfly A WildFly application server running on a ... 3 [OK] + tutum/fedora-20 Fedora 20 image with SSH access. For the r... 1 [OK] + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-start.md b/contrib/man/md/docker-start.md new file mode 100644 index 0000000000..9e639bbb5e --- /dev/null +++ b/contrib/man/md/docker-start.md @@ -0,0 +1,25 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-start - Restart a stopped container + +# SYNOPSIS +**docker start** [**a**|**--attach**[=*false*]] [**-i**|**--interactive** +[=*true*] CONTAINER [CONTAINER...] + +# DESCRIPTION + +Start a stopped container. + +# OPTION +**-a**, **--attach**=*true*|*false* + When true attach to container's stdout/stderr and forward all signals to +the process + +**-i**, **--interactive**=*true*|*false* + When true attach to container's stdin + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-stop.md b/contrib/man/md/docker-stop.md new file mode 100644 index 0000000000..6ec81cd472 --- /dev/null +++ b/contrib/man/md/docker-stop.md @@ -0,0 +1,22 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-stop - Stop a running container + grace period) + +# SYNOPSIS +**docker stop** [**-t**|**--time**[=*10*]] CONTAINER [CONTAINER...] + +# DESCRIPTION +Stop a running container (Send SIGTERM, and then SIGKILL after + grace period) + +# OPTIONS +**-t**, **--time**=NUM + Wait NUM number of seconds for the container to stop before killing it. +The default is 10 seconds. + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-tag.md b/contrib/man/md/docker-tag.md new file mode 100644 index 0000000000..49f5a6c4d1 --- /dev/null +++ b/contrib/man/md/docker-tag.md @@ -0,0 +1,48 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-tag - Tag an image in the repository + +# SYNOPSIS +**docker tag** [**-f**|**--force**[=*false*] +IMAGE [REGISTRYHOST/][USERNAME/]NAME[:TAG] + +# DESCRIPTION +This will tag an image in the repository. + +# "OPTIONS" +**-f**, **--force**=*true*|*false* + When set to true, force the tag name. The default is *false*. + +**REGISTRYHOST** + The hostname of the registry if required. This may also include the port +separated by a ':' + +**USERNAME** + The username or other qualifying identifier for the image. + +**NAME** + The image name. + +**TAG** + The tag you are assigning to the image. + +# EXAMPLES + +## Tagging an image + +Here is an example of tagging an image with the tag version1.0 : + + docker tag 0e5574283393 fedora/httpd:version1.0 + +## Tagging an image for a private repository + +To push an image to an private registry and not the central Docker +registry you must tag it with the registry hostname and port (if needed). + + docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0 + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. diff --git a/contrib/man/md/docker-top.md b/contrib/man/md/docker-top.md new file mode 100644 index 0000000000..2c00c527a5 --- /dev/null +++ b/contrib/man/md/docker-top.md @@ -0,0 +1,27 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-top - Lookup the running processes of a container + +# SYNOPSIS +**docker top** CONTAINER [ps-OPTION] + +# DESCRIPTION + +Look up the running process of the container. ps-OPTION can be any of the + options you would pass to a Linux ps command. + +# EXAMPLE + +Run **docker top** with the ps option of -x: + + $ sudo docker top 8601afda2b -x + PID TTY STAT TIME COMMAND + 16623 ? Ss 0:00 sleep 99999 + + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. + diff --git a/contrib/man/md/docker-wait.md b/contrib/man/md/docker-wait.md new file mode 100644 index 0000000000..6754151f09 --- /dev/null +++ b/contrib/man/md/docker-wait.md @@ -0,0 +1,23 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker-wait - Block until a container stops, then print its exit code. + +# SYNOPSIS +**docker wait** CONTAINER [CONTAINER...] + +# DESCRIPTION +Block until a container stops, then print its exit code. + +#EXAMPLE + + $ sudo docker run -d fedora sleep 99 + 079b83f558a2bc52ecad6b2a5de13622d584e6bb1aea058c11b36511e85e7622 + $ sudo docker wait 079b83f558a2bc + 0 + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) +based on docker.io source material and internal work. + diff --git a/contrib/man/md/docker.md b/contrib/man/md/docker.md new file mode 100644 index 0000000000..02c541262b --- /dev/null +++ b/contrib/man/md/docker.md @@ -0,0 +1,184 @@ +% DOCKER(1) Docker User Manuals +% William Henry +% APRIL 2014 +# NAME +docker \- Docker image and container command line interface + +# SYNOPSIS +**docker** [OPTIONS] COMMAND [arg...] + +# DESCRIPTION +**docker** has two distinct functions. It is used for starting the Docker +daemon and to run the CLI (i.e., to command the daemon to manage images, +containers etc.) So **docker** is both a server, as a deamon, and a client +to the daemon, through the CLI. + +To run the Docker deamon you do not specify any of the commands listed below but +must specify the **-d** option. The other options listed below are for the +daemon only. + +The Docker CLI has over 30 commands. The commands are listed below and each has +its own man page which explain usage and arguements. + +To see the man page for a command run **man docker **. + +# OPTIONS +**-D**=*ture*|*false* + Enable debug mode. Default is false. + +**-H**, **--host**=[unix:///var/run/docker.sock]: tcp://[host[:port]] to bind or +unix://[/path/to/socket] to use. + Enable both the socket support and TCP on localhost. When host=[0.0.0.0], +port=[4243] or path =[/var/run/docker.sock] is omitted, default values are used. + +**--api-enable-cors**=*true*|*false* + Enable CORS headers in the remote API. Default is false. + +**-b**="" + Attach containers to a pre\-existing network bridge; use 'none' to disable container networking + +**--bip**="" + Use the provided CIDR notation address for the dynamically created bridge (docker0); Mutually exclusive of \-b + +**-d**=*true*|*false* + Enable daemon mode. Default is false. + +**--dns**="" + Force Docker to use specific DNS servers + +**-g**="" + Path to use as the root of the Docker runtime. Default is `/var/lib/docker`. + +**--icc**=*true*|*false* + Enable inter\-container communication. Default is true. + +**--ip**="" + Default IP address to use when binding container ports. Default is `0.0.0.0`. + +**--iptables**=*true*|*false* + Disable Docker's addition of iptables rules. Default is true. + +**--mtu**=VALUE + Set the containers network mtu. Default is `1500`. + +**-p**="" + Path to use for daemon PID file. Default is `/var/run/docker.pid` + +**-r**=*true*|*false* + Restart previously running containers. Default is true. + +**-s**="" + Force the Docker runtime to use a specific storage driver. + +**-v**=*true*|*false* + Print version information and quit. Default is false. + +# COMMANDS +**docker-attach(1)** + Attach to a running container + +**docker-build(1)** + Build a container from a Dockerfile + +**docker-commit(1)** + Create a new image from a container's changes + +**docker-cp(1)** + Copy files/folders from the containers filesystem to the host at path + +**docker-diff(1)** + Inspect changes on a container's filesystem + + +**docker-events(1)** + Get real time events from the server + +**docker-export(1)** + Stream the contents of a container as a tar archive + +**docker-history(1)** + Show the history of an image + +**docker-images(1)** + List images + +**docker-import(1)** + Create a new filesystem image from the contents of a tarball + +**docker-info(1)** + Display system-wide information + +**docker-inspect(1)** + Return low-level information on a container + +**docker-kill(1)** + Kill a running container (which includes the wrapper process and everything +inside it) + +**docker-load(1)** + Load an image from a tar archive + +**docker-login(1)** + Register or Login to a Docker registry server + +**docker-logs(1)** + Fetch the logs of a container + +**docker-port(1)** + Lookup the public-facing port which is NAT-ed to PRIVATE_PORT + +**docker-ps(1)** + List containers + +**docker-pull(1)** + Pull an image or a repository from a Docker registry server + +**docker-push(1)** + Push an image or a repository to a Docker registry server + +**docker-restart(1)** + Restart a running container + +**docker-rm(1)** + Remove one or more containers + +**docker-rmi(1)** + Remove one or more images + +**docker-run(1)** + Run a command in a new container + +**docker-save(1)** + Save an image to a tar archive + +**docker-search(1)** + Search for an image in the Docker index + +**docker-start(1)** + Start a stopped container + +**docker-stop(1)** + Stop a running container + +**docker-tag(1)** + Tag an image into a repository + +**docker-top(1)** + Lookup the running processes of a container + +**version** + Show the Docker version information + +**docker-wait(1)** + Block until a container stops, then print its exit code + +# EXAMPLES + +For specific examples please see the man page for the specific Docker command. +For example: + + man docker run + +# HISTORY +April 2014, Originally compiled by William Henry (whenry at redhat dot com) based + on docker.io source material and internal work. diff --git a/contrib/man/md/md2man-all.sh b/contrib/man/md/md2man-all.sh new file mode 100755 index 0000000000..e482da647a --- /dev/null +++ b/contrib/man/md/md2man-all.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e + +# get into this script's directory +cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" + +[ "$1" = '-q' ] || { + set -x + pwd +} + +mkdir -p ../man1 + +for FILE in docker*.md; do + pandoc -s -t man "$FILE" -o "../man1/${FILE%.*}.1" +done diff --git a/contrib/man/man1/docker-attach.1 b/contrib/man/old-man/docker-attach.1 similarity index 96% rename from contrib/man/man1/docker-attach.1 rename to contrib/man/old-man/docker-attach.1 index 94198933e3..f0879d7507 100644 --- a/contrib/man/man1/docker-attach.1 +++ b/contrib/man/old-man/docker-attach.1 @@ -15,10 +15,10 @@ If you \fBdocker run\fR a container in detached mode (\fB-d\fR), you can reattac You can detach from the container again (and leave it running) with CTRL-c (for a quiet exit) or CTRL-\ to get a stacktrace of the Docker client when it quits. When you detach from the container the exit code will be returned to the client. .SH "OPTIONS" .TP -.B --no-stdin=\fItrue\fR|\fIfalse\fR +.B --no-stdin=\fItrue\fR|\fIfalse\fR: When set to true, do not attach to stdin. The default is \fIfalse\fR. .TP -.B --sig-proxy=\fItrue\fR|\fIfalse\fR +.B --sig-proxy=\fItrue\fR|\fIfalse\fR: When set to true, proxify all received signal to the process (even in non-tty mode). The default is \fItrue\fR. .sp .SH EXAMPLES diff --git a/contrib/man/man1/docker-build.1 b/contrib/man/old-man/docker-build.1 similarity index 96% rename from contrib/man/man1/docker-build.1 rename to contrib/man/old-man/docker-build.1 index 6d0a4c2e38..6546b7be2a 100644 --- a/contrib/man/man1/docker-build.1 +++ b/contrib/man/old-man/docker-build.1 @@ -19,13 +19,13 @@ If the absolute path is provided instead of ‘.’, only the files and director When a single Dockerfile is given as URL, then no context is set. When a Git repository is set as URL, the repository is used as context. .SH "OPTIONS" .TP -.B -q, --quiet=\fItrue\fR|\fIfalse\fR +.B -q, --quiet=\fItrue\fR|\fIfalse\fR: When set to true, suppress verbose build output. Default is \fIfalse\fR. .TP -.B --rm=\fItrue\fr|\fIfalse\fR +.B --rm=\fItrue\fr|\fIfalse\fR: When true, remove intermediate containers that are created during the build process. The default is true. .TP -.B -t, --tag=\fItag\fR +.B -t, --tag=\fItag\fR: Tag to be applied to the resulting image on successful completion of the build. .TP .B --no-cache=\fItrue\fR|\fIfalse\fR diff --git a/contrib/man/man1/docker-images.1 b/contrib/man/old-man/docker-images.1 similarity index 95% rename from contrib/man/man1/docker-images.1 rename to contrib/man/old-man/docker-images.1 index d88e2446c8..e540ba2b79 100644 --- a/contrib/man/man1/docker-images.1 +++ b/contrib/man/old-man/docker-images.1 @@ -20,16 +20,16 @@ By default, intermediate images, used during builds, are not listed. Some of the The title REPOSITORY for the first title may seem confusing. It is essentially the image name. However, because you can tag a specific image, and multiple tags (image instances) can be associated with a single name, the name is really a repository for all tagged images of the same name. .SH "OPTIONS" .TP -.B -a, --all=\fItrue\fR|\fIfalse\fR +.B -a, --all=\fItrue\fR|\fIfalse\fR: When set to true, also include all intermediate images in the list. The default is false. .TP -.B --no-trunc=\fItrue\fR|\fIfalse\fR +.B --no-trunc=\fItrue\fR|\fIfalse\fR: When set to true, list the full image ID and not the truncated ID. The default is false. .TP -.B -q, --quiet=\fItrue\fR|\fIfalse\fR +.B -q, --quiet=\fItrue\fR|\fIfalse\fR: When set to true, list the complete image ID as part of the output. The default is false. .TP -.B -t, --tree=\fItrue\fR|\fIfalse\fR +.B -t, --tree=\fItrue\fR|\fIfalse\fR: When set to true, list the images in a tree dependency tree (hierarchy) format. The default is false. .TP .B -v, --viz=\fItrue\fR|\fIfalse\fR diff --git a/contrib/man/man1/docker-info.1 b/contrib/man/old-man/docker-info.1 similarity index 100% rename from contrib/man/man1/docker-info.1 rename to contrib/man/old-man/docker-info.1 diff --git a/contrib/man/man1/docker-inspect.1 b/contrib/man/old-man/docker-inspect.1 similarity index 99% rename from contrib/man/man1/docker-inspect.1 rename to contrib/man/old-man/docker-inspect.1 index 3d1e18ba53..225125e564 100644 --- a/contrib/man/man1/docker-inspect.1 +++ b/contrib/man/old-man/docker-inspect.1 @@ -12,7 +12,7 @@ CONTAINER|IMAGE [CONTAINER|IMAGE...] This displays all the information available in Docker for a given container or image. 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. .SH "OPTIONS" .TP -.B -f, --format="" +.B -f, --format="": The text/template package of Go describes all the details of the format. See examples section .SH EXAMPLES .sp diff --git a/contrib/man/man1/docker-rm.1 b/contrib/man/old-man/docker-rm.1 similarity index 92% rename from contrib/man/man1/docker-rm.1 rename to contrib/man/old-man/docker-rm.1 index 4ec84571bb..b06e014d3b 100644 --- a/contrib/man/man1/docker-rm.1 +++ b/contrib/man/old-man/docker-rm.1 @@ -14,13 +14,13 @@ CONTAINER [CONTAINER...] This will remove one or more containers from the host node. The container name or ID can be used. This does not remove images. You cannot remove a running container unless you use the \fB-f\fR option. To see all containers on a host use the \fBdocker ps -a\fR command. .SH "OPTIONS" .TP -.B -f, --force=\fItrue\fR|\fIfalse\fR +.B -f, --force=\fItrue\fR|\fIfalse\fR: When set to true, force the removal of the container. The default is \fIfalse\fR. .TP -.B -l, --link=\fItrue\fR|\fIfalse\fR +.B -l, --link=\fItrue\fR|\fIfalse\fR: When set to true, remove the specified link and not the underlying container. The default is \fIfalse\fR. .TP -.B -v, --volumes=\fItrue\fR|\fIfalse\fR +.B -v, --volumes=\fItrue\fR|\fIfalse\fR: When set to true, remove the volumes associated to the container. The default is \fIfalse\fR. .SH EXAMPLES .sp diff --git a/contrib/man/old-man/docker-rm.md b/contrib/man/old-man/docker-rm.md new file mode 100644 index 0000000000..a53aa77c98 --- /dev/null +++ b/contrib/man/old-man/docker-rm.md @@ -0,0 +1,50 @@ +DOCKER "1" "APRIL 2014" "0.1" "Docker" +======================================= + +NAME +---- + +docker-rm - Remove one or more containers. + +SYNOPSIS +-------- + +`docker rm` [`-f`|`--force`[=*false*] [`-l`|`--link`[=*false*] [`-v`|`--volumes`[=*false*] +CONTAINER [CONTAINER...] + +DESCRIPTION +----------- + +`docker rm` will remove one or more containers from the host node. The container name or ID can be used. This does not remove images. You cannot remove a running container unless you use the \fB-f\fR option. To see all containers on a host use the `docker ps -a` command. + +OPTIONS +------- + +`-f`, `--force`=*true*|*false*: + When set to true, force the removal of the container. The default is *false*. + +`-l`, `--link`=*true*|*false*: + When set to true, remove the specified link and not the underlying container. The default is *false*. + +`-v`, `--volumes`=*true*|*false*: + When set to true, remove the volumes associated to the container. The default is *false*. + +EXAMPLES +-------- + +##Removing a container using its ID## + +To remove a container using its ID, find either from a `docker ps -a` command, or use the ID returned from the `docker run` command, or retrieve it from a file used to store it using the `docker run --cidfile`: + + docker rm abebf7571666 + +##Removing a container using the container name## + +The name of the container can be found using the \fBdocker ps -a\fR command. The use that name as follows: + + docker rm hopeful_morse + +HISTORY +------- + +April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. diff --git a/contrib/man/man1/docker-rmi.1 b/contrib/man/old-man/docker-rmi.1 similarity index 95% rename from contrib/man/man1/docker-rmi.1 rename to contrib/man/old-man/docker-rmi.1 index a4b5c05e7f..6f33446ecd 100644 --- a/contrib/man/man1/docker-rmi.1 +++ b/contrib/man/old-man/docker-rmi.1 @@ -12,7 +12,7 @@ IMAGE [IMAGE...] This will remove one or more images from the host node. This does not remove images from a registry. You cannot remove an image of a running container unless you use the \fB-f\fR option. To see all images on a host use the \fBdocker images\fR command. .SH "OPTIONS" .TP -.B -f, --force=\fItrue\fR|\fIfalse\fR +.B -f, --force=\fItrue\fR|\fIfalse\fR: When set to true, force the removal of the image. The default is \fIfalse\fR. .SH EXAMPLES .sp diff --git a/contrib/man/man1/docker-run.1 b/contrib/man/old-man/docker-run.1 similarity index 94% rename from contrib/man/man1/docker-run.1 rename to contrib/man/old-man/docker-run.1 index ba191e1b40..fd449374e3 100644 --- a/contrib/man/man1/docker-run.1 +++ b/contrib/man/old-man/docker-run.1 @@ -30,69 +30,69 @@ If the \fIIMAGE\fR is not already loaded then \fBdocker run\fR will pull the \fI .SH "OPTIONS" .TP -.B -a, --attach=\fIstdin\fR|\fIstdout\fR|\fIstderr\fR +.B -a, --attach=\fIstdin\fR|\fIstdout\fR|\fIstderr\fR: Attach to stdin, stdout or stderr. In foreground mode (the default when -d is not specified), \fBdocker run\fR can start the process in the container and attach the console to the process’s standard input, output, and standard error. It can even pretend to be a TTY (this is what most commandline executables expect) and pass along signals. The \fB-a\fR option can be set for each of stdin, stdout, and stderr. .TP -.B -c, --cpu-shares=0 +.B -c, --cpu-shares=0: CPU shares in relative weight. You can increase the priority of a container with the -c option. By default, all containers run at the same priority and get the same proportion of CPU cycles, but you can tell the kernel to give more shares of CPU time to one or more containers when you start them via \fBdocker run\fR. .TP -.B -m, --memory=\fImemory-limit\fR +.B -m, --memory=\fImemory-limit\fR: Allows you to constrain the memory available to a container. If the host supports swap memory, then the -m memory setting can be larger than physical RAM. The memory limit format: , where unit = b, k, m or g. .TP -.B --cidfile=\fIfile\fR +.B --cidfile=\fIfile\fR: Write the container ID to the file specified. .TP -.B -d, --detach=\fItrue\fR|\fIfalse\fR +.B -d, --detach=\fItrue\fR|\fIfalse\fR: Detached mode. This runs the container in the background. It outputs the new container's id and and error messages. At any time you can run \fBdocker ps\fR in the other shell to view a list of the running containers. You can reattach to a detached container with \fBdocker attach\fR. If you choose to run a container in the detached mode, then you cannot use the -rm option. .TP -.B --dns=\fIIP-address\fR +.B --dns=\fIIP-address\fR: Set custom DNS servers. This option can be used to override the DNS configuration passed to the container. Typically this is necessary when the host DNS configuration is invalid for the container (eg. 127.0.0.1). When this is the case the \fB-dns\fR flags is necessary for every run. .TP -.B -e, --env=\fIenvironment\fR +.B -e, --env=\fIenvironment\fR: Set environment variables. This option allows you to specify arbitrary environment variables that are available for the process that will be launched inside of the container. .TP -.B --entrypoint=\ficommand\fR +.B --entrypoint=\ficommand\fR: This option allows you to overwrite the default entrypoint of the image that is set in the Dockerfile. The ENTRYPOINT of an image is similar to a COMMAND because it specifies what executable to run when the container starts, but it is (purposely) more difficult to override. The ENTRYPOINT gives a container its default nature or behavior, so that when you set an ENTRYPOINT you can run the container as if it were that binary, complete with default options, and you can pass in more options via the COMMAND. But, sometimes an operator may want to run something else inside the container, so you can override the default ENTRYPOINT at runtime by using a \fB--entrypoint\fR and a string to specify the new ENTRYPOINT. .TP -.B --expose=\fIport\fR +.B --expose=\fIport\fR: Expose a port from the container without publishing it to your host. A containers port can be exposed to other containers in three ways: 1) The developer can expose the port using the EXPOSE parameter of the Dockerfile, 2) the operator can use the \fB--expose\fR option with \fBdocker run\fR, or 3) the container can be started with the \fB--link\fR. .TP -.B -P, --publish-all=\fItrue\fR|\fIfalse\fR +.B -P, --publish-all=\fItrue\fR|\fIfalse\fR: When set to true publish all exposed ports to the host interfaces. The default is false. If the operator uses -P (or -p) then Docker will make the exposed port accessible on the host and the ports will be available to any client that can reach the host. To find the map between the host ports and the exposed ports, use \fBdocker port\fR. .TP -.B -p, --publish=[] +.B -p, --publish=[]: Publish a container's port to the host (format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort) (use 'docker port' to see the actual mapping) .TP -.B -h , --hostname=\fIhostname\fR +.B -h , --hostname=\fIhostname\fR: Sets the container host name that is available inside the container. .TP -.B -i , --interactive=\fItrue\fR|\fIfalse\fR +.B -i , --interactive=\fItrue\fR|\fIfalse\fR: When set to true, keep stdin open even if not attached. The default is false. .TP -.B --link=\fIname\fR:\fIalias\fR +.B --link=\fIname\fR:\fIalias\fR: Add link to another container. The format is name:alias. If the operator uses \fB--link\fR when starting the new client container, then the client container can access the exposed port via a private networking interface. Docker will set some environment variables in the client container to help indicate which interface and port to use. .TP -.B -n, --networking=\fItrue\fR|\fIfalse\fR +.B -n, --networking=\fItrue\fR|\fIfalse\fR: By default, all containers have networking enabled (true) and can make outgoing connections. The operator can disable networking with \fB--networking\fR to false. This disables all incoming and outgoing networking. In cases like this, I/O can only be performed through files or by using STDIN/STDOUT. Also by default, the container will use the same DNS servers as the host. but you canThe operator may override this with \fB-dns\fR. .TP -.B --name=\fIname\fR +.B --name=\fIname\fR: Assign a name to the container. The operator can identify a container in three ways: .sp .nf @@ -104,37 +104,37 @@ Name (“jonah”) The UUID identifiers come from the Docker daemon, and if a name is not assigned to the container with \fB--name\fR then the daemon will also generate a random string name. The name is useful when defining links (see \fB--link\fR) (or any other place you need to identify a container). This works for both background and foreground Docker containers. .TP -.B --privileged=\fItrue\fR|\fIfalse\fR +.B --privileged=\fItrue\fR|\fIfalse\fR: Give extended privileges to this container. By default, Docker containers are “unprivileged” (=false) and cannot, for example, run a Docker daemon inside the Docker container. This is because by default a container is not allowed to access any devices. A “privileged” container is given access to all devices. When the operator executes \fBdocker run -privileged\fR, Docker will enable access to all devices on the host as well as set some configuration in AppArmor (\fB???\fR) to allow the container nearly all the same access to the host as processes running outside of a container on the host. .TP -.B --rm=\fItrue\fR|\fIfalse\fR +.B --rm=\fItrue\fR|\fIfalse\fR: If set to \fItrue\fR the container is automatically removed when it exits. The default is \fIfalse\fR. This option is incompatible with \fB-d\fR. .TP -.B --sig-proxy=\fItrue\fR|\fIfalse\fR +.B --sig-proxy=\fItrue\fR|\fIfalse\fR: When set to true, proxify all received signals to the process (even in non-tty mode). The default is true. .TP -.B -t, --tty=\fItrue\fR|\fIfalse\fR +.B -t, --tty=\fItrue\fR|\fIfalse\fR: When set to true Docker can allocate a pseudo-tty and attach to the standard input of any container. This can be used, for example, to run a throwaway interactive shell. The default is value is false. .TP -.B -u, --user=\fIusername\fR,\fRuid\fR +.B -u, --user=\fIusername\fR,\fRuid\fR: Set a username or UID for the container. .TP -.B -v, --volume=\fIvolume\fR +.B -v, --volume=\fIvolume\fR: Bind mount a volume to the container. The \fB-v\fR option can be used one or more times to add one or more mounts to a container. These mounts can then be used in other containers using the \fB--volumes-from\fR option. See examples. .TP -.B --volumes-from=\fIcontainer-id\fR +.B --volumes-from=\fIcontainer-id\fR: Will mount volumes from the specified container identified by container-id. Once a volume is mounted in a one container it can be shared with other containers using the \fB--volumes-from\fR option when running those other containers. The volumes can be shared even if the original container with the mount is not running. .TP -.B -w, --workdir=\fIdirectory\fR +.B -w, --workdir=\fIdirectory\fR: Working directory inside the container. The default working directory for running binaries within a container is the root directory (/). The developer can set a different default with the Dockerfile WORKDIR instruction. The operator can override the working directory by using the \fB-w\fR option. .TP diff --git a/contrib/man/man1/docker-tag.1 b/contrib/man/old-man/docker-tag.1 similarity index 97% rename from contrib/man/man1/docker-tag.1 rename to contrib/man/old-man/docker-tag.1 index eaff32cebd..df85a1e8c1 100644 --- a/contrib/man/man1/docker-tag.1 +++ b/contrib/man/old-man/docker-tag.1 @@ -12,7 +12,7 @@ docker-tag \- Tag an image in the repository This will tag an image in the repository. .SH "OPTIONS" .TP -.B -f, --force=\fItrue\fR|\fIfalse\fR +.B -f, --force=\fItrue\fR|\fIfalse\fR: When set to true, force the tag name. The default is \fIfalse\fR. .TP .B REGISTRYHOST: diff --git a/contrib/man/man1/docker.1 b/contrib/man/old-man/docker.1 similarity index 100% rename from contrib/man/man1/docker.1 rename to contrib/man/old-man/docker.1 diff --git a/hack/make/ubuntu b/hack/make/ubuntu index d7a4b16473..ae0f8d6137 100644 --- a/hack/make/ubuntu +++ b/hack/make/ubuntu @@ -47,6 +47,7 @@ bundle_ubuntu() { cp contrib/completion/fish/docker.fish $DIR/etc/fish/completions/ # Include contributed man pages + contrib/man/md/md2man-all.sh -q manRoot="$DIR/usr/share/man" mkdir -p "$manRoot" for manDir in contrib/man/man*; do