Edits based on ostezer's feedback.

Docker-DCO-1.1-Signed-off-by: William Henry <whenry@redhat.com> (github: ipbabble)
This commit is contained in:
William Henry 2014-04-17 09:36:58 -06:00 коммит произвёл Erik Hollensbe
Родитель e55ed741c2
Коммит 1b2b783b52
30 изменённых файлов: 310 добавлений и 272 удалений

Просмотреть файл

@ -1,8 +1,9 @@
Docker Documentation
====================
This directory contains the docker user manual in Markdown format.
DO NOT edit the man pages in the man1 directory. Instead make changes here.
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
@ -41,32 +42,34 @@ DO NOT edit the man pages in the man1 directory. Instead make changes here.
Dockerfile
md2man-all.sh
# Generating man pages from the Markdown
# Generating man pages from the Markdown files
There are three ways to generate the man pages:
* Manually Individually
* Using the Script
* Using a the Pandoc Container (**Recommended**)
* Each page manually
* All pages manually
* Via a *Pandoc* Docker container (**Recommended**)
The first and second approach require you to install pandoc packages
on your host using the host operating systems package installer. Check
to see if pandoc is available if you choose that method.
The first and second approach require you to install the Pandoc package
on your computer using the default package installer for the system.
You should check if Pandoc is available before trying to do so.
The Pandoc container approach is recommneded because the conversion process
is isolated inside a fedora container and thereofre does not require you
find and install pandoc on your host.
The recommended approach is the Pandoc Docker container one.
Using the supplied Dockerfile, Docker creates a Fedora based container
and isolates the Pandoc installation.
This is a seamless process, saving you from dealing with Pandoc and
dependencies on your own computer.
## Manually Individually
## Each page manually
You can generate the manpage by:
You can generate the man pages with:
pandoc -s -t man docker-<command>.md ../man1/docker-<command>.1
The resulting man pages are stored in ../man1
The results will be stored ../man1
## Manually All
## All pages manually
Or regenerate all the manpages from this source using:
You can generate *all* the man pages from the source using:
for FILE in *.md
do
@ -77,14 +80,16 @@ Or regenerate all the manpages from this source using:
There is a Dockerfile provided in the `docker/contrib/man/md` directory.
Use this Dockerfile to create a `fedora/pandoc` container:
Using this Dockerfile, create a Docker image tagged `fedora/pandoc`.
# docker build -t fedora/pandoc .
docker build -t fedora/pandoc .
After the container is created run the following command from your
`docker/contrib/man/md` directory:
Once the image is built, create a container inside the
`docker/contrib/man/md` directory using the it:
# docker run -v /<path-to-git-dir>/docker/contrib/man:/pandoc:rw \
docker run -v /<path-to-git-dir>/docker/contrib/man:/pandoc:rw \
-w /pandoc -i fedora/pandoc /pandoc/md/md2man-all.sh
This will generate all man files into `docker/contrib/man/man1`.
The Pandoc Docker container will process the Markdown files and generate
the man pages inside the `docker/contrib/man/man1` directory using
Docker volumes.

Просмотреть файл

@ -12,8 +12,8 @@ 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
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
@ -26,7 +26,7 @@ mode). The default is *true*.
# EXAMPLES
##Attaching to a container
## 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
@ -53,4 +53,5 @@ attach** 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.
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

Просмотреть файл

@ -9,64 +9,75 @@ docker-build - Build a container image from a Dockerfile source at PATH
[**-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 if the current directory contains a lot of data.
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.
If the absolute path is provided instead of ., only the files and directories
required by the **ADD** command from the Dockerfile will be added to the context
and transferred to the Docker daemon.
Warning, this will send a lot of data to the Docker daemon depending
on the contents of the current directory.
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.
If the absolute path is provided instead of ., only the files and
directories required by the **ADD** command from the Dockerfile will
be added to the context and transferred to the Docker 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*.
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.
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.
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*.
When set to true, do not use a cache when building the image. The
default is *false*.
# EXAMPLES
## Building an image from current directory
## Building an image using a Dockefile located inside the current directory
Using a Dockerfile, Docker images are built using the build command:
Docker images can be built using the build command and a Dockerfile:
docker build .
If, for some reason, you do not what to remove the intermediate containers created during the build you must set --rm=false:
During the build process Docker creates intermediate images. In order to
remove 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. E.g. a directory called mongo may contain a
Dockerfile for a MongoDB image, or a directory called httpd may contain a
Dockerfile for an Apache web server.
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 good practice to add the files required for the image to the
sub-directory. These files will be then specified with the `ADD` instruction in
the Dockerfile. Note: if you include a tar file, which is good practice, then
Docker will automatically extract the contents of the tar file specified in the
`ADD` instruction into the specified target.
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 Github repository 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.
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 that you can specify an arbitrary Git repository by using the `git://`
schema.
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.
March 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

Просмотреть файл

@ -3,11 +3,11 @@
% APRIL 2014
# NAME
docker-commit - Create a new image from the changes to an existing
container
container
# SYNOPSIS
**docker commit** **-a**|**--author**[=""] **-m**|**--message**[=""] CONTAINER
[REPOSITORY[:TAG]]
**docker commit** **-a**|**--author**[=""] **-m**|**--message**[=""]
CONTAINER [REPOSITORY[:TAG]]
# DESCRIPTION
Using an existing container's name or ID you can create a new image.
@ -24,7 +24,7 @@ Using an existing container's name or ID you can create a new image.
## Creating a new image from an existing container
And 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:
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

Просмотреть файл

@ -20,4 +20,5 @@ the exited container to the current dir on the host:
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -39,4 +39,6 @@ Inspect the changes to on a nginx container:
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -19,8 +19,8 @@ seconds since epoch, or date string.
## 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)
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
@ -43,4 +43,4 @@ Again the output container IDs have been shortened for the purposes of this docu
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -29,4 +29,4 @@ Show the history of when and how an image was created.
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -20,11 +20,11 @@ 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.
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
(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.
@ -32,22 +32,24 @@ versions.
# OPTIONS
**-a**, **--all**=*true*|*false*
: When set to true, also include all intermediate images in the list. The
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.
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
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.
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*.
When set to true, list the graph in graphviz format. The default is
*false*.
# EXAMPLES
@ -61,7 +63,8 @@ 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**:
To get a verbose list of images which contains all the intermediate images
used in builds use **-a**:
docker images -a
@ -72,21 +75,25 @@ 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.
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:
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.
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.
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

Просмотреть файл

@ -2,15 +2,15 @@
% William Henry
% APRIL 2014
# NAME
docker-import - Create an empty filesystem image and import the contents of
the tarball into it.
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.
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
@ -36,4 +36,4 @@ Import to docker via pipe and stdin:
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -10,8 +10,8 @@ docker-info - Display system wide information
# 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.
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
@ -42,4 +42,5 @@ Here is a sample output:
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.
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

Просмотреть файл

@ -17,7 +17,7 @@ each result.
# OPTIONS
**-f**, **--format**=""
: The text/template package of Go describes all the details of the
The text/template package of Go describes all the details of the
format. See examples section
# EXAMPLES
@ -28,11 +28,11 @@ 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": {
"ID": "1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b",
"Created": "2014-04-04T21:33:52.02361335Z",
"Path": "/usr/sbin/nginx",
"Args": [],
"Config": {
"Hostname": "1eb5fabf5a03",
"Domainname": "",
"User": "",
@ -50,8 +50,8 @@ To get information on a container use it's ID or instance name:
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/usr/sbin/nginx"
@ -66,8 +66,8 @@ To get information on a container use it's ID or instance name:
"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"
"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": {
@ -135,7 +135,8 @@ To get the IP address of a container use:
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
# docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} \
{{$p}} -> {{(index $conf 0).HostPort}} {{end}}' 1eb5fabf5a03
80/tcp -> 80
@ -224,5 +225,5 @@ Use an image's ID or name (e.g. repository/name[:tag]) to get information
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot
com) based on docker.io source material and internal work.
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

Просмотреть файл

@ -10,7 +10,7 @@ docker-load - Load an image from a tar archive on STDIN
# DESCRIPTION
Loads a tarred repository from a file or the standard input stream.
Restores both images and tags.
Restores both images and tags.
# OPTIONS
@ -33,4 +33,4 @@ Loads a tarred repository from a file or the standard input stream.
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -10,9 +10,8 @@ docker-login - Register or Login to a docker registry 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.
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**=""
@ -30,7 +29,7 @@ Register or Login to a docker registry server, if no server is
# 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.
based on docker.io source material and internal work.

Просмотреть файл

@ -9,12 +9,12 @@ docker-logs - Fetch the logs of a 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
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).
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
**docker attach**. It will first return all logs from the beginning and
then continue streaming new output from the containers stdout and stderr.
# OPTIONS
@ -23,4 +23,4 @@ then continue streaming new output from the containers stdout and stderr.
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -12,4 +12,4 @@ 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.
based on docker.io source material and internal work.

Просмотреть файл

@ -19,19 +19,19 @@ the running containers.
**-a**, **--all**=*true*|*false*
When true show all containers. Only running containers are shown by
default. Default is false.
default. Default is false.
**--before**=""
Show only container created before Id or Name, include non-running
ones.
ones.
**-l**, **--latest**=*true*|*false*
When true show only the latest created container, include non-running
ones. The default is false.
ones. The default is false.
**-n**=NUM
Show NUM (integer) last created containers, include non-running ones.
The default is -1 (none)
The default is -1 (none)
**--no-trunc**=*true*|*false*
When true truncate output. Default is false.
@ -65,4 +65,4 @@ the running containers.
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -33,4 +33,5 @@ images for that repository name are pulled down including any tags.
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -9,7 +9,7 @@ docker-push - Push an image or a repository to the registry
# DESCRIPTION
Push and image or repository to a registry. The registry may the default
[index.docker.io](https://index.docker.io/v1/) or a another registry
[index.docker.io](https://index.docker.io/v1/) or a another registry
# EXAMPLE
@ -22,9 +22,9 @@ and then committing it to a new image name:
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
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
@ -35,8 +35,8 @@ Check that this worked by running:
# docker images
You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd`
listed.
listed.
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -13,8 +13,9 @@ 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
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.
based on docker.io source material and internal work.

Просмотреть файл

@ -22,15 +22,15 @@ 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
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
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
When set to true, remove the volumes associated to the container. The
default is *false*.
# EXAMPLES
@ -39,7 +39,7 @@ default is *false*.
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**:
it from a file used to store it using the **docker run --cidfile**:
docker rm abebf7571666
@ -52,5 +52,5 @@ command. The use that name as follows:
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based
on docker.io source material and internal work.
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

Просмотреть файл

@ -13,12 +13,12 @@ docker-rmi \- Remove one or more images.
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.
use the **docker images** command.
# OPTIONS
**-f**, **--force**=*true*|*false*
: When set to true, force the removal of the image. The default is
When set to true, force the removal of the image. The default is
*false*.
# EXAMPLES
@ -31,5 +31,5 @@ Here is an example of removing and image:
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based
on docker.io source material and internal work.
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

Просмотреть файл

@ -38,112 +38,114 @@ 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 processs 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.
**-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 processs 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**.
**-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.
**--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
**-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.
**--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
**-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
**--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
.
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**.
**--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: <number><optional unit>, where unit = b, k, m or g.
**-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: <number><optional unit>, 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-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 |
**-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.
**-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.
**-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.
**--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.
**-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:
**--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”)
@ -152,73 +154,73 @@ ways:
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.
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
**--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.
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
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
**--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.
**--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
**-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.
**-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.
**-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.
**--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.
**-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.
**IMAGE**
The image name or ID.
**COMMAND**:
The command or program to run inside the image.
**COMMAND**
The command or program to run inside the image.
**ARG**:
The arguments for the command to be run in the container.
**ARG**
The arguments for the command to be run in the container.
# EXAMPLES
@ -252,12 +254,13 @@ youd like to connect instead, as in:
## 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:
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=<name>:<alias>**
A second container, in this case called linker, can communicate with the httpd
container, named link-test, by running with the **--link=<name>:<alias>**
# docker run -t -i --link=link-test:lt --name=linker fedora /bin/bash
@ -280,15 +283,15 @@ Running the **env** command in the linker container shows environment variables
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.
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:
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
@ -313,8 +316,9 @@ container, allowing to abstract the actual data source from users of that data:
## 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:
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
@ -335,5 +339,5 @@ 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.
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

Просмотреть файл

@ -20,7 +20,7 @@ Stream to a file instead of STDOUT by using **-o**.
# EXAMPLE
Save all fedora repository images to a fedora-all.tar and save the latest
fedora image to a fedora-latest.tar:
fedora image to a fedora-latest.tar:
$ sudo docker save fedora > fedora-all.tar
$ sudo docker save --output=fedora-latest.tar fedora:latest
@ -31,4 +31,5 @@ Save all fedora repository images to a fedora-all.tar and save the latest
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -12,18 +12,18 @@ docker-search - Search the docker index for images
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.
number of stars awarded, whether the image is official, and whether it
is trusted.
# OPTIONS
**--no-trunc**=*true*|*false*:
**--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*:
**-t**, **--trusted**=*true*|*false*
When true only show trusted builds. The default is false.
# EXAMPLE
@ -52,4 +52,4 @@ ranked 1 or higher:
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -22,4 +22,4 @@ the process
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -19,4 +19,4 @@ 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.
based on docker.io source material and internal work.

Просмотреть файл

@ -12,21 +12,22 @@ IMAGE [REGISTRYHOST/][USERNAME/]NAME[:TAG]
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*.
**-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
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.
The username or other qualifying identifier for the image.
**NAME**
: The image name.
The image name.
**TAG**
: The tag you are assigning to the image.
The tag you are assigning to the image.
# EXAMPLES
## Tagging an image
@ -43,5 +44,5 @@ 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.
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

Просмотреть файл

@ -23,4 +23,5 @@ Run **docker top** with the ps option of -x:
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.

Просмотреть файл

@ -19,4 +19,5 @@ Block until a container stops, then print its exit code.
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.
based on docker.io source material and internal work.