Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
| 6 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,206 +0,0 @@ |
| 1 |
-% DOCKERFILE(5) Docker User Manuals |
|
| 2 |
-% Zac Dover |
|
| 3 |
-% May 2014 |
|
| 4 |
-# NAME |
|
| 5 |
- |
|
| 6 |
-Dockerfile - automate the steps of creating a Docker image |
|
| 7 |
- |
|
| 8 |
-# INTRODUCTION |
|
| 9 |
-The **Dockerfile** is a configuration file that automates the steps of creating |
|
| 10 |
-a Docker image. It is similar to a Makefile. Docker reads instructions from the |
|
| 11 |
-**Dockerfile** to automate the steps otherwise performed manually to create an |
|
| 12 |
-image. To build an image, create a file called **Dockerfile**. The |
|
| 13 |
-**Dockerfile** describes the steps taken to assemble the image. When the |
|
| 14 |
-**Dockerfile** has been created, call the **docker build** command, using the |
|
| 15 |
-path of directory that contains **Dockerfile** as the argument. |
|
| 16 |
- |
|
| 17 |
-# SYNOPSIS |
|
| 18 |
- |
|
| 19 |
-INSTRUCTION arguments |
|
| 20 |
- |
|
| 21 |
-For example: |
|
| 22 |
- |
|
| 23 |
-FROM image |
|
| 24 |
- |
|
| 25 |
-# DESCRIPTION |
|
| 26 |
- |
|
| 27 |
-A Dockerfile is a file that automates the steps of creating a Docker image. |
|
| 28 |
-A Dockerfile is similar to a Makefile. |
|
| 29 |
- |
|
| 30 |
-# USAGE |
|
| 31 |
- |
|
| 32 |
-**sudo docker build .** |
|
| 33 |
- -- runs the steps and commits them, building a final image |
|
| 34 |
- The path to the source repository defines where to find the context of the |
|
| 35 |
- build. The build is run by the docker daemon, not the CLI. The whole |
|
| 36 |
- context must be transferred to the daemon. The Docker CLI reports |
|
| 37 |
- "Sending build context to Docker daemon" when the context is sent to the daemon. |
|
| 38 |
- |
|
| 39 |
-**sudo docker build -t repository/tag .** |
|
| 40 |
- -- specifies a repository and tag at which to save the new image if the build |
|
| 41 |
- succeeds. The Docker daemon runs the steps one-by-one, committing the result |
|
| 42 |
- to a new image if necessary before finally outputting the ID of the new |
|
| 43 |
- image. The Docker daemon automatically cleans up the context it is given. |
|
| 44 |
- |
|
| 45 |
-Docker re-uses intermediate images whenever possible. This significantly |
|
| 46 |
-accelerates the *docker build* process. |
|
| 47 |
- |
|
| 48 |
-# FORMAT |
|
| 49 |
- |
|
| 50 |
-**FROM image** |
|
| 51 |
-or |
|
| 52 |
-**FROM image:tag** |
|
| 53 |
- -- The FROM instruction sets the base image for subsequent instructions. A |
|
| 54 |
- valid Dockerfile must have FROM as its first instruction. The image can be any |
|
| 55 |
- valid image. It is easy to start by pulling an image from the public |
|
| 56 |
- repositories. |
|
| 57 |
- -- FROM must be he first non-comment instruction in Dockerfile. |
|
| 58 |
- -- FROM may appear multiple times within a single Dockerfile in order to create |
|
| 59 |
- multiple images. Make a note of the last image id output by the commit before |
|
| 60 |
- each new FROM command. |
|
| 61 |
- -- If no tag is given to the FROM instruction, latest is assumed. If the used |
|
| 62 |
- tag does not exist, an error is returned. |
|
| 63 |
- |
|
| 64 |
-**MAINTAINER** |
|
| 65 |
- --The MAINTAINER instruction sets the Author field for the generated images. |
|
| 66 |
- |
|
| 67 |
-**RUN** |
|
| 68 |
- --RUN has two forms: |
|
| 69 |
- **RUN <command>** |
|
| 70 |
- -- (the command is run in a shell - /bin/sh -c) |
|
| 71 |
- **RUN ["executable", "param1", "param2"]** |
|
| 72 |
- --The above is executable form. |
|
| 73 |
- --The RUN instruction executes any commands in a new layer on top of the |
|
| 74 |
- current image and commits the results. The committed image is used for the next |
|
| 75 |
- step in Dockerfile. |
|
| 76 |
- --Layering RUN instructions and generating commits conforms to the core |
|
| 77 |
- concepts of Docker where commits are cheap and containers can be created from |
|
| 78 |
- any point in the history of an image. This is similar to source control. The |
|
| 79 |
- exec form makes it possible to avoid shell string munging. The exec form makes |
|
| 80 |
- it possible to RUN commands using a base image that does not contain /bin/sh. |
|
| 81 |
- |
|
| 82 |
-**CMD** |
|
| 83 |
- --CMD has three forms: |
|
| 84 |
- **CMD ["executable", "param1", "param2"]** This is the preferred form, the |
|
| 85 |
- exec form. |
|
| 86 |
- **CMD ["param1", "param2"]** This command provides default parameters to |
|
| 87 |
- ENTRYPOINT) |
|
| 88 |
- **CMD command param1 param2** This command is run as a shell. |
|
| 89 |
- --There can be only one CMD in a Dockerfile. If more than one CMD is listed, only |
|
| 90 |
- the last CMD takes effect. |
|
| 91 |
- The main purpose of a CMD is to provide defaults for an executing container. |
|
| 92 |
- These defaults may include an executable, or they can omit the executable. If |
|
| 93 |
- they omit the executable, an ENTRYPOINT must be specified. |
|
| 94 |
- When used in the shell or exec formats, the CMD instruction sets the command to |
|
| 95 |
- be executed when running the image. |
|
| 96 |
- If you use the shell form of of the CMD, the <command> executes in /bin/sh -c: |
|
| 97 |
- **FROM ubuntu** |
|
| 98 |
- **CMD echo "This is a test." | wc -** |
|
| 99 |
- If you run <command> wihtout a shell, then you must express the command as a |
|
| 100 |
- JSON arry and give the full path to the executable. This array form is the |
|
| 101 |
- preferred form of CMD. All additional parameters must be individually expressed |
|
| 102 |
- as strings in the array: |
|
| 103 |
- **FROM ubuntu** |
|
| 104 |
- **CMD ["/usr/bin/wc","--help"]** |
|
| 105 |
- To make the container run the same executable every time, use ENTRYPOINT in |
|
| 106 |
- combination with CMD. |
|
| 107 |
- If the user specifies arguments to docker run, the specified commands override |
|
| 108 |
- the default in CMD. |
|
| 109 |
- Do not confuse **RUN** with **CMD**. RUN runs a command and commits the result. CMD |
|
| 110 |
- executes nothing at build time, but specifies the intended command for the |
|
| 111 |
- image. |
|
| 112 |
- |
|
| 113 |
-**EXPOSE** |
|
| 114 |
- --**EXPOSE <port> [<port>...]** |
|
| 115 |
- The **EXPOSE** instruction informs Docker that the container listens on the |
|
| 116 |
- specified network ports at runtime. Docker uses this information to |
|
| 117 |
- interconnect containers using links, and to set up port redirection on the host |
|
| 118 |
- system. |
|
| 119 |
- |
|
| 120 |
-**ENV** |
|
| 121 |
- --**ENV <key> <value>** |
|
| 122 |
- The ENV instruction sets the environment variable <key> to |
|
| 123 |
- the value <value>. This value is passed to all future RUN instructions. This is |
|
| 124 |
- functionally equivalent to prefixing the command with **<key>=<value>**. The |
|
| 125 |
- environment variables that are set with ENV persist when a container is run |
|
| 126 |
- from the resulting image. Use docker inspect to inspect these values, and |
|
| 127 |
- change them using docker run **--env <key>=<value>.** |
|
| 128 |
- |
|
| 129 |
- Note that setting Setting **ENV DEBIAN_FRONTEND noninteractive** may cause |
|
| 130 |
- unintended consequences, because it will persist when the container is run |
|
| 131 |
- interactively, as with the following command: **docker run -t -i image bash** |
|
| 132 |
- |
|
| 133 |
-**ADD** |
|
| 134 |
- --**ADD <src> <dest>** The ADD instruction copies new files from <src> and adds them |
|
| 135 |
- to the filesystem of the container at path <dest>. <src> must be the path to a |
|
| 136 |
- file or directory relative to the source directory that is being built (the |
|
| 137 |
- context of the build) or a remote file URL. <dest> is the absolute path to |
|
| 138 |
- which the source is copied inside the target container. All new files and |
|
| 139 |
- directories are created with mode 0755, with uid and gid 0. |
|
| 140 |
- |
|
| 141 |
-**ENTRYPOINT** |
|
| 142 |
- --**ENTRYPOINT** has two forms: ENTRYPOINT ["executable", "param1", "param2"] |
|
| 143 |
- (This is like an exec, and is the preferred form.) ENTRYPOINT command param1 |
|
| 144 |
- param2 (This is running as a shell.) An ENTRYPOINT helps you configure a |
|
| 145 |
- container that can be run as an executable. When you specify an ENTRYPOINT, |
|
| 146 |
- the whole container runs as if it was only that executable. The ENTRYPOINT |
|
| 147 |
- instruction adds an entry command that is not overwritten when arguments are |
|
| 148 |
- passed to docker run. This is different from the behavior of CMD. This allows |
|
| 149 |
- arguments to be passed to the entrypoint, for instance docker run <image> -d |
|
| 150 |
- passes the -d argument to the ENTRYPOINT. Specify parameters either in the |
|
| 151 |
- ENTRYPOINT JSON array (as in the preferred exec form above), or by using a CMD |
|
| 152 |
- statement. Parameters in the ENTRYPOINT are not overwritten by the docker run |
|
| 153 |
- arguments. Parameters specifies via CMD are overwritten by docker run |
|
| 154 |
- arguments. Specify a plain string for the ENTRYPOINT, and it will execute in |
|
| 155 |
- /bin/sh -c, like a CMD instruction: |
|
| 156 |
- FROM ubuntu |
|
| 157 |
- ENTRYPOINT wc -l - |
|
| 158 |
- This means that the Dockerfile's image always takes stdin as input (that's |
|
| 159 |
- what "-" means), and prints the number of lines (that's what "-l" means). To |
|
| 160 |
- make this optional but default, use a CMD: |
|
| 161 |
- FROM ubuntu |
|
| 162 |
- CMD ["-l", "-"] |
|
| 163 |
- ENTRYPOINT ["/usr/bin/wc"] |
|
| 164 |
- |
|
| 165 |
-**VOLUME** |
|
| 166 |
- --**VOLUME ["/data"]** |
|
| 167 |
- The VOLUME instruction creates a mount point with the specified name and marks |
|
| 168 |
- it as holding externally-mounted volumes from the native host or from other |
|
| 169 |
- containers. |
|
| 170 |
- |
|
| 171 |
-**USER** |
|
| 172 |
- -- **USER daemon** |
|
| 173 |
- The USER instruction sets the username or UID that is used when running the |
|
| 174 |
- image. |
|
| 175 |
- |
|
| 176 |
-**WORKDIR** |
|
| 177 |
- -- **WORKDIR /path/to/workdir** |
|
| 178 |
- The WORKDIR instruction sets the working directory for the **RUN**, **CMD**, and **ENTRYPOINT** Dockerfile commands that follow it. |
|
| 179 |
- It can be used multiple times in a single Dockerfile. Relative paths are defined relative to the path of the previous **WORKDIR** instruction. For example: |
|
| 180 |
- **WORKDIR /a WORKDIR /b WORKDIR c RUN pwd** |
|
| 181 |
- In the above example, the output of the **pwd** command is **a/b/c**. |
|
| 182 |
- |
|
| 183 |
-**ONBUILD** |
|
| 184 |
- -- **ONBUILD [INSTRUCTION]** |
|
| 185 |
- The ONBUILD instruction adds a trigger instruction to the image, which is |
|
| 186 |
- executed at a later time, when the image is used as the base for another |
|
| 187 |
- build. The trigger is executed in the context of the downstream build, as |
|
| 188 |
- if it had been inserted immediately after the FROM instruction in the |
|
| 189 |
- downstream Dockerfile. Any build instruction can be registered as a |
|
| 190 |
- trigger. This is useful if you are building an image to be |
|
| 191 |
- used as a base for building other images, for example an application build |
|
| 192 |
- environment or a daemon to be customized with a user-specific |
|
| 193 |
- configuration. For example, if your image is a reusable python |
|
| 194 |
- application builder, it requires application source code to be |
|
| 195 |
- added in a particular directory, and might require a build script |
|
| 196 |
- to be called after that. You can't just call ADD and RUN now, because |
|
| 197 |
- you don't yet have access to the application source code, and it |
|
| 198 |
- is different for each application build. Providing |
|
| 199 |
- application developers with a boilerplate Dockerfile to copy-paste |
|
| 200 |
- into their application is inefficient, error-prone, and |
|
| 201 |
- difficult to update because it mixes with application-specific code. |
|
| 202 |
- The solution is to use **ONBUILD** to register instructions in advance, to |
|
| 203 |
- run later, during the next build stage. |
|
| 204 |
- |
|
| 205 |
-# HISTORY |
|
| 206 |
-*May 2014, Compiled by Zac Dover (zdover at redhat dot com) based on docker.io Dockerfile documentation. |
| 207 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,71 +0,0 @@ |
| 1 |
-Docker Documentation |
|
| 2 |
-==================== |
|
| 3 |
- |
|
| 4 |
-This directory contains the Docker user manual in the Markdown format. |
|
| 5 |
-Do *not* edit the man pages in the man1 directory. Instead, amend the |
|
| 6 |
-Markdown (*.md) files. |
|
| 7 |
- |
|
| 8 |
-# File List |
|
| 9 |
- |
|
| 10 |
- docker.md |
|
| 11 |
- docker-attach.md |
|
| 12 |
- docker-build.md |
|
| 13 |
- docker-commit.md |
|
| 14 |
- docker-cp.md |
|
| 15 |
- docker-diff.md |
|
| 16 |
- docker-events.md |
|
| 17 |
- docker-export.md |
|
| 18 |
- docker-history.md |
|
| 19 |
- docker-images.md |
|
| 20 |
- docker-import.md |
|
| 21 |
- docker-info.md |
|
| 22 |
- docker-inspect.md |
|
| 23 |
- docker-kill.md |
|
| 24 |
- docker-load.md |
|
| 25 |
- docker-login.md |
|
| 26 |
- docker-logs.md |
|
| 27 |
- docker-port.md |
|
| 28 |
- docker-ps.md |
|
| 29 |
- docker-pull.md |
|
| 30 |
- docker-push.md |
|
| 31 |
- docker-restart.md |
|
| 32 |
- docker-rmi.md |
|
| 33 |
- docker-rm.md |
|
| 34 |
- docker-run.md |
|
| 35 |
- docker-save.md |
|
| 36 |
- docker-search.md |
|
| 37 |
- docker-start.md |
|
| 38 |
- docker-stop.md |
|
| 39 |
- docker-tag.md |
|
| 40 |
- docker-top.md |
|
| 41 |
- docker-wait.md |
|
| 42 |
- Dockerfile |
|
| 43 |
- md2man-all.sh |
|
| 44 |
- |
|
| 45 |
-# Generating man pages from the Markdown files |
|
| 46 |
- |
|
| 47 |
-The recommended approach for generating the man pages is via a Docker |
|
| 48 |
-container. Using the supplied Dockerfile, Docker will create a Fedora based |
|
| 49 |
-container and isolate the Pandoc installation. This is a seamless process, |
|
| 50 |
-saving you from dealing with Pandoc and dependencies on your own computer. |
|
| 51 |
- |
|
| 52 |
-## Building the Fedora / Pandoc image |
|
| 53 |
- |
|
| 54 |
-There is a Dockerfile provided in the `docker/contrib/man/md` directory. |
|
| 55 |
- |
|
| 56 |
-Using this Dockerfile, create a Docker image tagged `fedora/pandoc`: |
|
| 57 |
- |
|
| 58 |
- docker build -t fedora/pandoc . |
|
| 59 |
- |
|
| 60 |
-## Utilizing the Fedora / Pandoc image |
|
| 61 |
- |
|
| 62 |
-Once the image is built, run a container using the image with *volumes*: |
|
| 63 |
- |
|
| 64 |
- docker run -v /<path-to-git-dir>/docker/contrib/man:/pandoc:rw \ |
|
| 65 |
- -w /pandoc -i fedora/pandoc /pandoc/md/md2man-all.sh |
|
| 66 |
- |
|
| 67 |
-The Pandoc Docker container will process the Markdown files and generate |
|
| 68 |
-the man pages inside the `docker/contrib/man/man1` directory using |
|
| 69 |
-Docker volumes. For more information on Docker volumes see the man page for |
|
| 70 |
-`docker run` and also look at the article [Sharing Directories via Volumes] |
|
| 71 |
-(http://docs.docker.io/use/working_with_volumes/). |
| 72 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,58 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-attach - Attach to a running container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker attach** **--no-stdin**[=*false*] **--sig-proxy**[=*true*] CONTAINER |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-If you **docker run** a container in detached mode (**-d**), you can reattach to |
|
| 12 |
-the detached container with **docker attach** using the container's ID or name. |
|
| 13 |
- |
|
| 14 |
-You can detach from the container again (and leave it running) with `CTRL-q |
|
| 15 |
-CTRL-q` (for a quiet exit), or `CTRL-c` which will send a SIGKILL to the |
|
| 16 |
-container, or `CTRL-\` to get a stacktrace of the Docker client when it quits. |
|
| 17 |
-When you detach from a container the exit code will be returned to |
|
| 18 |
-the client. |
|
| 19 |
- |
|
| 20 |
-# OPTIONS |
|
| 21 |
-**--no-stdin**=*true*|*false* |
|
| 22 |
-When set to true, do not attach to stdin. The default is *false*. |
|
| 23 |
- |
|
| 24 |
-**--sig-proxy**=*true*|*false*: |
|
| 25 |
-When set to true, proxify all received signal to the process (even in non-tty |
|
| 26 |
-mode). The default is *true*. |
|
| 27 |
- |
|
| 28 |
-# EXAMPLES |
|
| 29 |
- |
|
| 30 |
-## Attaching to a container |
|
| 31 |
- |
|
| 32 |
-In this example the top command is run inside a container, from an image called |
|
| 33 |
-fedora, in detached mode. The ID from the container is passed into the **docker |
|
| 34 |
-attach** command: |
|
| 35 |
- |
|
| 36 |
- # ID=$(sudo docker run -d fedora /usr/bin/top -b) |
|
| 37 |
- # sudo docker attach $ID |
|
| 38 |
- top - 02:05:52 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 |
|
| 39 |
- Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie |
|
| 40 |
- 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 |
|
| 41 |
- Mem: 373572k total, 355560k used, 18012k free, 27872k buffers |
|
| 42 |
- Swap: 786428k total, 0k used, 786428k free, 221740k cached |
|
| 43 |
- |
|
| 44 |
- PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
|
| 45 |
- 1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top |
|
| 46 |
- |
|
| 47 |
- top - 02:05:55 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 |
|
| 48 |
- Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie |
|
| 49 |
- 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 |
|
| 50 |
- Mem: 373572k total, 355244k used, 18328k free, 27872k buffers |
|
| 51 |
- Swap: 786428k total, 0k used, 786428k free, 221776k cached |
|
| 52 |
- |
|
| 53 |
- PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
|
| 54 |
- 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top |
|
| 55 |
- |
|
| 56 |
-# HISTORY |
|
| 57 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 58 |
-based on docker.io source material and internal work. |
| 59 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,117 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-build - Build an image from a Dockerfile source at PATH |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker build** [**--no-cache**[=*false*]] [**-q**|**--quiet**[=*false*]] |
|
| 9 |
- [**--rm**] [**-t**|**--tag**=TAG] PATH | URL | - |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
-This will read the Dockerfile from the directory specified in **PATH**. |
|
| 13 |
-It also sends any other files and directories found in the current |
|
| 14 |
-directory to the Docker daemon. The contents of this directory would |
|
| 15 |
-be used by **ADD** commands found within the Dockerfile. |
|
| 16 |
- |
|
| 17 |
-Warning, this will send a lot of data to the Docker daemon depending |
|
| 18 |
-on the contents of the current directory. The build is run by the Docker |
|
| 19 |
-daemon, not by the CLI, so the whole context must be transferred to the daemon. |
|
| 20 |
-The Docker CLI reports "Sending build context to Docker daemon" when the context is sent to |
|
| 21 |
-the daemon. |
|
| 22 |
- |
|
| 23 |
-When a single Dockerfile is given as the URL, then no context is set. |
|
| 24 |
-When a Git repository is set as the **URL**, the repository is used |
|
| 25 |
-as context. |
|
| 26 |
- |
|
| 27 |
-# OPTIONS |
|
| 28 |
- |
|
| 29 |
-**-q**, **--quiet**=*true*|*false* |
|
| 30 |
- When set to true, suppress verbose build output. Default is *false*. |
|
| 31 |
- |
|
| 32 |
-**--rm**=*true*|*false* |
|
| 33 |
- When true, remove intermediate containers that are created during the |
|
| 34 |
-build process. The default is true. |
|
| 35 |
- |
|
| 36 |
-**-t**, **--tag**=*tag* |
|
| 37 |
- The name to be applied to the resulting image on successful completion of |
|
| 38 |
-the build. `tag` in this context means the entire image name including the |
|
| 39 |
-optional TAG after the ':'. |
|
| 40 |
- |
|
| 41 |
-**--no-cache**=*true*|*false* |
|
| 42 |
- When set to true, do not use a cache when building the image. The |
|
| 43 |
-default is *false*. |
|
| 44 |
- |
|
| 45 |
-# EXAMPLES |
|
| 46 |
- |
|
| 47 |
-## Building an image using a Dockefile located inside the current directory |
|
| 48 |
- |
|
| 49 |
-Docker images can be built using the build command and a Dockerfile: |
|
| 50 |
- |
|
| 51 |
- docker build . |
|
| 52 |
- |
|
| 53 |
-During the build process Docker creates intermediate images. In order to |
|
| 54 |
-keep them, you must explicitly set `--rm=false`. |
|
| 55 |
- |
|
| 56 |
- docker build --rm=false . |
|
| 57 |
- |
|
| 58 |
-A good practice is to make a sub-directory with a related name and create |
|
| 59 |
-the Dockerfile in that directory. For example, a directory called mongo may |
|
| 60 |
-contain a Dockerfile to create a Docker MongoDB image. Likewise, another |
|
| 61 |
-directory called httpd may be used to store Dockerfiles for Apache web |
|
| 62 |
-server images. |
|
| 63 |
- |
|
| 64 |
-It is also a good practice to add the files required for the image to the |
|
| 65 |
-sub-directory. These files will then be specified with the `ADD` instruction |
|
| 66 |
-in the Dockerfile. Note: If you include a tar file (a good practice!), then |
|
| 67 |
-Docker will automatically extract the contents of the tar file |
|
| 68 |
-specified within the `ADD` instruction into the specified target. |
|
| 69 |
- |
|
| 70 |
-## Building an image and naming that image |
|
| 71 |
- |
|
| 72 |
-A good practice is to give a name to the image you are building. There are |
|
| 73 |
-no hard rules here but it is best to give the names consideration. |
|
| 74 |
- |
|
| 75 |
-The **-t**/**--tag** flag is used to rename an image. Here are some examples: |
|
| 76 |
- |
|
| 77 |
-Though it is not a good practice, image names can be arbtrary: |
|
| 78 |
- |
|
| 79 |
- docker build -t myimage . |
|
| 80 |
- |
|
| 81 |
-A better approach is to provide a fully qualified and meaningful repository, |
|
| 82 |
-name, and tag (where the tag in this context means the qualifier after |
|
| 83 |
-the ":"). In this example we build a JBoss image for the Fedora repository |
|
| 84 |
-and give it the version 1.0: |
|
| 85 |
- |
|
| 86 |
- docker build -t fedora/jboss:1.0 |
|
| 87 |
- |
|
| 88 |
-The next example is for the "whenry" user repository and uses Fedora and |
|
| 89 |
-JBoss and gives it the version 2.1 : |
|
| 90 |
- |
|
| 91 |
- docker build -t whenry/fedora-jboss:V2.1 |
|
| 92 |
- |
|
| 93 |
-If you do not provide a version tag then Docker will assign `latest`: |
|
| 94 |
- |
|
| 95 |
- docker build -t whenry/fedora-jboss |
|
| 96 |
- |
|
| 97 |
-When you list the images, the image above will have the tag `latest`. |
|
| 98 |
- |
|
| 99 |
-So renaming an image is arbitrary but consideration should be given to |
|
| 100 |
-a useful convention that makes sense for consumers and should also take |
|
| 101 |
-into account Docker community conventions. |
|
| 102 |
- |
|
| 103 |
- |
|
| 104 |
-## Building an image using a URL |
|
| 105 |
- |
|
| 106 |
-This will clone the specified Github repository from the URL and use it |
|
| 107 |
-as context. The Dockerfile at the root of the repository is used as |
|
| 108 |
-Dockerfile. This only works if the Github repository is a dedicated |
|
| 109 |
-repository. |
|
| 110 |
- |
|
| 111 |
- docker build github.com/scollier/Fedora-Dockerfiles/tree/master/apache |
|
| 112 |
- |
|
| 113 |
-Note: You can set an arbitrary Git repository via the `git://` schema. |
|
| 114 |
- |
|
| 115 |
-# HISTORY |
|
| 116 |
-March 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 117 |
-based on docker.io source material and internal work. |
| 118 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,34 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-commit - Create a new image from the changes to an existing |
|
| 6 |
-container |
|
| 7 |
- |
|
| 8 |
-# SYNOPSIS |
|
| 9 |
-**docker commit** **-a**|**--author**[=""] **-m**|**--message**[=""] |
|
| 10 |
-CONTAINER [REPOSITORY[:TAG]] |
|
| 11 |
- |
|
| 12 |
-# DESCRIPTION |
|
| 13 |
-Using an existing container's name or ID you can create a new image. |
|
| 14 |
- |
|
| 15 |
-# OPTIONS |
|
| 16 |
-**-a, --author**="" |
|
| 17 |
- Author name. (eg. "John Hannibal Smith <hannibal@a-team.com>" |
|
| 18 |
- |
|
| 19 |
-**-m, --message**="" |
|
| 20 |
- Commit message |
|
| 21 |
- |
|
| 22 |
-# EXAMPLES |
|
| 23 |
- |
|
| 24 |
-## Creating a new image from an existing container |
|
| 25 |
-An existing Fedora based container has had Apache installed while running |
|
| 26 |
-in interactive mode with the bash shell. Apache is also running. To |
|
| 27 |
-create a new image run docker ps to find the container's ID and then run: |
|
| 28 |
- |
|
| 29 |
- # docker commit -m= "Added Apache to Fedora base image" \ |
|
| 30 |
- -a="A D Ministrator" 98bd7fc99854 fedora/fedora_httpd:20 |
|
| 31 |
- |
|
| 32 |
-# HISTORY |
|
| 33 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 34 |
-based on docker.io source material and in |
| 35 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,24 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-cp - Copy files/folders from the PATH to the HOSTPATH |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker cp** CONTAINER:PATH HOSTPATH |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-Copy files/folders from the containers filesystem to the host |
|
| 12 |
-path. Paths are relative to the root of the filesystem. Files |
|
| 13 |
-can be copied from a running or stopped container. |
|
| 14 |
- |
|
| 15 |
-# EXAMPLE |
|
| 16 |
-An important shell script file, created in a bash shell, is copied from |
|
| 17 |
-the exited container to the current dir on the host: |
|
| 18 |
- |
|
| 19 |
- # docker cp c071f3c3ee81:setup.sh . |
|
| 20 |
- |
|
| 21 |
-# HISTORY |
|
| 22 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 23 |
-based on docker.io source material and internal work. |
|
| 24 |
- |
| 25 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,44 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-diff - Inspect changes on a container's filesystem |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker diff** CONTAINER |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-Inspect changes on a container's filesystem. You can use the full or |
|
| 12 |
-shortened container ID or the container name set using |
|
| 13 |
-**docker run --name** option. |
|
| 14 |
- |
|
| 15 |
-# EXAMPLE |
|
| 16 |
-Inspect the changes to on a nginx container: |
|
| 17 |
- |
|
| 18 |
- # docker diff 1fdfd1f54c1b |
|
| 19 |
- C /dev |
|
| 20 |
- C /dev/console |
|
| 21 |
- C /dev/core |
|
| 22 |
- C /dev/stdout |
|
| 23 |
- C /dev/fd |
|
| 24 |
- C /dev/ptmx |
|
| 25 |
- C /dev/stderr |
|
| 26 |
- C /dev/stdin |
|
| 27 |
- C /run |
|
| 28 |
- A /run/nginx.pid |
|
| 29 |
- C /var/lib/nginx/tmp |
|
| 30 |
- A /var/lib/nginx/tmp/client_body |
|
| 31 |
- A /var/lib/nginx/tmp/fastcgi |
|
| 32 |
- A /var/lib/nginx/tmp/proxy |
|
| 33 |
- A /var/lib/nginx/tmp/scgi |
|
| 34 |
- A /var/lib/nginx/tmp/uwsgi |
|
| 35 |
- C /var/log/nginx |
|
| 36 |
- A /var/log/nginx/access.log |
|
| 37 |
- A /var/log/nginx/error.log |
|
| 38 |
- |
|
| 39 |
- |
|
| 40 |
-# HISTORY |
|
| 41 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 42 |
-based on docker.io source material and internal work. |
|
| 43 |
- |
|
| 44 |
- |
| 45 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,46 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-events - Get real time events from the server |
|
| 6 |
- |
|
| 7 |
-**docker events** **--since**=""|*epoch-time* |
|
| 8 |
- |
|
| 9 |
-# DESCRIPTION |
|
| 10 |
-Get event information from the Docker daemon. Information can include historical |
|
| 11 |
-information and real-time information. |
|
| 12 |
- |
|
| 13 |
-# OPTIONS |
|
| 14 |
-**--since**="" |
|
| 15 |
-Show previously created events and then stream. This can be in either |
|
| 16 |
-seconds since epoch, or date string. |
|
| 17 |
- |
|
| 18 |
-# EXAMPLES |
|
| 19 |
- |
|
| 20 |
-## Listening for Docker events |
|
| 21 |
- |
|
| 22 |
-After running docker events a container 786d698004576 is started and stopped |
|
| 23 |
-(The container name has been shortened in the output below): |
|
| 24 |
- |
|
| 25 |
- # docker events |
|
| 26 |
- [2014-04-12 18:23:04 -0400 EDT] 786d69800457: (from whenry/testimage:latest) start |
|
| 27 |
- [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) die |
|
| 28 |
- [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) stop |
|
| 29 |
- |
|
| 30 |
-## Listening for events since a given date |
|
| 31 |
-Again the output container IDs have been shortened for the purposes of this document: |
|
| 32 |
- |
|
| 33 |
- # docker events --since '2014-04-12' |
|
| 34 |
- [2014-04-12 18:11:28 -0400 EDT] c655dbf640dc: (from whenry/testimage:latest) create |
|
| 35 |
- [2014-04-12 18:11:28 -0400 EDT] c655dbf640dc: (from whenry/testimage:latest) start |
|
| 36 |
- [2014-04-12 18:14:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) create |
|
| 37 |
- [2014-04-12 18:14:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) start |
|
| 38 |
- [2014-04-12 18:22:44 -0400 EDT] 786d69800457: (from whenry/testimage:latest) die |
|
| 39 |
- [2014-04-12 18:22:44 -0400 EDT] 786d69800457: (from whenry/testimage:latest) stop |
|
| 40 |
- [2014-04-12 18:23:04 -0400 EDT] 786d69800457: (from whenry/testimage:latest) start |
|
| 41 |
- [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) die |
|
| 42 |
- [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) stop |
|
| 43 |
- |
|
| 44 |
-# HISTORY |
|
| 45 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 46 |
-based on docker.io source material and internal work. |
| 47 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,26 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-export - Export the contents of a filesystem as a tar archive to |
|
| 6 |
-STDOUT. |
|
| 7 |
- |
|
| 8 |
-# SYNOPSIS |
|
| 9 |
-**docker export** CONTAINER |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
-Export the contents of a container's filesystem using the full or shortened |
|
| 13 |
-container ID or container name. The output is exported to STDOUT and can be |
|
| 14 |
-redirected to a tar file. |
|
| 15 |
- |
|
| 16 |
-# EXAMPLE |
|
| 17 |
-Export the contents of the container called angry_bell to a tar file |
|
| 18 |
-called test.tar: |
|
| 19 |
- |
|
| 20 |
- # docker export angry_bell > test.tar |
|
| 21 |
- # ls *.tar |
|
| 22 |
- test.tar |
|
| 23 |
- |
|
| 24 |
-# HISTORY |
|
| 25 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 26 |
-based on docker.io source material and internal work. |
| 27 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,32 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-history - Show the history of an image |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker history** **--no-trunc**[=*false*] [**-q**|**--quiet**[=*false*]] |
|
| 9 |
- IMAGE |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
- |
|
| 13 |
-Show the history of when and how an image was created. |
|
| 14 |
- |
|
| 15 |
-# OPTIONS |
|
| 16 |
- |
|
| 17 |
-**--no-trunc**=*true*|*false* |
|
| 18 |
- When true don't truncate output. Default is false |
|
| 19 |
- |
|
| 20 |
-**-q**, **--quiet=*true*|*false* |
|
| 21 |
- When true only show numeric IDs. Default is false. |
|
| 22 |
- |
|
| 23 |
-# EXAMPLE |
|
| 24 |
- $ sudo docker history fedora |
|
| 25 |
- IMAGE CREATED CREATED BY SIZE |
|
| 26 |
- 105182bb5e8b 5 days ago /bin/sh -c #(nop) ADD file:71356d2ad59aa3119d 372.7 MB |
|
| 27 |
- 73bd853d2ea5 13 days ago /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar 0 B |
|
| 28 |
- 511136ea3c5a 10 months ago 0 B |
|
| 29 |
- |
|
| 30 |
-# HISTORY |
|
| 31 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 32 |
-based on docker.io source material and internal work. |
| 33 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,99 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-images - List the images in the local repository |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker images** |
|
| 9 |
-[**-a**|**--all**=*false*] |
|
| 10 |
-[**--no-trunc**[=*false*] |
|
| 11 |
-[**-q**|**--quiet**[=*false*] |
|
| 12 |
-[**-t**|**--tree**=*false*] |
|
| 13 |
-[**-v**|**--viz**=*false*] |
|
| 14 |
-[NAME] |
|
| 15 |
- |
|
| 16 |
-# DESCRIPTION |
|
| 17 |
-This command lists the images stored in the local Docker repository. |
|
| 18 |
- |
|
| 19 |
-By default, intermediate images, used during builds, are not listed. Some of the |
|
| 20 |
-output, e.g. image ID, is truncated, for space reasons. However the truncated |
|
| 21 |
-image ID, and often the first few characters, are enough to be used in other |
|
| 22 |
-Docker commands that use the image ID. The output includes repository, tag, image |
|
| 23 |
-ID, date created and the virtual size. |
|
| 24 |
- |
|
| 25 |
-The title REPOSITORY for the first title may seem confusing. It is essentially |
|
| 26 |
-the image name. However, because you can tag a specific image, and multiple tags |
|
| 27 |
-(image instances) can be associated with a single name, the name is really a |
|
| 28 |
-repository for all tagged images of the same name. For example consider an image |
|
| 29 |
-called fedora. It may be tagged with 18, 19, or 20, etc. to manage different |
|
| 30 |
-versions. |
|
| 31 |
- |
|
| 32 |
-# OPTIONS |
|
| 33 |
- |
|
| 34 |
-**-a**, **--all**=*true*|*false* |
|
| 35 |
- When set to true, also include all intermediate images in the list. The |
|
| 36 |
-default is false. |
|
| 37 |
- |
|
| 38 |
-**--no-trunc**=*true*|*false* |
|
| 39 |
- When set to true, list the full image ID and not the truncated ID. The |
|
| 40 |
-default is false. |
|
| 41 |
- |
|
| 42 |
-**-q**, **--quiet**=*true*|*false* |
|
| 43 |
- When set to true, list the complete image ID as part of the output. The |
|
| 44 |
-default is false. |
|
| 45 |
- |
|
| 46 |
-**-t**, **--tree**=*true*|*false* |
|
| 47 |
- When set to true, list the images in a tree dependency tree (hierarchy) |
|
| 48 |
-format. The default is false. |
|
| 49 |
- |
|
| 50 |
-**-v**, **--viz**=*true*|*false* |
|
| 51 |
- When set to true, list the graph in graphviz format. The default is |
|
| 52 |
-*false*. |
|
| 53 |
- |
|
| 54 |
-# EXAMPLES |
|
| 55 |
- |
|
| 56 |
-## Listing the images |
|
| 57 |
- |
|
| 58 |
-To list the images in a local repository (not the registry) run: |
|
| 59 |
- |
|
| 60 |
- docker images |
|
| 61 |
- |
|
| 62 |
-The list will contain the image repository name, a tag for the image, and an |
|
| 63 |
-image ID, when it was created and its virtual size. Columns: REPOSITORY, TAG, |
|
| 64 |
-IMAGE ID, CREATED, and VIRTUAL SIZE. |
|
| 65 |
- |
|
| 66 |
-To get a verbose list of images which contains all the intermediate images |
|
| 67 |
-used in builds use **-a**: |
|
| 68 |
- |
|
| 69 |
- docker images -a |
|
| 70 |
- |
|
| 71 |
-## List images dependency tree hierarchy |
|
| 72 |
- |
|
| 73 |
-To list the images in the local repository (not the registry) in a dependency |
|
| 74 |
-tree format, use the **-t** option. |
|
| 75 |
- |
|
| 76 |
- docker images -t |
|
| 77 |
- |
|
| 78 |
-This displays a staggered hierarchy tree where the less indented image is |
|
| 79 |
-the oldest with dependent image layers branching inward (to the right) on |
|
| 80 |
-subsequent lines. The newest or top level image layer is listed last in |
|
| 81 |
-any tree branch. |
|
| 82 |
- |
|
| 83 |
-## List images in GraphViz format |
|
| 84 |
- |
|
| 85 |
-To display the list in a format consumable by a GraphViz tools run with |
|
| 86 |
-**-v**. For example to produce a .png graph file of the hierarchy use: |
|
| 87 |
- |
|
| 88 |
- docker images --viz | dot -Tpng -o docker.png |
|
| 89 |
- |
|
| 90 |
-## Listing only the shortened image IDs |
|
| 91 |
- |
|
| 92 |
-Listing just the shortened image IDs. This can be useful for some automated |
|
| 93 |
-tools. |
|
| 94 |
- |
|
| 95 |
- docker images -q |
|
| 96 |
- |
|
| 97 |
-# HISTORY |
|
| 98 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 99 |
-based on docker.io source material and internal work. |
| 100 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,39 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-import - Create an empty filesystem image and import the contents |
|
| 6 |
-of the tarball into it. |
|
| 7 |
- |
|
| 8 |
-# SYNOPSIS |
|
| 9 |
-**docker import** URL|- [REPOSITORY[:TAG]] |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
-Create a new filesystem image from the contents of a tarball (`.tar`, |
|
| 13 |
-`.tar.gz`, `.tgz`, `.bzip`, `.tar.xz`, `.txz`) into it, then optionally tag it. |
|
| 14 |
- |
|
| 15 |
-# EXAMPLES |
|
| 16 |
- |
|
| 17 |
-## Import from a remote location |
|
| 18 |
- |
|
| 19 |
- # docker import http://example.com/exampleimage.tgz example/imagerepo |
|
| 20 |
- |
|
| 21 |
-## Import from a local file |
|
| 22 |
- |
|
| 23 |
-Import to docker via pipe and stdin: |
|
| 24 |
- |
|
| 25 |
- # cat exampleimage.tgz | docker import - example/imagelocal |
|
| 26 |
- |
|
| 27 |
-## Import from a local file and tag |
|
| 28 |
- |
|
| 29 |
-Import to docker via pipe and stdin: |
|
| 30 |
- |
|
| 31 |
- # cat exampleimageV2.tgz | docker import - example/imagelocal:V-2.0 |
|
| 32 |
- |
|
| 33 |
-## Import from a local directory |
|
| 34 |
- |
|
| 35 |
- # tar -c . | docker import - exampleimagedir |
|
| 36 |
- |
|
| 37 |
-# HISTORY |
|
| 38 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 39 |
-based on docker.io source material and internal work. |
| 40 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,46 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-info - Display system wide information |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker info** |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-This command displays system wide information regarding the Docker installation. |
|
| 12 |
-Information displayed includes the number of containers and images, pool name, |
|
| 13 |
-data file, metadata file, data space used, total data space, metadata space used |
|
| 14 |
-, total metadata space, execution driver, and the kernel version. |
|
| 15 |
- |
|
| 16 |
-The data file is where the images are stored and the metadata file is where the |
|
| 17 |
-meta data regarding those images are stored. When run for the first time Docker |
|
| 18 |
-allocates a certain amount of data space and meta data space from the space |
|
| 19 |
-available on the volume where `/var/lib/docker` is mounted. |
|
| 20 |
- |
|
| 21 |
-# OPTIONS |
|
| 22 |
-There are no available options. |
|
| 23 |
- |
|
| 24 |
-# EXAMPLES |
|
| 25 |
- |
|
| 26 |
-## Display Docker system information |
|
| 27 |
- |
|
| 28 |
-Here is a sample output: |
|
| 29 |
- |
|
| 30 |
- # docker info |
|
| 31 |
- Containers: 18 |
|
| 32 |
- Images: 95 |
|
| 33 |
- Storage Driver: devicemapper |
|
| 34 |
- Pool Name: docker-8:1-170408448-pool |
|
| 35 |
- Data file: /var/lib/docker/devicemapper/devicemapper/data |
|
| 36 |
- Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata |
|
| 37 |
- Data Space Used: 9946.3 Mb |
|
| 38 |
- Data Space Total: 102400.0 Mb |
|
| 39 |
- Metadata Space Used: 9.9 Mb |
|
| 40 |
- Metadata Space Total: 2048.0 Mb |
|
| 41 |
- Execution Driver: native-0.1 |
|
| 42 |
- Kernel Version: 3.10.0-116.el7.x86_64 |
|
| 43 |
- |
|
| 44 |
-# HISTORY |
|
| 45 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 46 |
-based on docker.io source material and internal work. |
| 47 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,229 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-inspect - Return low-level information on a container/image |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker inspect** [**-f**|**--format**="" CONTAINER|IMAGE |
|
| 9 |
-[CONTAINER|IMAGE...] |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
- |
|
| 13 |
-This displays all the information available in Docker for a given |
|
| 14 |
-container or image. By default, this will render all results in a JSON |
|
| 15 |
-array. If a format is specified, the given template will be executed for |
|
| 16 |
-each result. |
|
| 17 |
- |
|
| 18 |
-# OPTIONS |
|
| 19 |
-**-f**, **--format**="" |
|
| 20 |
- The text/template package of Go describes all the details of the |
|
| 21 |
-format. See examples section |
|
| 22 |
- |
|
| 23 |
-# EXAMPLES |
|
| 24 |
- |
|
| 25 |
-## Getting information on a container |
|
| 26 |
- |
|
| 27 |
-To get information on a container use it's ID or instance name: |
|
| 28 |
- |
|
| 29 |
- #docker inspect 1eb5fabf5a03 |
|
| 30 |
- [{
|
|
| 31 |
- "ID": "1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b", |
|
| 32 |
- "Created": "2014-04-04T21:33:52.02361335Z", |
|
| 33 |
- "Path": "/usr/sbin/nginx", |
|
| 34 |
- "Args": [], |
|
| 35 |
- "Config": {
|
|
| 36 |
- "Hostname": "1eb5fabf5a03", |
|
| 37 |
- "Domainname": "", |
|
| 38 |
- "User": "", |
|
| 39 |
- "Memory": 0, |
|
| 40 |
- "MemorySwap": 0, |
|
| 41 |
- "CpuShares": 0, |
|
| 42 |
- "AttachStdin": false, |
|
| 43 |
- "AttachStdout": false, |
|
| 44 |
- "AttachStderr": false, |
|
| 45 |
- "PortSpecs": null, |
|
| 46 |
- "ExposedPorts": {
|
|
| 47 |
- "80/tcp": {}
|
|
| 48 |
- }, |
|
| 49 |
- "Tty": true, |
|
| 50 |
- "OpenStdin": false, |
|
| 51 |
- "StdinOnce": false, |
|
| 52 |
- "Env": [ |
|
| 53 |
- "HOME=/", |
|
| 54 |
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
|
| 55 |
- ], |
|
| 56 |
- "Cmd": [ |
|
| 57 |
- "/usr/sbin/nginx" |
|
| 58 |
- ], |
|
| 59 |
- "Dns": null, |
|
| 60 |
- "DnsSearch": null, |
|
| 61 |
- "Image": "summit/nginx", |
|
| 62 |
- "Volumes": null, |
|
| 63 |
- "VolumesFrom": "", |
|
| 64 |
- "WorkingDir": "", |
|
| 65 |
- "Entrypoint": null, |
|
| 66 |
- "NetworkDisabled": false, |
|
| 67 |
- "OnBuild": null, |
|
| 68 |
- "Context": {
|
|
| 69 |
- "mount_label": "system_u:object_r:svirt_sandbox_file_t:s0:c0,c650", |
|
| 70 |
- "process_label": "system_u:system_r:svirt_lxc_net_t:s0:c0,c650" |
|
| 71 |
- } |
|
| 72 |
- }, |
|
| 73 |
- "State": {
|
|
| 74 |
- "Running": true, |
|
| 75 |
- "Pid": 858, |
|
| 76 |
- "ExitCode": 0, |
|
| 77 |
- "StartedAt": "2014-04-04T21:33:54.16259207Z", |
|
| 78 |
- "FinishedAt": "0001-01-01T00:00:00Z", |
|
| 79 |
- "Ghost": false |
|
| 80 |
- }, |
|
| 81 |
- "Image": "df53773a4390e25936f9fd3739e0c0e60a62d024ea7b669282b27e65ae8458e6", |
|
| 82 |
- "NetworkSettings": {
|
|
| 83 |
- "IPAddress": "172.17.0.2", |
|
| 84 |
- "IPPrefixLen": 16, |
|
| 85 |
- "Gateway": "172.17.42.1", |
|
| 86 |
- "Bridge": "docker0", |
|
| 87 |
- "PortMapping": null, |
|
| 88 |
- "Ports": {
|
|
| 89 |
- "80/tcp": [ |
|
| 90 |
- {
|
|
| 91 |
- "HostIp": "0.0.0.0", |
|
| 92 |
- "HostPort": "80" |
|
| 93 |
- } |
|
| 94 |
- ] |
|
| 95 |
- } |
|
| 96 |
- }, |
|
| 97 |
- "ResolvConfPath": "/etc/resolv.conf", |
|
| 98 |
- "HostnamePath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/hostname", |
|
| 99 |
- "HostsPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/hosts", |
|
| 100 |
- "Name": "/ecstatic_ptolemy", |
|
| 101 |
- "Driver": "devicemapper", |
|
| 102 |
- "ExecDriver": "native-0.1", |
|
| 103 |
- "Volumes": {},
|
|
| 104 |
- "VolumesRW": {},
|
|
| 105 |
- "HostConfig": {
|
|
| 106 |
- "Binds": null, |
|
| 107 |
- "ContainerIDFile": "", |
|
| 108 |
- "LxcConf": [], |
|
| 109 |
- "Privileged": false, |
|
| 110 |
- "PortBindings": {
|
|
| 111 |
- "80/tcp": [ |
|
| 112 |
- {
|
|
| 113 |
- "HostIp": "0.0.0.0", |
|
| 114 |
- "HostPort": "80" |
|
| 115 |
- } |
|
| 116 |
- ] |
|
| 117 |
- }, |
|
| 118 |
- "Links": null, |
|
| 119 |
- "PublishAllPorts": false, |
|
| 120 |
- "DriverOptions": {
|
|
| 121 |
- "lxc": null |
|
| 122 |
- }, |
|
| 123 |
- "CliAddress": "" |
|
| 124 |
- } |
|
| 125 |
- |
|
| 126 |
-## Getting the IP address of a container instance |
|
| 127 |
- |
|
| 128 |
-To get the IP address of a container use: |
|
| 129 |
- |
|
| 130 |
- # docker inspect --format='{{.NetworkSettings.IPAddress}}' 1eb5fabf5a03
|
|
| 131 |
- 172.17.0.2 |
|
| 132 |
- |
|
| 133 |
-## Listing all port bindings |
|
| 134 |
- |
|
| 135 |
-One can loop over arrays and maps in the results to produce simple text |
|
| 136 |
-output: |
|
| 137 |
- |
|
| 138 |
- # docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} \
|
|
| 139 |
- {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' 1eb5fabf5a03
|
|
| 140 |
- |
|
| 141 |
- 80/tcp -> 80 |
|
| 142 |
- |
|
| 143 |
-## Getting information on an image |
|
| 144 |
- |
|
| 145 |
-Use an image's ID or name (e.g. repository/name[:tag]) to get information |
|
| 146 |
- on it. |
|
| 147 |
- |
|
| 148 |
- # docker inspect 58394af37342 |
|
| 149 |
- [{
|
|
| 150 |
- "id": "58394af373423902a1b97f209a31e3777932d9321ef10e64feaaa7b4df609cf9", |
|
| 151 |
- "parent": "8abc22bad04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", |
|
| 152 |
- "created": "2014-02-03T16:10:40.500814677Z", |
|
| 153 |
- "container": "f718f19a28a5147da49313c54620306243734bafa63c76942ef6f8c4b4113bc5", |
|
| 154 |
- "container_config": {
|
|
| 155 |
- "Hostname": "88807319f25e", |
|
| 156 |
- "Domainname": "", |
|
| 157 |
- "User": "", |
|
| 158 |
- "Memory": 0, |
|
| 159 |
- "MemorySwap": 0, |
|
| 160 |
- "CpuShares": 0, |
|
| 161 |
- "AttachStdin": false, |
|
| 162 |
- "AttachStdout": false, |
|
| 163 |
- "AttachStderr": false, |
|
| 164 |
- "PortSpecs": null, |
|
| 165 |
- "ExposedPorts": null, |
|
| 166 |
- "Tty": false, |
|
| 167 |
- "OpenStdin": false, |
|
| 168 |
- "StdinOnce": false, |
|
| 169 |
- "Env": [ |
|
| 170 |
- "HOME=/", |
|
| 171 |
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
|
| 172 |
- ], |
|
| 173 |
- "Cmd": [ |
|
| 174 |
- "/bin/sh", |
|
| 175 |
- "-c", |
|
| 176 |
- "#(nop) ADD fedora-20-dummy.tar.xz in /" |
|
| 177 |
- ], |
|
| 178 |
- "Dns": null, |
|
| 179 |
- "DnsSearch": null, |
|
| 180 |
- "Image": "8abc22bad04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", |
|
| 181 |
- "Volumes": null, |
|
| 182 |
- "VolumesFrom": "", |
|
| 183 |
- "WorkingDir": "", |
|
| 184 |
- "Entrypoint": null, |
|
| 185 |
- "NetworkDisabled": false, |
|
| 186 |
- "OnBuild": null, |
|
| 187 |
- "Context": null |
|
| 188 |
- }, |
|
| 189 |
- "docker_version": "0.6.3", |
|
| 190 |
- "author": "I P Babble \u003clsm5@ipbabble.com\u003e - ./buildcontainers.sh", |
|
| 191 |
- "config": {
|
|
| 192 |
- "Hostname": "88807319f25e", |
|
| 193 |
- "Domainname": "", |
|
| 194 |
- "User": "", |
|
| 195 |
- "Memory": 0, |
|
| 196 |
- "MemorySwap": 0, |
|
| 197 |
- "CpuShares": 0, |
|
| 198 |
- "AttachStdin": false, |
|
| 199 |
- "AttachStdout": false, |
|
| 200 |
- "AttachStderr": false, |
|
| 201 |
- "PortSpecs": null, |
|
| 202 |
- "ExposedPorts": null, |
|
| 203 |
- "Tty": false, |
|
| 204 |
- "OpenStdin": false, |
|
| 205 |
- "StdinOnce": false, |
|
| 206 |
- "Env": [ |
|
| 207 |
- "HOME=/", |
|
| 208 |
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
|
| 209 |
- ], |
|
| 210 |
- "Cmd": null, |
|
| 211 |
- "Dns": null, |
|
| 212 |
- "DnsSearch": null, |
|
| 213 |
- "Image": "8abc22bad04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", |
|
| 214 |
- "Volumes": null, |
|
| 215 |
- "VolumesFrom": "", |
|
| 216 |
- "WorkingDir": "", |
|
| 217 |
- "Entrypoint": null, |
|
| 218 |
- "NetworkDisabled": false, |
|
| 219 |
- "OnBuild": null, |
|
| 220 |
- "Context": null |
|
| 221 |
- }, |
|
| 222 |
- "architecture": "x86_64", |
|
| 223 |
- "Size": 385520098 |
|
| 224 |
- }] |
|
| 225 |
- |
|
| 226 |
-# HISTORY |
|
| 227 |
- |
|
| 228 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 229 |
-based on docker.io source material and internal work. |
| 230 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,21 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-kill - Kill a running container (send SIGKILL, or specified signal) |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker kill** **--signal**[=*"KILL"*] CONTAINER [CONTAINER...] |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
- |
|
| 12 |
-The main process inside each container specified will be sent SIGKILL, |
|
| 13 |
- or any signal specified with option --signal. |
|
| 14 |
- |
|
| 15 |
-# OPTIONS |
|
| 16 |
-**-s**, **--signal**=*"KILL"* |
|
| 17 |
- Signal to send to the container |
|
| 18 |
- |
|
| 19 |
-# HISTORY |
|
| 20 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 21 |
- based on docker.io source material and internal work. |
| 22 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,36 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-load - Load an image from a tar archive on STDIN |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker load** **--input**="" |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
- |
|
| 12 |
-Loads a tarred repository from a file or the standard input stream. |
|
| 13 |
-Restores both images and tags. |
|
| 14 |
- |
|
| 15 |
-# OPTIONS |
|
| 16 |
- |
|
| 17 |
-**-i**, **--input**="" |
|
| 18 |
- Read from a tar archive file, instead of STDIN |
|
| 19 |
- |
|
| 20 |
-# EXAMPLE |
|
| 21 |
- |
|
| 22 |
- $ sudo docker images |
|
| 23 |
- REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE |
|
| 24 |
- busybox latest 769b9341d937 7 weeks ago 2.489 MB |
|
| 25 |
- $ sudo docker load --input fedora.tar |
|
| 26 |
- $ sudo docker images |
|
| 27 |
- REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE |
|
| 28 |
- busybox latest 769b9341d937 7 weeks ago 2.489 MB |
|
| 29 |
- fedora rawhide 0d20aec6529d 7 weeks ago 387 MB |
|
| 30 |
- fedora 20 58394af37342 7 weeks ago 385.5 MB |
|
| 31 |
- fedora heisenbug 58394af37342 7 weeks ago 385.5 MB |
|
| 32 |
- fedora latest 58394af37342 7 weeks ago 385.5 MB |
|
| 33 |
- |
|
| 34 |
-# HISTORY |
|
| 35 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 36 |
-based on docker.io source material and internal work. |
| 37 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,35 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-login - Register or Login to a docker registry server. |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker login** [**-e**|**-email**=""] [**-p**|**--password**=""] |
|
| 9 |
- [**-u**|**--username**=""] [SERVER] |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
-Register or Login to a docker registry server, if no server is |
|
| 13 |
-specified "https://index.docker.io/v1/" is the default. If you want to |
|
| 14 |
-login to a private registry you can specify this by adding the server name. |
|
| 15 |
- |
|
| 16 |
-# OPTIONS |
|
| 17 |
-**-e**, **--email**="" |
|
| 18 |
- Email address |
|
| 19 |
- |
|
| 20 |
-**-p**, **--password**="" |
|
| 21 |
- Password |
|
| 22 |
- |
|
| 23 |
-**-u**, **--username**="" |
|
| 24 |
- Username |
|
| 25 |
- |
|
| 26 |
-# EXAMPLE |
|
| 27 |
- |
|
| 28 |
-## Login to a local registry |
|
| 29 |
- |
|
| 30 |
- # docker login localhost:8080 |
|
| 31 |
- |
|
| 32 |
-# HISTORY |
|
| 33 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 34 |
-based on docker.io source material and internal work. |
|
| 35 |
- |
| 36 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,26 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-logs - Fetch the logs of a container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker logs** **--follow**[=*false*] CONTAINER |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-The **docker logs** command batch-retrieves whatever logs are present for |
|
| 12 |
-a container at the time of execution. This does not guarantee execution |
|
| 13 |
-order when combined with a docker run (i.e. your run may not have generated |
|
| 14 |
-any logs at the time you execute docker logs). |
|
| 15 |
- |
|
| 16 |
-The **docker logs --follow** command combines commands **docker logs** and |
|
| 17 |
-**docker attach**. It will first return all logs from the beginning and |
|
| 18 |
-then continue streaming new output from the container’s stdout and stderr. |
|
| 19 |
- |
|
| 20 |
-# OPTIONS |
|
| 21 |
-**-f, --follow**=*true*|*false* |
|
| 22 |
- When *true*, follow log output. The default is false. |
|
| 23 |
- |
|
| 24 |
-# HISTORY |
|
| 25 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 26 |
-based on docker.io source material and internal work. |
| 27 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,15 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-port - Lookup the public-facing port which is NAT-ed to PRIVATE_PORT |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker port** CONTAINER PRIVATE_PORT |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-Lookup the public-facing port which is NAT-ed to PRIVATE_PORT |
|
| 12 |
- |
|
| 13 |
-# HISTORY |
|
| 14 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 15 |
-based on docker.io source material and internal work. |
| 16 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,68 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-ps - List containers |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker ps** [**-a**|**--all**=*false*] [**--before**=""] |
|
| 9 |
-[**-l**|**--latest**=*false*] [**-n**=*-1*] [**--no-trunc**=*false*] |
|
| 10 |
-[**-q**|**--quiet**=*false*] [**-s**|**--size**=*false*] |
|
| 11 |
-[**--since**=""] |
|
| 12 |
- |
|
| 13 |
-# DESCRIPTION |
|
| 14 |
- |
|
| 15 |
-List the containers in the local repository. By default this show only |
|
| 16 |
-the running containers. |
|
| 17 |
- |
|
| 18 |
-# OPTIONS |
|
| 19 |
- |
|
| 20 |
-**-a**, **--all**=*true*|*false* |
|
| 21 |
- When true show all containers. Only running containers are shown by |
|
| 22 |
-default. Default is false. |
|
| 23 |
- |
|
| 24 |
-**--before**="" |
|
| 25 |
- Show only container created before Id or Name, include non-running |
|
| 26 |
-ones. |
|
| 27 |
- |
|
| 28 |
-**-l**, **--latest**=*true*|*false* |
|
| 29 |
- When true show only the latest created container, include non-running |
|
| 30 |
-ones. The default is false. |
|
| 31 |
- |
|
| 32 |
-**-n**=NUM |
|
| 33 |
- Show NUM (integer) last created containers, include non-running ones. |
|
| 34 |
-The default is -1 (none) |
|
| 35 |
- |
|
| 36 |
-**--no-trunc**=*true*|*false* |
|
| 37 |
- When true truncate output. Default is false. |
|
| 38 |
- |
|
| 39 |
-**-q**, **--quiet**=*true*|*false* |
|
| 40 |
- When false only display numeric IDs. Default is false. |
|
| 41 |
- |
|
| 42 |
-**-s**, **--size**=*true*|*false* |
|
| 43 |
- When true display container sizes. Default is false. |
|
| 44 |
- |
|
| 45 |
-**--since**="" |
|
| 46 |
- Show only containers created since Id or Name, include non-running ones. |
|
| 47 |
- |
|
| 48 |
-# EXAMPLE |
|
| 49 |
-# Display all containers, including non-running |
|
| 50 |
- |
|
| 51 |
- # docker ps -a |
|
| 52 |
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 53 |
- a87ecb4f327c fedora:20 /bin/sh -c #(nop) MA 20 minutes ago Exit 0 desperate_brattain |
|
| 54 |
- 01946d9d34d8 vpavlin/rhel7:latest /bin/sh -c #(nop) MA 33 minutes ago Exit 0 thirsty_bell |
|
| 55 |
- c1d3b0166030 acffc0358b9e /bin/sh -c yum -y up 2 weeks ago Exit 1 determined_torvalds |
|
| 56 |
- 41d50ecd2f57 fedora:20 /bin/sh -c #(nop) MA 2 weeks ago Exit 0 drunk_pike |
|
| 57 |
- |
|
| 58 |
-# Display only IDs of all containers, including non-running |
|
| 59 |
- |
|
| 60 |
- # docker ps -a -q |
|
| 61 |
- a87ecb4f327c |
|
| 62 |
- 01946d9d34d8 |
|
| 63 |
- c1d3b0166030 |
|
| 64 |
- 41d50ecd2f57 |
|
| 65 |
- |
|
| 66 |
-# HISTORY |
|
| 67 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 68 |
-based on docker.io source material and internal work. |
| 69 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,51 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-pull - Pull an image or a repository from the registry |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker pull** [REGISTRY_PATH/]NAME[:TAG] |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
- |
|
| 12 |
-This command pulls down an image or a repository from the registry. If |
|
| 13 |
-there is more than one image for a repository (e.g. fedora) then all |
|
| 14 |
-images for that repository name are pulled down including any tags. |
|
| 15 |
-It is also possible to specify a non-default registry to pull from. |
|
| 16 |
- |
|
| 17 |
-# EXAMPLES |
|
| 18 |
- |
|
| 19 |
-# Pull a repository with multiple images |
|
| 20 |
- |
|
| 21 |
- $ sudo docker pull fedora |
|
| 22 |
- Pulling repository fedora |
|
| 23 |
- ad57ef8d78d7: Download complete |
|
| 24 |
- 105182bb5e8b: Download complete |
|
| 25 |
- 511136ea3c5a: Download complete |
|
| 26 |
- 73bd853d2ea5: Download complete |
|
| 27 |
- |
|
| 28 |
- $ sudo docker images |
|
| 29 |
- REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE |
|
| 30 |
- fedora rawhide ad57ef8d78d7 5 days ago 359.3 MB |
|
| 31 |
- fedora 20 105182bb5e8b 5 days ago 372.7 MB |
|
| 32 |
- fedora heisenbug 105182bb5e8b 5 days ago 372.7 MB |
|
| 33 |
- fedora latest 105182bb5e8b 5 days ago 372.7 MB |
|
| 34 |
- |
|
| 35 |
-# Pull an image, manually specifying path to the registry and tag |
|
| 36 |
- |
|
| 37 |
- $ sudo docker pull registry.hub.docker.com/fedora:20 |
|
| 38 |
- Pulling repository fedora |
|
| 39 |
- 3f2fed40e4b0: Download complete |
|
| 40 |
- 511136ea3c5a: Download complete |
|
| 41 |
- fd241224e9cf: Download complete |
|
| 42 |
- |
|
| 43 |
- $ sudo docker images |
|
| 44 |
- REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE |
|
| 45 |
- fedora 20 3f2fed40e4b0 4 days ago 372.7 MB |
|
| 46 |
- |
|
| 47 |
- |
|
| 48 |
-# HISTORY |
|
| 49 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 50 |
-based on docker.io source material and internal work. |
|
| 51 |
- |
| 52 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,44 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-push - Push an image or a repository to the registry |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker push** NAME[:TAG] |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-Push an image or a repository to a registry. The default registry is the Docker |
|
| 12 |
-Index located at [index.docker.io](https://index.docker.io/v1/). However the |
|
| 13 |
-image can be pushed to another, perhaps private, registry as demonstrated in |
|
| 14 |
-the example below. |
|
| 15 |
- |
|
| 16 |
-# EXAMPLE |
|
| 17 |
- |
|
| 18 |
-# Pushing a new image to a registry |
|
| 19 |
- |
|
| 20 |
-First save the new image by finding the container ID (using **docker ps**) |
|
| 21 |
-and then committing it to a new image name: |
|
| 22 |
- |
|
| 23 |
- # docker commit c16378f943fe rhel-httpd |
|
| 24 |
- |
|
| 25 |
-Now push the image to the registry using the image ID. In this example |
|
| 26 |
-the registry is on host named registry-host and listening on port 5000. |
|
| 27 |
-Default Docker commands will push to the default `index.docker.io` |
|
| 28 |
-registry. Instead, push to the local registry, which is on a host called |
|
| 29 |
-registry-host*. To do this, tag the image with the host name or IP |
|
| 30 |
-address, and the port of the registry: |
|
| 31 |
- |
|
| 32 |
- # docker tag rhel-httpd registry-host:5000/myadmin/rhel-httpd |
|
| 33 |
- # docker push registry-host:5000/myadmin/rhel-httpd |
|
| 34 |
- |
|
| 35 |
-Check that this worked by running: |
|
| 36 |
- |
|
| 37 |
- # docker images |
|
| 38 |
- |
|
| 39 |
-You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd` |
|
| 40 |
-listed. |
|
| 41 |
- |
|
| 42 |
-# HISTORY |
|
| 43 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 44 |
-based on docker.io source material and internal work. |
| 45 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,21 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-restart - Restart a running container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker restart** [**-t**|**--time**[=*10*]] CONTAINER [CONTAINER...] |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-Restart each container listed. |
|
| 12 |
- |
|
| 13 |
-# OPTIONS |
|
| 14 |
-**-t**, **--time**=NUM |
|
| 15 |
- Number of seconds to try to stop for before killing the container. Once |
|
| 16 |
-killed it will then be restarted. Default=10 |
|
| 17 |
- |
|
| 18 |
-# HISTORY |
|
| 19 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 20 |
-based on docker.io source material and internal work. |
|
| 21 |
- |
| 22 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,56 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
- |
|
| 5 |
-# NAME |
|
| 6 |
- |
|
| 7 |
-docker-rm - Remove one or more containers. |
|
| 8 |
- |
|
| 9 |
-# SYNOPSIS |
|
| 10 |
- |
|
| 11 |
-**docker rm** [**-f**|**--force**[=*false*] [**-l**|**--link**[=*false*] [**-v**| |
|
| 12 |
-**--volumes**[=*false*] |
|
| 13 |
-CONTAINER [CONTAINER...] |
|
| 14 |
- |
|
| 15 |
-# DESCRIPTION |
|
| 16 |
- |
|
| 17 |
-**docker rm** will remove one or more containers from the host node. The |
|
| 18 |
-container name or ID can be used. This does not remove images. You cannot |
|
| 19 |
-remove a running container unless you use the \fB-f\fR option. To see all |
|
| 20 |
-containers on a host use the **docker ps -a** command. |
|
| 21 |
- |
|
| 22 |
-# OPTIONS |
|
| 23 |
- |
|
| 24 |
-**-f**, **--force**=*true*|*false* |
|
| 25 |
- When set to true, force the removal of the container. The default is |
|
| 26 |
-*false*. |
|
| 27 |
- |
|
| 28 |
-**-l**, **--link**=*true*|*false* |
|
| 29 |
- When set to true, remove the specified link and not the underlying |
|
| 30 |
-container. The default is *false*. |
|
| 31 |
- |
|
| 32 |
-**-v**, **--volumes**=*true*|*false* |
|
| 33 |
- When set to true, remove the volumes associated to the container. The |
|
| 34 |
-default is *false*. |
|
| 35 |
- |
|
| 36 |
-# EXAMPLES |
|
| 37 |
- |
|
| 38 |
-##Removing a container using its ID## |
|
| 39 |
- |
|
| 40 |
-To remove a container using its ID, find either from a **docker ps -a** |
|
| 41 |
-command, or use the ID returned from the **docker run** command, or retrieve |
|
| 42 |
-it from a file used to store it using the **docker run --cidfile**: |
|
| 43 |
- |
|
| 44 |
- docker rm abebf7571666 |
|
| 45 |
- |
|
| 46 |
-##Removing a container using the container name## |
|
| 47 |
- |
|
| 48 |
-The name of the container can be found using the **docker ps -a** |
|
| 49 |
-command. The use that name as follows: |
|
| 50 |
- |
|
| 51 |
- docker rm hopeful_morse |
|
| 52 |
- |
|
| 53 |
-# HISTORY |
|
| 54 |
- |
|
| 55 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 56 |
-based on docker.io source material and internal work. |
| 57 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,35 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-rmi \- Remove one or more images. |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
- |
|
| 9 |
-**docker rmi** [**-f**|**--force**[=*false*] IMAGE [IMAGE...] |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
- |
|
| 13 |
-This will remove one or more images from the host node. This does not |
|
| 14 |
-remove images from a registry. You cannot remove an image of a running |
|
| 15 |
-container unless you use the **-f** option. To see all images on a host |
|
| 16 |
-use the **docker images** command. |
|
| 17 |
- |
|
| 18 |
-# OPTIONS |
|
| 19 |
- |
|
| 20 |
-**-f**, **--force**=*true*|*false* |
|
| 21 |
- When set to true, force the removal of the image. The default is |
|
| 22 |
-*false*. |
|
| 23 |
- |
|
| 24 |
-# EXAMPLES |
|
| 25 |
- |
|
| 26 |
-## Removing an image |
|
| 27 |
- |
|
| 28 |
-Here is an example of removing and image: |
|
| 29 |
- |
|
| 30 |
- docker rmi fedora/httpd |
|
| 31 |
- |
|
| 32 |
-# HISTORY |
|
| 33 |
- |
|
| 34 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 35 |
-based on docker.io source material and internal work. |
| 36 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,356 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-run - Run a process in an isolated container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker run** |
|
| 9 |
-[**-a**|**--attach**[=]] [**-c**|**--cpu-shares**[=0] |
|
| 10 |
-[**-m**|**--memory**=*memory-limit*] |
|
| 11 |
-[**--cidfile**=*file*] [**-d**|**--detach**[=*false*]] [**--dns**=*IP-address*] |
|
| 12 |
-[**--name**=*name*] [**-u**|**--user**=*username*|*uid*] |
|
| 13 |
-[**--link**=*name*:*alias*] |
|
| 14 |
-[**-e**|**--env**=*environment*] [**--entrypoint**=*command*] |
|
| 15 |
-[**--expose**=*port*] [**-P**|**--publish-all**[=*false*]] |
|
| 16 |
-[**-p**|**--publish**=*port-mappping*] [**-h**|**--hostname**=*hostname*] |
|
| 17 |
-[**--rm**[=*false*]] [**--privileged**[=*false*]] |
|
| 18 |
-[**-i**|**--interactive**[=*false*]] |
|
| 19 |
-[**-t**|**--tty**[=*false*]] [**--lxc-conf**=*options*] |
|
| 20 |
-[**-n**|**--networking**[=*true*]] |
|
| 21 |
-[**-v**|**--volume**=*volume*] [**--volumes-from**=*container-id*] |
|
| 22 |
-[**-w**|**--workdir**=*directory*] [**--sig-proxy**[=*true*]] |
|
| 23 |
-IMAGE [COMMAND] [ARG...] |
|
| 24 |
- |
|
| 25 |
-# DESCRIPTION |
|
| 26 |
- |
|
| 27 |
-Run a process in a new container. **docker run** starts a process with its own |
|
| 28 |
-file system, its own networking, and its own isolated process tree. The IMAGE |
|
| 29 |
-which starts the process may define defaults related to the process that will be |
|
| 30 |
-run in the container, the networking to expose, and more, but **docker run** |
|
| 31 |
-gives final control to the operator or administrator who starts the container |
|
| 32 |
-from the image. For that reason **docker run** has more options than any other |
|
| 33 |
-Docker command. |
|
| 34 |
- |
|
| 35 |
-If the IMAGE is not already loaded then **docker run** will pull the IMAGE, and |
|
| 36 |
-all image dependencies, from the repository in the same way running **docker |
|
| 37 |
-pull** IMAGE, before it starts the container from that image. |
|
| 38 |
- |
|
| 39 |
-# OPTIONS |
|
| 40 |
- |
|
| 41 |
-**-a**, **--attach**=*stdin*|*stdout*|*stderr* |
|
| 42 |
- Attach to stdin, stdout or stderr. In foreground mode (the default when |
|
| 43 |
-**-d** is not specified), **docker run** can start the process in the container |
|
| 44 |
-and attach the console to the process’s standard input, output, and standard |
|
| 45 |
-error. It can even pretend to be a TTY (this is what most commandline |
|
| 46 |
-executables expect) and pass along signals. The **-a** option can be set for |
|
| 47 |
-each of stdin, stdout, and stderr. |
|
| 48 |
- |
|
| 49 |
-**-c**, **--cpu-shares**=0 |
|
| 50 |
- CPU shares in relative weight. You can increase the priority of a container |
|
| 51 |
-with the -c option. By default, all containers run at the same priority and get |
|
| 52 |
-the same proportion of CPU cycles, but you can tell the kernel to give more |
|
| 53 |
-shares of CPU time to one or more containers when you start them via **docker |
|
| 54 |
-run**. |
|
| 55 |
- |
|
| 56 |
-**--cidfile**=*file* |
|
| 57 |
- Write the container ID to the file specified. |
|
| 58 |
- |
|
| 59 |
- |
|
| 60 |
-**-d**, **-detach**=*true*|*false* |
|
| 61 |
- Detached mode. This runs the container in the background. It outputs the new |
|
| 62 |
-container's ID and any error messages. At any time you can run **docker ps** in |
|
| 63 |
-the other shell to view a list of the running containers. You can reattach to a |
|
| 64 |
-detached container with **docker attach**. If you choose to run a container in |
|
| 65 |
-the detached mode, then you cannot use the **-rm** option. |
|
| 66 |
- |
|
| 67 |
- When attached in the tty mode, you can detach from a running container without |
|
| 68 |
-stopping the process by pressing the keys CTRL-P CTRL-Q. |
|
| 69 |
- |
|
| 70 |
- |
|
| 71 |
-**--dns**=*IP-address* |
|
| 72 |
- Set custom DNS servers. This option can be used to override the DNS |
|
| 73 |
-configuration passed to the container. Typically this is necessary when the |
|
| 74 |
-host DNS configuration is invalid for the container (eg. 127.0.0.1). When this |
|
| 75 |
-is the case the **-dns** flags is necessary for every run. |
|
| 76 |
- |
|
| 77 |
- |
|
| 78 |
-**-e**, **-env**=*environment* |
|
| 79 |
- Set environment variables. This option allows you to specify arbitrary |
|
| 80 |
-environment variables that are available for the process that will be launched |
|
| 81 |
-inside of the container. |
|
| 82 |
- |
|
| 83 |
- |
|
| 84 |
-**--entrypoint**=*command* |
|
| 85 |
- This option allows you to overwrite the default entrypoint of the image that |
|
| 86 |
-is set in the Dockerfile. The ENTRYPOINT of an image is similar to a COMMAND |
|
| 87 |
-because it specifies what executable to run when the container starts, but it is |
|
| 88 |
-(purposely) more difficult to override. The ENTRYPOINT gives a container its |
|
| 89 |
-default nature or behavior, so that when you set an ENTRYPOINT you can run the |
|
| 90 |
-container as if it were that binary, complete with default options, and you can |
|
| 91 |
-pass in more options via the COMMAND. But, sometimes an operator may want to run |
|
| 92 |
-something else inside the container, so you can override the default ENTRYPOINT |
|
| 93 |
-at runtime by using a **--entrypoint** and a string to specify the new |
|
| 94 |
-ENTRYPOINT. |
|
| 95 |
- |
|
| 96 |
-**--expose**=*port* |
|
| 97 |
- Expose a port from the container without publishing it to your host. A |
|
| 98 |
-containers port can be exposed to other containers in three ways: 1) The |
|
| 99 |
-developer can expose the port using the EXPOSE parameter of the Dockerfile, 2) |
|
| 100 |
-the operator can use the **--expose** option with **docker run**, or 3) the |
|
| 101 |
-container can be started with the **--link**. |
|
| 102 |
- |
|
| 103 |
-**-m**, **-memory**=*memory-limit* |
|
| 104 |
- Allows you to constrain the memory available to a container. If the host |
|
| 105 |
-supports swap memory, then the -m memory setting can be larger than physical |
|
| 106 |
-RAM. If a limit of 0 is specified, the container's memory is not limited. The |
|
| 107 |
-memory limit format: <number><optional unit>, where unit = b, k, m or g. |
|
| 108 |
- |
|
| 109 |
-**-P**, **-publish-all**=*true*|*false* |
|
| 110 |
- When set to true publish all exposed ports to the host interfaces. The |
|
| 111 |
-default is false. If the operator uses -P (or -p) then Docker will make the |
|
| 112 |
-exposed port accessible on the host and the ports will be available to any |
|
| 113 |
-client that can reach the host. To find the map between the host ports and the |
|
| 114 |
-exposed ports, use **docker port**. |
|
| 115 |
- |
|
| 116 |
- |
|
| 117 |
-**-p**, **-publish**=[] |
|
| 118 |
- Publish a container's port to the host (format: ip:hostPort:containerPort | |
|
| 119 |
-ip::containerPort | hostPort:containerPort) (use **docker port** to see the |
|
| 120 |
-actual mapping) |
|
| 121 |
- |
|
| 122 |
- |
|
| 123 |
-**-h**, **-hostname**=*hostname* |
|
| 124 |
- Sets the container host name that is available inside the container. |
|
| 125 |
- |
|
| 126 |
- |
|
| 127 |
-**-i**, **-interactive**=*true*|*false* |
|
| 128 |
- When set to true, keep stdin open even if not attached. The default is false. |
|
| 129 |
- |
|
| 130 |
- |
|
| 131 |
-**--link**=*name*:*alias* |
|
| 132 |
- Add link to another container. The format is name:alias. If the operator |
|
| 133 |
-uses **--link** when starting the new client container, then the client |
|
| 134 |
-container can access the exposed port via a private networking interface. Docker |
|
| 135 |
-will set some environment variables in the client container to help indicate |
|
| 136 |
-which interface and port to use. |
|
| 137 |
- |
|
| 138 |
- |
|
| 139 |
-**-n**, **-networking**=*true*|*false* |
|
| 140 |
- By default, all containers have networking enabled (true) and can make |
|
| 141 |
-outgoing connections. The operator can disable networking with **--networking** |
|
| 142 |
-to false. This disables all incoming and outgoing networking. In cases like this |
|
| 143 |
-, I/O can only be performed through files or by using STDIN/STDOUT. |
|
| 144 |
- |
|
| 145 |
-Also by default, the container will use the same DNS servers as the host. The |
|
| 146 |
-operator may override this with **-dns**. |
|
| 147 |
- |
|
| 148 |
- |
|
| 149 |
-**--name**=*name* |
|
| 150 |
- Assign a name to the container. The operator can identify a container in |
|
| 151 |
-three ways: |
|
| 152 |
- |
|
| 153 |
- UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”) |
|
| 154 |
- UUID short identifier (“f78375b1c487”) |
|
| 155 |
- Name (“jonah”) |
|
| 156 |
- |
|
| 157 |
-The UUID identifiers come from the Docker daemon, and if a name is not assigned |
|
| 158 |
-to the container with **--name** then the daemon will also generate a random |
|
| 159 |
-string name. The name is useful when defining links (see **--link**) (or any |
|
| 160 |
-other place you need to identify a container). This works for both background |
|
| 161 |
-and foreground Docker containers. |
|
| 162 |
- |
|
| 163 |
- |
|
| 164 |
-**--privileged**=*true*|*false* |
|
| 165 |
- Give extended privileges to this container. By default, Docker containers are |
|
| 166 |
-“unprivileged” (=false) and cannot, for example, run a Docker daemon inside the |
|
| 167 |
-Docker container. This is because by default a container is not allowed to |
|
| 168 |
-access any devices. A “privileged” container is given access to all devices. |
|
| 169 |
- |
|
| 170 |
-When the operator executes **docker run --privileged**, Docker will enable access |
|
| 171 |
-to all devices on the host as well as set some configuration in AppArmor to |
|
| 172 |
-allow the container nearly all the same access to the host as processes running |
|
| 173 |
-outside of a container on the host. |
|
| 174 |
- |
|
| 175 |
- |
|
| 176 |
-**--rm**=*true*|*false* |
|
| 177 |
- If set to *true* the container is automatically removed when it exits. The |
|
| 178 |
-default is *false*. This option is incompatible with **-d**. |
|
| 179 |
- |
|
| 180 |
- |
|
| 181 |
-**--sig-proxy**=*true*|*false* |
|
| 182 |
- When set to true, proxify all received signals to the process (even in |
|
| 183 |
-non-tty mode). The default is true. |
|
| 184 |
- |
|
| 185 |
- |
|
| 186 |
-**-t**, **-tty**=*true*|*false* |
|
| 187 |
- When set to true Docker can allocate a pseudo-tty and attach to the standard |
|
| 188 |
-input of any container. This can be used, for example, to run a throwaway |
|
| 189 |
-interactive shell. The default is value is false. |
|
| 190 |
- |
|
| 191 |
- |
|
| 192 |
-**-u**, **-user**=*username*,*uid* |
|
| 193 |
- Set a username or UID for the container. |
|
| 194 |
- |
|
| 195 |
- |
|
| 196 |
-**-v**, **-volume**=*volume*[:ro|:rw] |
|
| 197 |
- Bind mount a volume to the container. |
|
| 198 |
- |
|
| 199 |
-The **-v** option can be used one or |
|
| 200 |
-more times to add one or more mounts to a container. These mounts can then be |
|
| 201 |
-used in other containers using the **--volumes-from** option. |
|
| 202 |
- |
|
| 203 |
-The volume may be optionally suffixed with :ro or :rw to mount the volumes in |
|
| 204 |
-read-only or read-write mode, respectively. By default, the volumes are mounted |
|
| 205 |
-read-write. See examples. |
|
| 206 |
- |
|
| 207 |
-**--volumes-from**=*container-id*[:ro|:rw] |
|
| 208 |
- Will mount volumes from the specified container identified by container-id. |
|
| 209 |
-Once a volume is mounted in a one container it can be shared with other |
|
| 210 |
-containers using the **--volumes-from** option when running those other |
|
| 211 |
-containers. The volumes can be shared even if the original container with the |
|
| 212 |
-mount is not running. |
|
| 213 |
- |
|
| 214 |
-The container ID may be optionally suffixed with :ro or |
|
| 215 |
-:rw to mount the volumes in read-only or read-write mode, respectively. By |
|
| 216 |
-default, the volumes are mounted in the same mode (read write or read only) as |
|
| 217 |
-the reference container. |
|
| 218 |
- |
|
| 219 |
- |
|
| 220 |
-**-w**, **-workdir**=*directory* |
|
| 221 |
- Working directory inside the container. The default working directory for |
|
| 222 |
-running binaries within a container is the root directory (/). The developer can |
|
| 223 |
-set a different default with the Dockerfile WORKDIR instruction. The operator |
|
| 224 |
-can override the working directory by using the **-w** option. |
|
| 225 |
- |
|
| 226 |
- |
|
| 227 |
-**IMAGE** |
|
| 228 |
- The image name or ID. |
|
| 229 |
- |
|
| 230 |
- |
|
| 231 |
-**COMMAND** |
|
| 232 |
- The command or program to run inside the image. |
|
| 233 |
- |
|
| 234 |
- |
|
| 235 |
-**ARG** |
|
| 236 |
- The arguments for the command to be run in the container. |
|
| 237 |
- |
|
| 238 |
-# EXAMPLES |
|
| 239 |
- |
|
| 240 |
-## Exposing log messages from the container to the host's log |
|
| 241 |
- |
|
| 242 |
-If you want messages that are logged in your container to show up in the host's |
|
| 243 |
-syslog/journal then you should bind mount the /dev/log directory as follows. |
|
| 244 |
- |
|
| 245 |
- # docker run -v /dev/log:/dev/log -i -t fedora /bin/bash |
|
| 246 |
- |
|
| 247 |
-From inside the container you can test this by sending a message to the log. |
|
| 248 |
- |
|
| 249 |
- (bash)# logger "Hello from my container" |
|
| 250 |
- |
|
| 251 |
-Then exit and check the journal. |
|
| 252 |
- |
|
| 253 |
- # exit |
|
| 254 |
- |
|
| 255 |
- # journalctl -b | grep Hello |
|
| 256 |
- |
|
| 257 |
-This should list the message sent to logger. |
|
| 258 |
- |
|
| 259 |
-## Attaching to one or more from STDIN, STDOUT, STDERR |
|
| 260 |
- |
|
| 261 |
-If you do not specify -a then Docker will attach everything (stdin,stdout,stderr) |
|
| 262 |
-. You can specify to which of the three standard streams (stdin, stdout, stderr) |
|
| 263 |
-you’d like to connect instead, as in: |
|
| 264 |
- |
|
| 265 |
- # docker run -a stdin -a stdout -i -t fedora /bin/bash |
|
| 266 |
- |
|
| 267 |
-## Linking Containers |
|
| 268 |
- |
|
| 269 |
-The link feature allows multiple containers to communicate with each other. For |
|
| 270 |
-example, a container whose Dockerfile has exposed port 80 can be run and named |
|
| 271 |
-as follows: |
|
| 272 |
- |
|
| 273 |
- # docker run --name=link-test -d -i -t fedora/httpd |
|
| 274 |
- |
|
| 275 |
-A second container, in this case called linker, can communicate with the httpd |
|
| 276 |
-container, named link-test, by running with the **--link=<name>:<alias>** |
|
| 277 |
- |
|
| 278 |
- # docker run -t -i --link=link-test:lt --name=linker fedora /bin/bash |
|
| 279 |
- |
|
| 280 |
-Now the container linker is linked to container link-test with the alias lt. |
|
| 281 |
-Running the **env** command in the linker container shows environment variables |
|
| 282 |
- with the LT (alias) context (**LT_**) |
|
| 283 |
- |
|
| 284 |
- # env |
|
| 285 |
- HOSTNAME=668231cb0978 |
|
| 286 |
- TERM=xterm |
|
| 287 |
- LT_PORT_80_TCP=tcp://172.17.0.3:80 |
|
| 288 |
- LT_PORT_80_TCP_PORT=80 |
|
| 289 |
- LT_PORT_80_TCP_PROTO=tcp |
|
| 290 |
- LT_PORT=tcp://172.17.0.3:80 |
|
| 291 |
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
|
| 292 |
- PWD=/ |
|
| 293 |
- LT_NAME=/linker/lt |
|
| 294 |
- SHLVL=1 |
|
| 295 |
- HOME=/ |
|
| 296 |
- LT_PORT_80_TCP_ADDR=172.17.0.3 |
|
| 297 |
- _=/usr/bin/env |
|
| 298 |
- |
|
| 299 |
-When linking two containers Docker will use the exposed ports of the container |
|
| 300 |
-to create a secure tunnel for the parent to access. |
|
| 301 |
- |
|
| 302 |
- |
|
| 303 |
-## Mapping Ports for External Usage |
|
| 304 |
- |
|
| 305 |
-The exposed port of an application can be mapped to a host port using the **-p** |
|
| 306 |
-flag. For example a httpd port 80 can be mapped to the host port 8080 using the |
|
| 307 |
-following: |
|
| 308 |
- |
|
| 309 |
- # docker run -p 8080:80 -d -i -t fedora/httpd |
|
| 310 |
- |
|
| 311 |
-## Creating and Mounting a Data Volume Container |
|
| 312 |
- |
|
| 313 |
-Many applications require the sharing of persistent data across several |
|
| 314 |
-containers. Docker allows you to create a Data Volume Container that other |
|
| 315 |
-containers can mount from. For example, create a named container that contains |
|
| 316 |
-directories /var/volume1 and /tmp/volume2. The image will need to contain these |
|
| 317 |
-directories so a couple of RUN mkdir instructions might be required for you |
|
| 318 |
-fedora-data image: |
|
| 319 |
- |
|
| 320 |
- # docker run --name=data -v /var/volume1 -v /tmp/volume2 -i -t fedora-data true |
|
| 321 |
- # docker run --volumes-from=data --name=fedora-container1 -i -t fedora bash |
|
| 322 |
- |
|
| 323 |
-Multiple --volumes-from parameters will bring together multiple data volumes from |
|
| 324 |
-multiple containers. And it's possible to mount the volumes that came from the |
|
| 325 |
-DATA container in yet another container via the fedora-container1 intermidiery |
|
| 326 |
-container, allowing to abstract the actual data source from users of that data: |
|
| 327 |
- |
|
| 328 |
- # docker run --volumes-from=fedora-container1 --name=fedora-container2 -i -t fedora bash |
|
| 329 |
- |
|
| 330 |
-## Mounting External Volumes |
|
| 331 |
- |
|
| 332 |
-To mount a host directory as a container volume, specify the absolute path to |
|
| 333 |
-the directory and the absolute path for the container directory separated by a |
|
| 334 |
-colon: |
|
| 335 |
- |
|
| 336 |
- # docker run -v /var/db:/data1 -i -t fedora bash |
|
| 337 |
- |
|
| 338 |
-When using SELinux, be aware that the host has no knowledge of container SELinux |
|
| 339 |
-policy. Therefore, in the above example, if SELinux policy is enforced, the |
|
| 340 |
-`/var/db` directory is not writable to the container. A "Permission Denied" |
|
| 341 |
-message will occur and an avc: message in the host's syslog. |
|
| 342 |
- |
|
| 343 |
- |
|
| 344 |
-To work around this, at time of writing this man page, the following command |
|
| 345 |
-needs to be run in order for the proper SELinux policy type label to be attached |
|
| 346 |
-to the host directory: |
|
| 347 |
- |
|
| 348 |
- # chcon -Rt svirt_sandbox_file_t /var/db |
|
| 349 |
- |
|
| 350 |
- |
|
| 351 |
-Now, writing to the /data1 volume in the container will be allowed and the |
|
| 352 |
-changes will also be reflected on the host in /var/db. |
|
| 353 |
- |
|
| 354 |
-# HISTORY |
|
| 355 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 356 |
-based on docker.io source material and internal work. |
| 357 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,35 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-save - Save an image to a tar archive (streamed to STDOUT by default) |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker save** [**-o**|**--output**=""] IMAGE |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-Produces a tarred repository to the standard output stream. Contains all |
|
| 12 |
-parent layers, and all tags + versions, or specified repo:tag. |
|
| 13 |
- |
|
| 14 |
-Stream to a file instead of STDOUT by using **-o**. |
|
| 15 |
- |
|
| 16 |
-# OPTIONS |
|
| 17 |
-**-o**, **--output**="" |
|
| 18 |
- Write to an file, instead of STDOUT |
|
| 19 |
- |
|
| 20 |
-# EXAMPLE |
|
| 21 |
- |
|
| 22 |
-Save all fedora repository images to a fedora-all.tar and save the latest |
|
| 23 |
-fedora image to a fedora-latest.tar: |
|
| 24 |
- |
|
| 25 |
- $ sudo docker save fedora > fedora-all.tar |
|
| 26 |
- $ sudo docker save --output=fedora-latest.tar fedora:latest |
|
| 27 |
- $ ls -sh fedora-all.tar |
|
| 28 |
- 721M fedora-all.tar |
|
| 29 |
- $ ls -sh fedora-latest.tar |
|
| 30 |
- 367M fedora-latest.tar |
|
| 31 |
- |
|
| 32 |
-# HISTORY |
|
| 33 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 34 |
-based on docker.io source material and internal work. |
|
| 35 |
- |
| 36 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,55 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-search - Search the docker index for images |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker search** **--no-trunc**[=*false*] **--automated**[=*false*] |
|
| 9 |
- **-s**|**--stars**[=*0*] TERM |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
- |
|
| 13 |
-Search an index for an image with that matches the term TERM. The table |
|
| 14 |
-of images returned displays the name, description (truncated by default), |
|
| 15 |
-number of stars awarded, whether the image is official, and whether it |
|
| 16 |
-is automated. |
|
| 17 |
- |
|
| 18 |
-# OPTIONS |
|
| 19 |
-**--no-trunc**=*true*|*false* |
|
| 20 |
- When true display the complete description. The default is false. |
|
| 21 |
- |
|
| 22 |
-**-s**, **--stars**=NUM |
|
| 23 |
- Only displays with at least NUM (integer) stars. I.e. only those images |
|
| 24 |
-ranked >=NUM. |
|
| 25 |
- |
|
| 26 |
-**--automated**=*true*|*false* |
|
| 27 |
- When true only show automated builds. The default is false. |
|
| 28 |
- |
|
| 29 |
-# EXAMPLE |
|
| 30 |
- |
|
| 31 |
-## Search the registry for ranked images |
|
| 32 |
- |
|
| 33 |
-Search the registry for the term 'fedora' and only display those images |
|
| 34 |
-ranked 3 or higher: |
|
| 35 |
- |
|
| 36 |
- $ sudo docker search -s 3 fedora |
|
| 37 |
- NAME DESCRIPTION STARS OFFICIAL AUTOMATED |
|
| 38 |
- mattdm/fedora A basic Fedora image corresponding roughly... 50 |
|
| 39 |
- fedora (Semi) Official Fedora base image. 38 |
|
| 40 |
- mattdm/fedora-small A small Fedora image on which to build. Co... 8 |
|
| 41 |
- goldmann/wildfly A WildFly application server running on a ... 3 [OK] |
|
| 42 |
- |
|
| 43 |
-## Search the registry for automated images |
|
| 44 |
- |
|
| 45 |
-Search the registry for the term 'fedora' and only display automated images |
|
| 46 |
-ranked 1 or higher: |
|
| 47 |
- |
|
| 48 |
- $ sudo docker search -s 1 -t fedora |
|
| 49 |
- NAME DESCRIPTION STARS OFFICIAL AUTOMATED |
|
| 50 |
- goldmann/wildfly A WildFly application server running on a ... 3 [OK] |
|
| 51 |
- tutum/fedora-20 Fedora 20 image with SSH access. For the r... 1 [OK] |
|
| 52 |
- |
|
| 53 |
-# HISTORY |
|
| 54 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 55 |
-based on docker.io source material and internal work. |
| 56 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,29 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-start - Restart a stopped container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker start** [**a**|**--attach**[=*false*]] [**-i**|**--interactive** |
|
| 9 |
-[=*true*] CONTAINER [CONTAINER...] |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
- |
|
| 13 |
-Start a stopped container. |
|
| 14 |
- |
|
| 15 |
-# OPTION |
|
| 16 |
-**-a**, **--attach**=*true*|*false* |
|
| 17 |
- When true attach to container's stdout/stderr and forward all signals to |
|
| 18 |
-the process |
|
| 19 |
- |
|
| 20 |
-**-i**, **--interactive**=*true*|*false* |
|
| 21 |
- When true attach to container's stdin |
|
| 22 |
- |
|
| 23 |
-# NOTES |
|
| 24 |
-If run on a started container, start takes no action and succeeds |
|
| 25 |
-unconditionally. |
|
| 26 |
- |
|
| 27 |
-# HISTORY |
|
| 28 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 29 |
-based on docker.io source material and internal work. |
| 30 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,22 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-stop - Stop a running container |
|
| 6 |
- grace period) |
|
| 7 |
- |
|
| 8 |
-# SYNOPSIS |
|
| 9 |
-**docker stop** [**-t**|**--time**[=*10*]] CONTAINER [CONTAINER...] |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
-Stop a running container (Send SIGTERM, and then SIGKILL after |
|
| 13 |
- grace period) |
|
| 14 |
- |
|
| 15 |
-# OPTIONS |
|
| 16 |
-**-t**, **--time**=NUM |
|
| 17 |
- Wait NUM number of seconds for the container to stop before killing it. |
|
| 18 |
-The default is 10 seconds. |
|
| 19 |
- |
|
| 20 |
-# HISTORY |
|
| 21 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 22 |
-based on docker.io source material and internal work. |
| 23 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,52 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-tag - Tag an image in the repository |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker tag** [**-f**|**--force**[=*false*] |
|
| 9 |
-IMAGE [REGISTRYHOST/][USERNAME/]NAME[:TAG] |
|
| 10 |
- |
|
| 11 |
-# DESCRIPTION |
|
| 12 |
-This will give a new alias to an image in the repository. This refers to the |
|
| 13 |
-entire image name including the optional TAG after the ':'. |
|
| 14 |
- |
|
| 15 |
-# "OPTIONS" |
|
| 16 |
-**-f**, **--force**=*true*|*false* |
|
| 17 |
- When set to true, force the alias. The default is *false*. |
|
| 18 |
- |
|
| 19 |
-**REGISTRYHOST** |
|
| 20 |
- The hostname of the registry if required. This may also include the port |
|
| 21 |
-separated by a ':' |
|
| 22 |
- |
|
| 23 |
-**USERNAME** |
|
| 24 |
- The username or other qualifying identifier for the image. |
|
| 25 |
- |
|
| 26 |
-**NAME** |
|
| 27 |
- The image name. |
|
| 28 |
- |
|
| 29 |
-**TAG** |
|
| 30 |
- The tag you are assigning to the image. Though this is arbitrary it is |
|
| 31 |
-recommended to be used for a version to disinguish images with the same name. |
|
| 32 |
-Note that here TAG is a part of the overall name or "tag". |
|
| 33 |
- |
|
| 34 |
-# EXAMPLES |
|
| 35 |
- |
|
| 36 |
-## Giving an image a new alias |
|
| 37 |
- |
|
| 38 |
-Here is an example of aliasing an image (e.g. 0e5574283393) as "httpd" and |
|
| 39 |
-tagging it into the "fedora" repository with "version1.0": |
|
| 40 |
- |
|
| 41 |
- docker tag 0e5574283393 fedora/httpd:version1.0 |
|
| 42 |
- |
|
| 43 |
-## Tagging an image for a private repository |
|
| 44 |
- |
|
| 45 |
-To push an image to an private registry and not the central Docker |
|
| 46 |
-registry you must tag it with the registry hostname and port (if needed). |
|
| 47 |
- |
|
| 48 |
- docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0 |
|
| 49 |
- |
|
| 50 |
-# HISTORY |
|
| 51 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 52 |
-based on docker.io source material and internal work. |
| 53 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,27 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-top - Lookup the running processes of a container |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker top** CONTAINER [ps-OPTION] |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
- |
|
| 12 |
-Look up the running process of the container. ps-OPTION can be any of the |
|
| 13 |
- options you would pass to a Linux ps command. |
|
| 14 |
- |
|
| 15 |
-# EXAMPLE |
|
| 16 |
- |
|
| 17 |
-Run **docker top** with the ps option of -x: |
|
| 18 |
- |
|
| 19 |
- $ sudo docker top 8601afda2b -x |
|
| 20 |
- PID TTY STAT TIME COMMAND |
|
| 21 |
- 16623 ? Ss 0:00 sleep 99999 |
|
| 22 |
- |
|
| 23 |
- |
|
| 24 |
-# HISTORY |
|
| 25 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 26 |
-based on docker.io source material and internal work. |
|
| 27 |
- |
| 28 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,23 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker-wait - Block until a container stops, then print its exit code. |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker wait** CONTAINER [CONTAINER...] |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-Block until a container stops, then print its exit code. |
|
| 12 |
- |
|
| 13 |
-#EXAMPLE |
|
| 14 |
- |
|
| 15 |
- $ sudo docker run -d fedora sleep 99 |
|
| 16 |
- 079b83f558a2bc52ecad6b2a5de13622d584e6bb1aea058c11b36511e85e7622 |
|
| 17 |
- $ sudo docker wait 079b83f558a2bc |
|
| 18 |
- 0 |
|
| 19 |
- |
|
| 20 |
-# HISTORY |
|
| 21 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 22 |
-based on docker.io source material and internal work. |
|
| 23 |
- |
| 24 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,187 +0,0 @@ |
| 1 |
-% DOCKER(1) Docker User Manuals |
|
| 2 |
-% William Henry |
|
| 3 |
-% APRIL 2014 |
|
| 4 |
-# NAME |
|
| 5 |
-docker \- Docker image and container command line interface |
|
| 6 |
- |
|
| 7 |
-# SYNOPSIS |
|
| 8 |
-**docker** [OPTIONS] COMMAND [arg...] |
|
| 9 |
- |
|
| 10 |
-# DESCRIPTION |
|
| 11 |
-**docker** has two distinct functions. It is used for starting the Docker |
|
| 12 |
-daemon and to run the CLI (i.e., to command the daemon to manage images, |
|
| 13 |
-containers etc.) So **docker** is both a server, as a daemon, and a client |
|
| 14 |
-to the daemon, through the CLI. |
|
| 15 |
- |
|
| 16 |
-To run the Docker daemon you do not specify any of the commands listed below but |
|
| 17 |
-must specify the **-d** option. The other options listed below are for the |
|
| 18 |
-daemon only. |
|
| 19 |
- |
|
| 20 |
-The Docker CLI has over 30 commands. The commands are listed below and each has |
|
| 21 |
-its own man page which explain usage and arguments. |
|
| 22 |
- |
|
| 23 |
-To see the man page for a command run **man docker <command>**. |
|
| 24 |
- |
|
| 25 |
-# OPTIONS |
|
| 26 |
-**-D**=*true*|*false* |
|
| 27 |
- Enable debug mode. Default is false. |
|
| 28 |
- |
|
| 29 |
-**-H**, **--host**=[unix:///var/run/docker.sock]: tcp://[host:port] to bind or |
|
| 30 |
-unix://[/path/to/socket] to use. |
|
| 31 |
- The socket(s) to bind to in daemon mode specified using one or more |
|
| 32 |
- tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd. |
|
| 33 |
- |
|
| 34 |
-**--api-enable-cors**=*true*|*false* |
|
| 35 |
- Enable CORS headers in the remote API. Default is false. |
|
| 36 |
- |
|
| 37 |
-**-b**="" |
|
| 38 |
- Attach containers to a pre\-existing network bridge; use 'none' to disable container networking |
|
| 39 |
- |
|
| 40 |
-**--bip**="" |
|
| 41 |
- Use the provided CIDR notation address for the dynamically created bridge (docker0); Mutually exclusive of \-b |
|
| 42 |
- |
|
| 43 |
-**-d**=*true*|*false* |
|
| 44 |
- Enable daemon mode. Default is false. |
|
| 45 |
- |
|
| 46 |
-**--dns**="" |
|
| 47 |
- Force Docker to use specific DNS servers |
|
| 48 |
- |
|
| 49 |
-**-g**="" |
|
| 50 |
- Path to use as the root of the Docker runtime. Default is `/var/lib/docker`. |
|
| 51 |
- |
|
| 52 |
-**--icc**=*true*|*false* |
|
| 53 |
- Enable inter\-container communication. Default is true. |
|
| 54 |
- |
|
| 55 |
-**--ip**="" |
|
| 56 |
- Default IP address to use when binding container ports. Default is `0.0.0.0`. |
|
| 57 |
- |
|
| 58 |
-**--iptables**=*true*|*false* |
|
| 59 |
- Disable Docker's addition of iptables rules. Default is true. |
|
| 60 |
- |
|
| 61 |
-**--mtu**=VALUE |
|
| 62 |
- Set the containers network mtu. Default is `1500`. |
|
| 63 |
- |
|
| 64 |
-**-p**="" |
|
| 65 |
- Path to use for daemon PID file. Default is `/var/run/docker.pid` |
|
| 66 |
- |
|
| 67 |
-**-r**=*true*|*false* |
|
| 68 |
- Restart previously running containers. Default is true. |
|
| 69 |
- |
|
| 70 |
-**-s**="" |
|
| 71 |
- Force the Docker runtime to use a specific storage driver. |
|
| 72 |
- |
|
| 73 |
-**-v**=*true*|*false* |
|
| 74 |
- Print version information and quit. Default is false. |
|
| 75 |
- |
|
| 76 |
-**--selinux-enabled**=*true*|*false* |
|
| 77 |
- Enable selinux support. Default is false. |
|
| 78 |
- |
|
| 79 |
-# COMMANDS |
|
| 80 |
-**docker-attach(1)** |
|
| 81 |
- Attach to a running container |
|
| 82 |
- |
|
| 83 |
-**docker-build(1)** |
|
| 84 |
- Build an image from a Dockerfile |
|
| 85 |
- |
|
| 86 |
-**docker-commit(1)** |
|
| 87 |
- Create a new image from a container's changes |
|
| 88 |
- |
|
| 89 |
-**docker-cp(1)** |
|
| 90 |
- Copy files/folders from the containers filesystem to the host at path |
|
| 91 |
- |
|
| 92 |
-**docker-diff(1)** |
|
| 93 |
- Inspect changes on a container's filesystem |
|
| 94 |
- |
|
| 95 |
- |
|
| 96 |
-**docker-events(1)** |
|
| 97 |
- Get real time events from the server |
|
| 98 |
- |
|
| 99 |
-**docker-export(1)** |
|
| 100 |
- Stream the contents of a container as a tar archive |
|
| 101 |
- |
|
| 102 |
-**docker-history(1)** |
|
| 103 |
- Show the history of an image |
|
| 104 |
- |
|
| 105 |
-**docker-images(1)** |
|
| 106 |
- List images |
|
| 107 |
- |
|
| 108 |
-**docker-import(1)** |
|
| 109 |
- Create a new filesystem image from the contents of a tarball |
|
| 110 |
- |
|
| 111 |
-**docker-info(1)** |
|
| 112 |
- Display system-wide information |
|
| 113 |
- |
|
| 114 |
-**docker-inspect(1)** |
|
| 115 |
- Return low-level information on a container |
|
| 116 |
- |
|
| 117 |
-**docker-kill(1)** |
|
| 118 |
- Kill a running container (which includes the wrapper process and everything |
|
| 119 |
-inside it) |
|
| 120 |
- |
|
| 121 |
-**docker-load(1)** |
|
| 122 |
- Load an image from a tar archive |
|
| 123 |
- |
|
| 124 |
-**docker-login(1)** |
|
| 125 |
- Register or Login to a Docker registry server |
|
| 126 |
- |
|
| 127 |
-**docker-logs(1)** |
|
| 128 |
- Fetch the logs of a container |
|
| 129 |
- |
|
| 130 |
-**docker-port(1)** |
|
| 131 |
- Lookup the public-facing port which is NAT-ed to PRIVATE_PORT |
|
| 132 |
- |
|
| 133 |
-**docker-ps(1)** |
|
| 134 |
- List containers |
|
| 135 |
- |
|
| 136 |
-**docker-pull(1)** |
|
| 137 |
- Pull an image or a repository from a Docker registry server |
|
| 138 |
- |
|
| 139 |
-**docker-push(1)** |
|
| 140 |
- Push an image or a repository to a Docker registry server |
|
| 141 |
- |
|
| 142 |
-**docker-restart(1)** |
|
| 143 |
- Restart a running container |
|
| 144 |
- |
|
| 145 |
-**docker-rm(1)** |
|
| 146 |
- Remove one or more containers |
|
| 147 |
- |
|
| 148 |
-**docker-rmi(1)** |
|
| 149 |
- Remove one or more images |
|
| 150 |
- |
|
| 151 |
-**docker-run(1)** |
|
| 152 |
- Run a command in a new container |
|
| 153 |
- |
|
| 154 |
-**docker-save(1)** |
|
| 155 |
- Save an image to a tar archive |
|
| 156 |
- |
|
| 157 |
-**docker-search(1)** |
|
| 158 |
- Search for an image in the Docker index |
|
| 159 |
- |
|
| 160 |
-**docker-start(1)** |
|
| 161 |
- Start a stopped container |
|
| 162 |
- |
|
| 163 |
-**docker-stop(1)** |
|
| 164 |
- Stop a running container |
|
| 165 |
- |
|
| 166 |
-**docker-tag(1)** |
|
| 167 |
- Tag an image into a repository |
|
| 168 |
- |
|
| 169 |
-**docker-top(1)** |
|
| 170 |
- Lookup the running processes of a container |
|
| 171 |
- |
|
| 172 |
-**version** |
|
| 173 |
- Show the Docker version information |
|
| 174 |
- |
|
| 175 |
-**docker-wait(1)** |
|
| 176 |
- Block until a container stops, then print its exit code |
|
| 177 |
- |
|
| 178 |
-# EXAMPLES |
|
| 179 |
- |
|
| 180 |
-For specific examples please see the man page for the specific Docker command. |
|
| 181 |
-For example: |
|
| 182 |
- |
|
| 183 |
- man docker run |
|
| 184 |
- |
|
| 185 |
-# HISTORY |
|
| 186 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) based |
|
| 187 |
- on docker.io source material and internal work. |
| 188 | 1 |
deleted file mode 100755 |
| ... | ... |
@@ -1,22 +0,0 @@ |
| 1 |
-#!/bin/bash |
|
| 2 |
-set -e |
|
| 3 |
- |
|
| 4 |
-# get into this script's directory |
|
| 5 |
-cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" |
|
| 6 |
- |
|
| 7 |
-[ "$1" = '-q' ] || {
|
|
| 8 |
- set -x |
|
| 9 |
- pwd |
|
| 10 |
-} |
|
| 11 |
- |
|
| 12 |
-for FILE in *.md; do |
|
| 13 |
- base="$(basename "$FILE")" |
|
| 14 |
- name="${base%.md}"
|
|
| 15 |
- num="${name##*.}"
|
|
| 16 |
- if [ -z "$num" -o "$name" = "$num" ]; then |
|
| 17 |
- # skip files that aren't of the format xxxx.N.md (like README.md) |
|
| 18 |
- continue |
|
| 19 |
- fi |
|
| 20 |
- mkdir -p "../man${num}"
|
|
| 21 |
- pandoc -s -t man "$FILE" -o "../man${num}/${name}"
|
|
| 22 |
-done |
| 23 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,56 +0,0 @@ |
| 1 |
-.\" Process this file with |
|
| 2 |
-.\" nroff -man -Tascii docker-attach.1 |
|
| 3 |
-.\" |
|
| 4 |
-.TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker" |
|
| 5 |
-.SH NAME |
|
| 6 |
-docker-attach \- Attach to a running container |
|
| 7 |
-.SH SYNOPSIS |
|
| 8 |
-.B docker attach |
|
| 9 |
-\fB--no-stdin\fR[=\fIfalse\fR] |
|
| 10 |
-\fB--sig-proxy\fR[=\fItrue\fR] |
|
| 11 |
-container |
|
| 12 |
-.SH DESCRIPTION |
|
| 13 |
-If you \fBdocker run\fR a container in detached mode (\fB-d\fR), you can reattach to the detached container with \fBdocker attach\fR using the container's ID or name. |
|
| 14 |
-.sp |
|
| 15 |
-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. |
|
| 16 |
-.SH "OPTIONS" |
|
| 17 |
-.TP |
|
| 18 |
-.B --no-stdin=\fItrue\fR|\fIfalse\fR: |
|
| 19 |
-When set to true, do not attach to stdin. The default is \fIfalse\fR. |
|
| 20 |
-.TP |
|
| 21 |
-.B --sig-proxy=\fItrue\fR|\fIfalse\fR: |
|
| 22 |
-When set to true, proxify all received signal to the process (even in non-tty mode). The default is \fItrue\fR. |
|
| 23 |
-.sp |
|
| 24 |
-.SH EXAMPLES |
|
| 25 |
-.sp |
|
| 26 |
-.PP |
|
| 27 |
-.B Attaching to a container |
|
| 28 |
-.TP |
|
| 29 |
-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 \fBdocker attach\fR command: |
|
| 30 |
-.sp |
|
| 31 |
-.nf |
|
| 32 |
-.RS |
|
| 33 |
-# ID=$(sudo docker run -d fedora /usr/bin/top -b) |
|
| 34 |
-# sudo docker attach $ID |
|
| 35 |
-top - 02:05:52 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 |
|
| 36 |
-Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie |
|
| 37 |
-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 |
|
| 38 |
-Mem: 373572k total, 355560k used, 18012k free, 27872k buffers |
|
| 39 |
-Swap: 786428k total, 0k used, 786428k free, 221740k cached |
|
| 40 |
- |
|
| 41 |
-PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
|
| 42 |
-1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top |
|
| 43 |
- |
|
| 44 |
-top - 02:05:55 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 |
|
| 45 |
-Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie |
|
| 46 |
-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 |
|
| 47 |
-Mem: 373572k total, 355244k used, 18328k free, 27872k buffers |
|
| 48 |
-Swap: 786428k total, 0k used, 786428k free, 221776k cached |
|
| 49 |
- |
|
| 50 |
-PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
|
| 51 |
-1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top |
|
| 52 |
-.RE |
|
| 53 |
-.fi |
|
| 54 |
-.sp |
|
| 55 |
-.SH HISTORY |
|
| 56 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 57 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,65 +0,0 @@ |
| 1 |
-.\" Process this file with |
|
| 2 |
-.\" nroff -man -Tascii docker-build.1 |
|
| 3 |
-.\" |
|
| 4 |
-.TH "DOCKER" "1" "MARCH 2014" "0.1" "Docker" |
|
| 5 |
-.SH NAME |
|
| 6 |
-docker-build \- Build an image from a Dockerfile source at PATH |
|
| 7 |
-.SH SYNOPSIS |
|
| 8 |
-.B docker build |
|
| 9 |
-[\fB--no-cache\fR[=\fIfalse\fR] |
|
| 10 |
-[\fB-q\fR|\fB--quiet\fR[=\fIfalse\fR] |
|
| 11 |
-[\fB--rm\fR[=\fitrue\fR]] |
|
| 12 |
-[\fB-t\fR|\fB--tag\fR=\fItag\fR] |
|
| 13 |
-PATH | URL | - |
|
| 14 |
-.SH DESCRIPTION |
|
| 15 |
-This will read the Dockerfile from the directory specified in \fBPATH\fR. 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 command found within the Dockerfile. |
|
| 16 |
-Warning, this will send a lot of data to the Docker daemon if the current directory contains a lot of data. |
|
| 17 |
-If the absolute path is provided instead of ‘.’, only the files and directories required by the ADD commands from the Dockerfile will be added to the context and transferred to the Docker daemon. |
|
| 18 |
-.sp |
|
| 19 |
-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. |
|
| 20 |
-.SH "OPTIONS" |
|
| 21 |
-.TP |
|
| 22 |
-.B -q, --quiet=\fItrue\fR|\fIfalse\fR: |
|
| 23 |
-When set to true, suppress verbose build output. Default is \fIfalse\fR. |
|
| 24 |
-.TP |
|
| 25 |
-.B --rm=\fItrue\fr|\fIfalse\fR: |
|
| 26 |
-When true, remove intermediate containers that are created during the build process. The default is true. |
|
| 27 |
-.TP |
|
| 28 |
-.B -t, --tag=\fItag\fR: |
|
| 29 |
-Tag to be applied to the resulting image on successful completion of the build. |
|
| 30 |
-.TP |
|
| 31 |
-.B --no-cache=\fItrue\fR|\fIfalse\fR |
|
| 32 |
-When set to true, do not use a cache when building the image. The default is \fIfalse\fR. |
|
| 33 |
-.sp |
|
| 34 |
-.SH EXAMPLES |
|
| 35 |
-.sp |
|
| 36 |
-.sp |
|
| 37 |
-.B Building an image from current directory |
|
| 38 |
-.TP |
|
| 39 |
-USing a Dockerfile, Docker images are built using the build command: |
|
| 40 |
-.sp |
|
| 41 |
-.RS |
|
| 42 |
-docker build . |
|
| 43 |
-.RE |
|
| 44 |
-.sp |
|
| 45 |
-If, for some reasone, you do not what to remove the intermediate containers created during the build you must set--rm=false. |
|
| 46 |
-.sp |
|
| 47 |
-.RS |
|
| 48 |
-docker build --rm=false . |
|
| 49 |
-.sp |
|
| 50 |
-.RE |
|
| 51 |
-.sp |
|
| 52 |
-A good practice is to make a subdirectory 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 an Dockerfile for an Apache web server. |
|
| 53 |
-.sp |
|
| 54 |
-It is also good practice to add the files required for the image to the subdirectory. 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. |
|
| 55 |
-.sp |
|
| 56 |
-.B Building an image container using a URL |
|
| 57 |
-.TP |
|
| 58 |
-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. Note that you can specify an arbitrary Git repository by using the ‘git://’ schema. |
|
| 59 |
-.sp |
|
| 60 |
-.RS |
|
| 61 |
-docker build github.com/scollier/Fedora-Dockerfiles/tree/master/apache |
|
| 62 |
-.RE |
|
| 63 |
-.sp |
|
| 64 |
-.SH HISTORY |
|
| 65 |
-March 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 66 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,84 +0,0 @@ |
| 1 |
-.\" Process this file with |
|
| 2 |
-.\" nroff -man -Tascii docker-images.1 |
|
| 3 |
-.\" |
|
| 4 |
-.TH "DOCKER" "1" "April 2014" "0.1" "Docker" |
|
| 5 |
-.SH NAME |
|
| 6 |
-docker-images \- List the images in the local repository |
|
| 7 |
-.SH SYNOPSIS |
|
| 8 |
-.B docker images |
|
| 9 |
-[\fB-a\fR|\fB--all\fR=\fIfalse\fR] |
|
| 10 |
-[\fB--no-trunc\fR[=\fIfalse\fR] |
|
| 11 |
-[\fB-q\fR|\fB--quiet\fR[=\fIfalse\fR] |
|
| 12 |
-[\fB-t\fR|\fB--tree\fR=\fIfalse\fR] |
|
| 13 |
-[\fB-v\fR|\fB--viz\fR=\fIfalse\fR] |
|
| 14 |
-[NAME] |
|
| 15 |
-.SH DESCRIPTION |
|
| 16 |
-This command lists the images stored in the local Docker repository. |
|
| 17 |
-.sp |
|
| 18 |
-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. |
|
| 19 |
-.sp |
|
| 20 |
-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. |
|
| 21 |
-.SH "OPTIONS" |
|
| 22 |
-.TP |
|
| 23 |
-.B -a, --all=\fItrue\fR|\fIfalse\fR: |
|
| 24 |
-When set to true, also include all intermediate images in the list. The default is false. |
|
| 25 |
-.TP |
|
| 26 |
-.B --no-trunc=\fItrue\fR|\fIfalse\fR: |
|
| 27 |
-When set to true, list the full image ID and not the truncated ID. The default is false. |
|
| 28 |
-.TP |
|
| 29 |
-.B -q, --quiet=\fItrue\fR|\fIfalse\fR: |
|
| 30 |
-When set to true, list the complete image ID as part of the output. The default is false. |
|
| 31 |
-.TP |
|
| 32 |
-.B -t, --tree=\fItrue\fR|\fIfalse\fR: |
|
| 33 |
-When set to true, list the images in a tree dependency tree (hierarchy) format. The default is false. |
|
| 34 |
-.TP |
|
| 35 |
-.B -v, --viz=\fItrue\fR|\fIfalse\fR |
|
| 36 |
-When set to true, list the graph in graphviz format. The default is \fIfalse\fR. |
|
| 37 |
-.sp |
|
| 38 |
-.SH EXAMPLES |
|
| 39 |
-.sp |
|
| 40 |
-.B Listing the images |
|
| 41 |
-.TP |
|
| 42 |
-To list the images in a local repository (not the registry) run: |
|
| 43 |
-.sp |
|
| 44 |
-.RS |
|
| 45 |
-docker images |
|
| 46 |
-.RE |
|
| 47 |
-.sp |
|
| 48 |
-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. |
|
| 49 |
-.sp |
|
| 50 |
-To get a verbose list of images which contains all the intermediate images used in builds use \fB-a\fR: |
|
| 51 |
-.sp |
|
| 52 |
-.RS |
|
| 53 |
-docker images -a |
|
| 54 |
-.RE |
|
| 55 |
-.sp |
|
| 56 |
-.B List images dependency tree hierarchy |
|
| 57 |
-.TP |
|
| 58 |
-To list the images in the local repository (not the registry) in a dependency tree format then use the \fB-t\fR|\fB--tree=true\fR option. |
|
| 59 |
-.sp |
|
| 60 |
-.RS |
|
| 61 |
-docker images -t |
|
| 62 |
-.RE |
|
| 63 |
-.sp |
|
| 64 |
-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. |
|
| 65 |
-.sp |
|
| 66 |
-.B List images in GraphViz format |
|
| 67 |
-.TP |
|
| 68 |
-To display the list in a format consumable by a GraphViz tools run with \fB-v\fR|\fB--viz=true\fR. For example to produce a .png graph file of the hierarchy use: |
|
| 69 |
-.sp |
|
| 70 |
-.RS |
|
| 71 |
-docker images --viz | dot -Tpng -o docker.png |
|
| 72 |
-.sp |
|
| 73 |
-.RE |
|
| 74 |
-.sp |
|
| 75 |
-.B Listing only the shortened image IDs |
|
| 76 |
-.TP |
|
| 77 |
-Listing just the shortened image IDs. This can be useful for some automated tools. |
|
| 78 |
-.sp |
|
| 79 |
-.RS |
|
| 80 |
-docker images -q |
|
| 81 |
-.RE |
|
| 82 |
-.sp |
|
| 83 |
-.SH HISTORY |
|
| 84 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 85 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,39 +0,0 @@ |
| 1 |
-.\" Process this file with |
|
| 2 |
-.\" nroff -man -Tascii docker-info.1 |
|
| 3 |
-.\" |
|
| 4 |
-.TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker" |
|
| 5 |
-.SH NAME |
|
| 6 |
-docker-info \- Display system wide information |
|
| 7 |
-.SH SYNOPSIS |
|
| 8 |
-.B docker info |
|
| 9 |
-.SH DESCRIPTION |
|
| 10 |
-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. |
|
| 11 |
-.sp |
|
| 12 |
-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. |
|
| 13 |
-.SH "OPTIONS" |
|
| 14 |
-There are no available options. |
|
| 15 |
-.sp |
|
| 16 |
-.SH EXAMPLES |
|
| 17 |
-.sp |
|
| 18 |
-.B Display Docker system information |
|
| 19 |
-.TP |
|
| 20 |
-Here is a sample output: |
|
| 21 |
-.sp |
|
| 22 |
-.RS |
|
| 23 |
- # docker info |
|
| 24 |
- Containers: 18 |
|
| 25 |
- Images: 95 |
|
| 26 |
- Storage Driver: devicemapper |
|
| 27 |
- Pool Name: docker-8:1-170408448-pool |
|
| 28 |
- Data file: /var/lib/docker/devicemapper/devicemapper/data |
|
| 29 |
- Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata |
|
| 30 |
- Data Space Used: 9946.3 Mb |
|
| 31 |
- Data Space Total: 102400.0 Mb |
|
| 32 |
- Metadata Space Used: 9.9 Mb |
|
| 33 |
- Metadata Space Total: 2048.0 Mb |
|
| 34 |
- Execution Driver: native-0.1 |
|
| 35 |
- Kernel Version: 3.10.0-116.el7.x86_64 |
|
| 36 |
-.RE |
|
| 37 |
-.sp |
|
| 38 |
-.SH HISTORY |
|
| 39 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 40 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,237 +0,0 @@ |
| 1 |
-.\" Process this file with |
|
| 2 |
-.\" nroff -man -Tascii docker-inspect.1 |
|
| 3 |
-.\" |
|
| 4 |
-.TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker" |
|
| 5 |
-.SH NAME |
|
| 6 |
-docker-inspect \- Return low-level information on a container/image |
|
| 7 |
-.SH SYNOPSIS |
|
| 8 |
-.B docker inspect |
|
| 9 |
-[\fB-f\fR|\fB--format\fR="" |
|
| 10 |
-CONTAINER|IMAGE [CONTAINER|IMAGE...] |
|
| 11 |
-.SH DESCRIPTION |
|
| 12 |
-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. |
|
| 13 |
-.SH "OPTIONS" |
|
| 14 |
-.TP |
|
| 15 |
-.B -f, --format="": |
|
| 16 |
-The text/template package of Go describes all the details of the format. See examples section |
|
| 17 |
-.SH EXAMPLES |
|
| 18 |
-.sp |
|
| 19 |
-.PP |
|
| 20 |
-.B Getting information on a container |
|
| 21 |
-.TP |
|
| 22 |
-To get information on a container use it's ID or instance name |
|
| 23 |
-.sp |
|
| 24 |
-.fi |
|
| 25 |
-.RS |
|
| 26 |
-#docker inspect 1eb5fabf5a03 |
|
| 27 |
- |
|
| 28 |
-[{
|
|
| 29 |
- "ID": "1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b", |
|
| 30 |
- "Created": "2014-04-04T21:33:52.02361335Z", |
|
| 31 |
- "Path": "/usr/sbin/nginx", |
|
| 32 |
- "Args": [], |
|
| 33 |
- "Config": {
|
|
| 34 |
- "Hostname": "1eb5fabf5a03", |
|
| 35 |
- "Domainname": "", |
|
| 36 |
- "User": "", |
|
| 37 |
- "Memory": 0, |
|
| 38 |
- "MemorySwap": 0, |
|
| 39 |
- "CpuShares": 0, |
|
| 40 |
- "AttachStdin": false, |
|
| 41 |
- "AttachStdout": false, |
|
| 42 |
- "AttachStderr": false, |
|
| 43 |
- "PortSpecs": null, |
|
| 44 |
- "ExposedPorts": {
|
|
| 45 |
- "80/tcp": {}
|
|
| 46 |
- }, |
|
| 47 |
- "Tty": true, |
|
| 48 |
- "OpenStdin": false, |
|
| 49 |
- "StdinOnce": false, |
|
| 50 |
- "Env": [ |
|
| 51 |
- "HOME=/", |
|
| 52 |
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
|
| 53 |
- ], |
|
| 54 |
- "Cmd": [ |
|
| 55 |
- "/usr/sbin/nginx" |
|
| 56 |
- ], |
|
| 57 |
- "Dns": null, |
|
| 58 |
- "DnsSearch": null, |
|
| 59 |
- "Image": "summit/nginx", |
|
| 60 |
- "Volumes": null, |
|
| 61 |
- "VolumesFrom": "", |
|
| 62 |
- "WorkingDir": "", |
|
| 63 |
- "Entrypoint": null, |
|
| 64 |
- "NetworkDisabled": false, |
|
| 65 |
- "OnBuild": null, |
|
| 66 |
- "Context": {
|
|
| 67 |
- "mount_label": "system_u:object_r:svirt_sandbox_file_t:s0:c0,c650", |
|
| 68 |
- "process_label": "system_u:system_r:svirt_lxc_net_t:s0:c0,c650" |
|
| 69 |
- } |
|
| 70 |
- }, |
|
| 71 |
- "State": {
|
|
| 72 |
- "Running": true, |
|
| 73 |
- "Pid": 858, |
|
| 74 |
- "ExitCode": 0, |
|
| 75 |
- "StartedAt": "2014-04-04T21:33:54.16259207Z", |
|
| 76 |
- "FinishedAt": "0001-01-01T00:00:00Z", |
|
| 77 |
- "Ghost": false |
|
| 78 |
- }, |
|
| 79 |
- "Image": "df53773a4390e25936f9fd3739e0c0e60a62d024ea7b669282b27e65ae8458e6", |
|
| 80 |
- "NetworkSettings": {
|
|
| 81 |
- "IPAddress": "172.17.0.2", |
|
| 82 |
- "IPPrefixLen": 16, |
|
| 83 |
- "Gateway": "172.17.42.1", |
|
| 84 |
- "Bridge": "docker0", |
|
| 85 |
- "PortMapping": null, |
|
| 86 |
- "Ports": {
|
|
| 87 |
- "80/tcp": [ |
|
| 88 |
- {
|
|
| 89 |
- "HostIp": "0.0.0.0", |
|
| 90 |
- "HostPort": "80" |
|
| 91 |
- } |
|
| 92 |
- ] |
|
| 93 |
- } |
|
| 94 |
- }, |
|
| 95 |
- "ResolvConfPath": "/etc/resolv.conf", |
|
| 96 |
- "HostnamePath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/hostname", |
|
| 97 |
- "HostsPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/hosts", |
|
| 98 |
- "Name": "/ecstatic_ptolemy", |
|
| 99 |
- "Driver": "devicemapper", |
|
| 100 |
- "ExecDriver": "native-0.1", |
|
| 101 |
- "Volumes": {},
|
|
| 102 |
- "VolumesRW": {},
|
|
| 103 |
- "HostConfig": {
|
|
| 104 |
- "Binds": null, |
|
| 105 |
- "ContainerIDFile": "", |
|
| 106 |
- "LxcConf": [], |
|
| 107 |
- "Privileged": false, |
|
| 108 |
- "PortBindings": {
|
|
| 109 |
- "80/tcp": [ |
|
| 110 |
- {
|
|
| 111 |
- "HostIp": "0.0.0.0", |
|
| 112 |
- "HostPort": "80" |
|
| 113 |
- } |
|
| 114 |
- ] |
|
| 115 |
- }, |
|
| 116 |
- "Links": null, |
|
| 117 |
- "PublishAllPorts": false, |
|
| 118 |
- "DriverOptions": {
|
|
| 119 |
- "lxc": null |
|
| 120 |
- }, |
|
| 121 |
- "CliAddress": "" |
|
| 122 |
- } |
|
| 123 |
-.RE |
|
| 124 |
-.nf |
|
| 125 |
-.sp |
|
| 126 |
-.B Getting the IP address of a container instance |
|
| 127 |
-.TP |
|
| 128 |
-To get the IP address of a container use: |
|
| 129 |
-.sp |
|
| 130 |
-.fi |
|
| 131 |
-.RS |
|
| 132 |
-# docker inspect --format='{{.NetworkSettings.IPAddress}}' 1eb5fabf5a03
|
|
| 133 |
- |
|
| 134 |
-172.17.0.2 |
|
| 135 |
-.RE |
|
| 136 |
-.nf |
|
| 137 |
-.sp |
|
| 138 |
-.B Listing all port bindings |
|
| 139 |
-.TP |
|
| 140 |
-One can loop over arrays and maps in the results to produce simple text output: |
|
| 141 |
-.sp |
|
| 142 |
-.fi |
|
| 143 |
-.RS |
|
| 144 |
-# docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' 1eb5fabf5a03
|
|
| 145 |
- |
|
| 146 |
-80/tcp -> 80 |
|
| 147 |
-.RE |
|
| 148 |
-.nf |
|
| 149 |
-.sp |
|
| 150 |
-.B Getting information on an image |
|
| 151 |
-.TP |
|
| 152 |
-Use an image's ID or name (e.g. repository/name[:tag]) to get information on it. |
|
| 153 |
-.sp |
|
| 154 |
-.fi |
|
| 155 |
-.RS |
|
| 156 |
-docker inspect 58394af37342 |
|
| 157 |
-[{
|
|
| 158 |
- "id": "58394af373423902a1b97f209a31e3777932d9321ef10e64feaaa7b4df609cf9", |
|
| 159 |
- "parent": "8abc22fbb04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", |
|
| 160 |
- "created": "2014-02-03T16:10:40.500814677Z", |
|
| 161 |
- "container": "f718f19a28a5147da49313c54620306243734bafa63c76942ef6f8c4b4113bc5", |
|
| 162 |
- "container_config": {
|
|
| 163 |
- "Hostname": "88807319f25e", |
|
| 164 |
- "Domainname": "", |
|
| 165 |
- "User": "", |
|
| 166 |
- "Memory": 0, |
|
| 167 |
- "MemorySwap": 0, |
|
| 168 |
- "CpuShares": 0, |
|
| 169 |
- "AttachStdin": false, |
|
| 170 |
- "AttachStdout": false, |
|
| 171 |
- "AttachStderr": false, |
|
| 172 |
- "PortSpecs": null, |
|
| 173 |
- "ExposedPorts": null, |
|
| 174 |
- "Tty": false, |
|
| 175 |
- "OpenStdin": false, |
|
| 176 |
- "StdinOnce": false, |
|
| 177 |
- "Env": [ |
|
| 178 |
- "HOME=/", |
|
| 179 |
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
|
| 180 |
- ], |
|
| 181 |
- "Cmd": [ |
|
| 182 |
- "/bin/sh", |
|
| 183 |
- "-c", |
|
| 184 |
- "#(nop) ADD fedora-20-medium.tar.xz in /" |
|
| 185 |
- ], |
|
| 186 |
- "Dns": null, |
|
| 187 |
- "DnsSearch": null, |
|
| 188 |
- "Image": "8abc22fbb04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", |
|
| 189 |
- "Volumes": null, |
|
| 190 |
- "VolumesFrom": "", |
|
| 191 |
- "WorkingDir": "", |
|
| 192 |
- "Entrypoint": null, |
|
| 193 |
- "NetworkDisabled": false, |
|
| 194 |
- "OnBuild": null, |
|
| 195 |
- "Context": null |
|
| 196 |
- }, |
|
| 197 |
- "docker_version": "0.6.3", |
|
| 198 |
- "author": "Lokesh Mandvekar \u003clsm5@redhat.com\u003e - ./buildcontainers.sh", |
|
| 199 |
- "config": {
|
|
| 200 |
- "Hostname": "88807319f25e", |
|
| 201 |
- "Domainname": "", |
|
| 202 |
- "User": "", |
|
| 203 |
- "Memory": 0, |
|
| 204 |
- "MemorySwap": 0, |
|
| 205 |
- "CpuShares": 0, |
|
| 206 |
- "AttachStdin": false, |
|
| 207 |
- "AttachStdout": false, |
|
| 208 |
- "AttachStderr": false, |
|
| 209 |
- "PortSpecs": null, |
|
| 210 |
- "ExposedPorts": null, |
|
| 211 |
- "Tty": false, |
|
| 212 |
- "OpenStdin": false, |
|
| 213 |
- "StdinOnce": false, |
|
| 214 |
- "Env": [ |
|
| 215 |
- "HOME=/", |
|
| 216 |
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
|
| 217 |
- ], |
|
| 218 |
- "Cmd": null, |
|
| 219 |
- "Dns": null, |
|
| 220 |
- "DnsSearch": null, |
|
| 221 |
- "Image": "8abc22fbb04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", |
|
| 222 |
- "Volumes": null, |
|
| 223 |
- "VolumesFrom": "", |
|
| 224 |
- "WorkingDir": "", |
|
| 225 |
- "Entrypoint": null, |
|
| 226 |
- "NetworkDisabled": false, |
|
| 227 |
- "OnBuild": null, |
|
| 228 |
- "Context": null |
|
| 229 |
- }, |
|
| 230 |
- "architecture": "x86_64", |
|
| 231 |
- "Size": 385520098 |
|
| 232 |
-}] |
|
| 233 |
-.RE |
|
| 234 |
-.nf |
|
| 235 |
-.sp |
|
| 236 |
-.SH HISTORY |
|
| 237 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 238 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,45 +0,0 @@ |
| 1 |
-.\" Process this file with |
|
| 2 |
-.\" nroff -man -Tascii docker-rm.1 |
|
| 3 |
-.\" |
|
| 4 |
-.TH "DOCKER" "1" "MARCH 2014" "0.1" "Docker" |
|
| 5 |
-.SH NAME |
|
| 6 |
-docker-rm \- Remove one or more containers. |
|
| 7 |
-.SH SYNOPSIS |
|
| 8 |
-.B docker rm |
|
| 9 |
-[\fB-f\fR|\fB--force\fR[=\fIfalse\fR] |
|
| 10 |
-[\fB-l\fR|\fB--link\fR[=\fIfalse\fR] |
|
| 11 |
-[\fB-v\fR|\fB--volumes\fR[=\fIfalse\fR] |
|
| 12 |
-CONTAINER [CONTAINER...] |
|
| 13 |
-.SH DESCRIPTION |
|
| 14 |
-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. |
|
| 15 |
-.SH "OPTIONS" |
|
| 16 |
-.TP |
|
| 17 |
-.B -f, --force=\fItrue\fR|\fIfalse\fR: |
|
| 18 |
-When set to true, force the removal of the container. The default is \fIfalse\fR. |
|
| 19 |
-.TP |
|
| 20 |
-.B -l, --link=\fItrue\fR|\fIfalse\fR: |
|
| 21 |
-When set to true, remove the specified link and not the underlying container. The default is \fIfalse\fR. |
|
| 22 |
-.TP |
|
| 23 |
-.B -v, --volumes=\fItrue\fR|\fIfalse\fR: |
|
| 24 |
-When set to true, remove the volumes associated to the container. The default is \fIfalse\fR. |
|
| 25 |
-.SH EXAMPLES |
|
| 26 |
-.sp |
|
| 27 |
-.PP |
|
| 28 |
-.B Removing a container using its ID |
|
| 29 |
-.TP |
|
| 30 |
-To remove a container using its ID, find either from a \fBdocker ps -a\fR command, or use the ID returned from the \fBdocker run\fR command, or retrieve it from a file used to store it using the \fBdocker run --cidfile\fR: |
|
| 31 |
-.sp |
|
| 32 |
-.RS |
|
| 33 |
-docker rm abebf7571666 |
|
| 34 |
-.RE |
|
| 35 |
-.sp |
|
| 36 |
-.B Removing a container using the container name: |
|
| 37 |
-.TP |
|
| 38 |
-The name of the container can be found using the \fBdocker ps -a\fR command. The use that name as follows: |
|
| 39 |
-.sp |
|
| 40 |
-.RS |
|
| 41 |
-docker rm hopeful_morse |
|
| 42 |
-.RE |
|
| 43 |
-.sp |
|
| 44 |
-.SH HISTORY |
|
| 45 |
-March 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 46 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,50 +0,0 @@ |
| 1 |
-DOCKER "1" "APRIL 2014" "0.1" "Docker" |
|
| 2 |
-======================================= |
|
| 3 |
- |
|
| 4 |
-NAME |
|
| 5 |
- |
|
| 6 |
-docker-rm - Remove one or more containers. |
|
| 7 |
- |
|
| 8 |
-SYNOPSIS |
|
| 9 |
- |
|
| 10 |
-`docker rm` [`-f`|`--force`[=*false*] [`-l`|`--link`[=*false*] [`-v`|`--volumes`[=*false*] |
|
| 11 |
-CONTAINER [CONTAINER...] |
|
| 12 |
- |
|
| 13 |
-DESCRIPTION |
|
| 14 |
- |
|
| 15 |
-`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. |
|
| 16 |
- |
|
| 17 |
-OPTIONS |
|
| 18 |
- |
|
| 19 |
-`-f`, `--force`=*true*|*false*: |
|
| 20 |
- When set to true, force the removal of the container. The default is *false*. |
|
| 21 |
- |
|
| 22 |
-`-l`, `--link`=*true*|*false*: |
|
| 23 |
- When set to true, remove the specified link and not the underlying container. The default is *false*. |
|
| 24 |
- |
|
| 25 |
-`-v`, `--volumes`=*true*|*false*: |
|
| 26 |
- When set to true, remove the volumes associated to the container. The default is *false*. |
|
| 27 |
- |
|
| 28 |
-EXAMPLES |
|
| 29 |
- |
|
| 30 |
-##Removing a container using its ID## |
|
| 31 |
- |
|
| 32 |
-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`: |
|
| 33 |
- |
|
| 34 |
- docker rm abebf7571666 |
|
| 35 |
- |
|
| 36 |
-##Removing a container using the container name## |
|
| 37 |
- |
|
| 38 |
-The name of the container can be found using the \fBdocker ps -a\fR command. The use that name as follows: |
|
| 39 |
- |
|
| 40 |
- docker rm hopeful_morse |
|
| 41 |
- |
|
| 42 |
-HISTORY |
|
| 43 |
- |
|
| 44 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 45 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,29 +0,0 @@ |
| 1 |
-.\" Process this file with |
|
| 2 |
-.\" nroff -man -Tascii docker-run.1 |
|
| 3 |
-.\" |
|
| 4 |
-.TH "DOCKER" "1" "MARCH 2014" "0.1" "Docker" |
|
| 5 |
-.SH NAME |
|
| 6 |
-docker-rmi \- Remove one or more images. |
|
| 7 |
-.SH SYNOPSIS |
|
| 8 |
-.B docker rmi |
|
| 9 |
-[\fB-f\fR|\fB--force\fR[=\fIfalse\fR] |
|
| 10 |
-IMAGE [IMAGE...] |
|
| 11 |
-.SH DESCRIPTION |
|
| 12 |
-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. |
|
| 13 |
-.SH "OPTIONS" |
|
| 14 |
-.TP |
|
| 15 |
-.B -f, --force=\fItrue\fR|\fIfalse\fR: |
|
| 16 |
-When set to true, force the removal of the image. The default is \fIfalse\fR. |
|
| 17 |
-.SH EXAMPLES |
|
| 18 |
-.sp |
|
| 19 |
-.PP |
|
| 20 |
-.B Removing an image |
|
| 21 |
-.TP |
|
| 22 |
-Here is an example of removing and image: |
|
| 23 |
-.sp |
|
| 24 |
-.RS |
|
| 25 |
-docker rmi fedora/httpd |
|
| 26 |
-.RE |
|
| 27 |
-.sp |
|
| 28 |
-.SH HISTORY |
|
| 29 |
-March 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 30 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,277 +0,0 @@ |
| 1 |
-.\" Process this file with |
|
| 2 |
-.\" nroff -man -Tascii docker-run.1 |
|
| 3 |
-.\" |
|
| 4 |
-.TH "DOCKER" "1" "MARCH 2014" "0.1" "Docker" |
|
| 5 |
-.SH NAME |
|
| 6 |
-docker-run \- Run a process in an isolated container |
|
| 7 |
-.SH SYNOPSIS |
|
| 8 |
-.B docker run |
|
| 9 |
-[\fB-a\fR|\fB--attach\fR[=]] [\fB-c\fR|\fB--cpu-shares\fR[=0] [\fB-m\fR|\fB--memory\fR=\fImemory-limit\fR] |
|
| 10 |
-[\fB--cidfile\fR=\fIfile\fR] [\fB-d\fR|\fB--detach\fR[=\fIfalse\fR]] [\fB--dns\fR=\fIIP-address\fR] |
|
| 11 |
-[\fB--name\fR=\fIname\fR] [\fB-u\fR|\fB--user\fR=\fIusername\fR|\fIuid\fR] |
|
| 12 |
-[\fB--link\fR=\fIname\fR:\fIalias\fR] |
|
| 13 |
-[\fB-e\fR|\fB--env\fR=\fIenvironment\fR] [\fB--entrypoint\fR=\fIcommand\fR] |
|
| 14 |
-[\fB--expose\fR=\fIport\fR] [\fB-P\fR|\fB--publish-all\fR[=\fIfalse\fR]] |
|
| 15 |
-[\fB-p\fR|\fB--publish\fR=\fIport-mappping\fR] [\fB-h\fR|\fB--hostname\fR=\fIhostname\fR] |
|
| 16 |
-[\fB--rm\fR[=\fIfalse\fR]] [\fB--priviledged\fR[=\fIfalse\fR] |
|
| 17 |
-[\fB-i\fR|\fB--interactive\fR[=\fIfalse\fR] |
|
| 18 |
-[\fB-t\fR|\fB--tty\fR[=\fIfalse\fR]] [\fB--lxc-conf\fR=\fIoptions\fR] |
|
| 19 |
-[\fB-n\fR|\fB--networking\fR[=\fItrue\fR]] |
|
| 20 |
-[\fB-v\fR|\fB--volume\fR=\fIvolume\fR] [\fB--volumes-from\fR=\fIcontainer-id\fR] |
|
| 21 |
-[\fB-w\fR|\fB--workdir\fR=\fIdirectory\fR] [\fB--sig-proxy\fR[=\fItrue\fR]] |
|
| 22 |
-IMAGE [COMMAND] [ARG...] |
|
| 23 |
-.SH DESCRIPTION |
|
| 24 |
-.PP |
|
| 25 |
-Run a process in a new container. \fBdocker run\fR starts a process with its own file system, its own networking, and its own isolated process tree. The \fIIMAGE\fR 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 \fBdocker run\fR gives final control to the operator or administrator who starts the container from the image. For that reason \fBdocker run\fR has more options than any other docker command. |
|
| 26 |
- |
|
| 27 |
-If the \fIIMAGE\fR is not already loaded then \fBdocker run\fR will pull the \fIIMAGE\fR, and all image dependencies, from the repository in the same way running \fBdocker pull\fR \fIIMAGE\fR, before it starts the container from that image. |
|
| 28 |
- |
|
| 29 |
- |
|
| 30 |
-.SH "OPTIONS" |
|
| 31 |
- |
|
| 32 |
-.TP |
|
| 33 |
-.B -a, --attach=\fIstdin\fR|\fIstdout\fR|\fIstderr\fR: |
|
| 34 |
-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. |
|
| 35 |
- |
|
| 36 |
-.TP |
|
| 37 |
-.B -c, --cpu-shares=0: |
|
| 38 |
-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. |
|
| 39 |
- |
|
| 40 |
-.TP |
|
| 41 |
-.B -m, --memory=\fImemory-limit\fR: |
|
| 42 |
-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. If a limit of 0 is specified, the container's memory is not limited. The memory limit format: <number><optional unit>, where unit = b, k, m or g. |
|
| 43 |
- |
|
| 44 |
-.TP |
|
| 45 |
-.B --cidfile=\fIfile\fR: |
|
| 46 |
-Write the container ID to the file specified. |
|
| 47 |
- |
|
| 48 |
-.TP |
|
| 49 |
-.B -d, --detach=\fItrue\fR|\fIfalse\fR: |
|
| 50 |
-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. |
|
| 51 |
- |
|
| 52 |
-.TP |
|
| 53 |
-.B --dns=\fIIP-address\fR: |
|
| 54 |
-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. |
|
| 55 |
- |
|
| 56 |
-.TP |
|
| 57 |
-.B -e, --env=\fIenvironment\fR: |
|
| 58 |
-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. |
|
| 59 |
- |
|
| 60 |
-.TP |
|
| 61 |
-.B --entrypoint=\ficommand\fR: |
|
| 62 |
-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. |
|
| 63 |
- |
|
| 64 |
-.TP |
|
| 65 |
-.B --expose=\fIport\fR: |
|
| 66 |
-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. |
|
| 67 |
- |
|
| 68 |
-.TP |
|
| 69 |
-.B -P, --publish-all=\fItrue\fR|\fIfalse\fR: |
|
| 70 |
-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. |
|
| 71 |
- |
|
| 72 |
-.TP |
|
| 73 |
-.B -p, --publish=[]: |
|
| 74 |
-Publish a container's port to the host (format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort) (use 'docker port' to see the actual mapping) |
|
| 75 |
- |
|
| 76 |
-.TP |
|
| 77 |
-.B -h , --hostname=\fIhostname\fR: |
|
| 78 |
-Sets the container host name that is available inside the container. |
|
| 79 |
- |
|
| 80 |
-.TP |
|
| 81 |
-.B -i , --interactive=\fItrue\fR|\fIfalse\fR: |
|
| 82 |
-When set to true, keep stdin open even if not attached. The default is false. |
|
| 83 |
- |
|
| 84 |
-.TP |
|
| 85 |
-.B --link=\fIname\fR:\fIalias\fR: |
|
| 86 |
-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. |
|
| 87 |
- |
|
| 88 |
-.TP |
|
| 89 |
-.B -n, --networking=\fItrue\fR|\fIfalse\fR: |
|
| 90 |
-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. |
|
| 91 |
- |
|
| 92 |
-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. |
|
| 93 |
- |
|
| 94 |
-.TP |
|
| 95 |
-.B --name=\fIname\fR: |
|
| 96 |
-Assign a name to the container. The operator can identify a container in three ways: |
|
| 97 |
-.sp |
|
| 98 |
-.nf |
|
| 99 |
-UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”) |
|
| 100 |
-UUID short identifier (“f78375b1c487”) |
|
| 101 |
-Name (“jonah”) |
|
| 102 |
-.fi |
|
| 103 |
-.sp |
|
| 104 |
-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. |
|
| 105 |
- |
|
| 106 |
-.TP |
|
| 107 |
-.B --privileged=\fItrue\fR|\fIfalse\fR: |
|
| 108 |
-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. |
|
| 109 |
- |
|
| 110 |
-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. |
|
| 111 |
- |
|
| 112 |
-.TP |
|
| 113 |
-.B --rm=\fItrue\fR|\fIfalse\fR: |
|
| 114 |
-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. |
|
| 115 |
- |
|
| 116 |
-.TP |
|
| 117 |
-.B --sig-proxy=\fItrue\fR|\fIfalse\fR: |
|
| 118 |
-When set to true, proxify all received signals to the process (even in non-tty mode). The default is true. |
|
| 119 |
- |
|
| 120 |
-.TP |
|
| 121 |
-.B -t, --tty=\fItrue\fR|\fIfalse\fR: |
|
| 122 |
-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. |
|
| 123 |
- |
|
| 124 |
-.TP |
|
| 125 |
-.B -u, --user=\fIusername\fR,\fRuid\fR: |
|
| 126 |
-Set a username or UID for the container. |
|
| 127 |
- |
|
| 128 |
-.TP |
|
| 129 |
-.B -v, --volume=\fIvolume\fR: |
|
| 130 |
-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. |
|
| 131 |
- |
|
| 132 |
-.TP |
|
| 133 |
-.B --volumes-from=\fIcontainer-id\fR: |
|
| 134 |
-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. |
|
| 135 |
- |
|
| 136 |
-.TP |
|
| 137 |
-.B -w, --workdir=\fIdirectory\fR: |
|
| 138 |
-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. |
|
| 139 |
- |
|
| 140 |
-.TP |
|
| 141 |
-.B IMAGE: |
|
| 142 |
-The image name or ID. |
|
| 143 |
- |
|
| 144 |
-.TP |
|
| 145 |
-.B COMMAND: |
|
| 146 |
-The command or program to run inside the image. |
|
| 147 |
- |
|
| 148 |
-.TP |
|
| 149 |
-.B ARG: |
|
| 150 |
-The arguments for the command to be run in the container. |
|
| 151 |
- |
|
| 152 |
-.SH EXAMPLES |
|
| 153 |
-.sp |
|
| 154 |
-.sp |
|
| 155 |
-.B Exposing log messages from the container to the host's log |
|
| 156 |
-.TP |
|
| 157 |
-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. |
|
| 158 |
-.sp |
|
| 159 |
-.RS |
|
| 160 |
-docker run -v /dev/log:/dev/log -i -t fedora /bin/bash |
|
| 161 |
-.RE |
|
| 162 |
-.sp |
|
| 163 |
-From inside the container you can test this by sending a message to the log. |
|
| 164 |
-.sp |
|
| 165 |
-.RS |
|
| 166 |
-logger "Hello from my container" |
|
| 167 |
-.sp |
|
| 168 |
-.RE |
|
| 169 |
-Then exit and check the journal. |
|
| 170 |
-.RS |
|
| 171 |
-.sp |
|
| 172 |
-exit |
|
| 173 |
-.sp |
|
| 174 |
-journalctl -b | grep hello |
|
| 175 |
-.RE |
|
| 176 |
-.sp |
|
| 177 |
-This should list the message sent to logger. |
|
| 178 |
-.sp |
|
| 179 |
-.B Attaching to one or more from STDIN, STDOUT, STDERR |
|
| 180 |
-.TP |
|
| 181 |
-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: |
|
| 182 |
-.sp |
|
| 183 |
-.RS |
|
| 184 |
-docker run -a stdin -a stdout -i -t fedora /bin/bash |
|
| 185 |
-.RE |
|
| 186 |
-.sp |
|
| 187 |
-.B Linking Containers |
|
| 188 |
-.TP |
|
| 189 |
-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: |
|
| 190 |
-.sp |
|
| 191 |
-.RS |
|
| 192 |
-docker run --name=link-test -d -i -t fedora/httpd |
|
| 193 |
-.RE |
|
| 194 |
-.sp |
|
| 195 |
-.TP |
|
| 196 |
-A second container, in this case called linker, can communicate with the httpd container, named link-test, by running with the \fB--link=<name>:<alias>\fR |
|
| 197 |
-.sp |
|
| 198 |
-.RS |
|
| 199 |
-docker run -t -i --link=link-test:lt --name=linker fedora /bin/bash |
|
| 200 |
-.RE |
|
| 201 |
-.sp |
|
| 202 |
-.TP |
|
| 203 |
-Now the container linker is linked to container link-test with the alias lt. Running the \fBenv\fR command in the linker container shows environment variables with the LT (alias) context (\fBLT_\fR) |
|
| 204 |
-.sp |
|
| 205 |
-.nf |
|
| 206 |
-.RS |
|
| 207 |
-# env |
|
| 208 |
-HOSTNAME=668231cb0978 |
|
| 209 |
-TERM=xterm |
|
| 210 |
-LT_PORT_80_TCP=tcp://172.17.0.3:80 |
|
| 211 |
-LT_PORT_80_TCP_PORT=80 |
|
| 212 |
-LT_PORT_80_TCP_PROTO=tcp |
|
| 213 |
-LT_PORT=tcp://172.17.0.3:80 |
|
| 214 |
-PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
|
| 215 |
-PWD=/ |
|
| 216 |
-LT_NAME=/linker/lt |
|
| 217 |
-SHLVL=1 |
|
| 218 |
-HOME=/ |
|
| 219 |
-LT_PORT_80_TCP_ADDR=172.17.0.3 |
|
| 220 |
-_=/usr/bin/env |
|
| 221 |
-.RE |
|
| 222 |
-.fi |
|
| 223 |
-.sp |
|
| 224 |
-.TP |
|
| 225 |
-When linking two containers Docker will use the exposed ports of the container to create a secure tunnel for the parent to access. |
|
| 226 |
-.TP |
|
| 227 |
-.sp |
|
| 228 |
-.B Mapping Ports for External Usage |
|
| 229 |
-.TP |
|
| 230 |
-The exposed port of an application can be mapped to a host port using the \fB-p\fR flag. For example a httpd port 80 can be mapped to the host port 8080 using the following: |
|
| 231 |
-.sp |
|
| 232 |
-.RS |
|
| 233 |
-docker run -p 8080:80 -d -i -t fedora/httpd |
|
| 234 |
-.RE |
|
| 235 |
-.sp |
|
| 236 |
-.TP |
|
| 237 |
-.B Creating and Mounting a Data Volume Container |
|
| 238 |
-.TP |
|
| 239 |
-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: |
|
| 240 |
-.sp |
|
| 241 |
-.RS |
|
| 242 |
-docker run --name=data -v /var/volume1 -v /tmp/volume2 -i -t fedora-data true |
|
| 243 |
-.sp |
|
| 244 |
-docker run --volumes-from=data --name=fedora-container1 -i -t fedora bash |
|
| 245 |
-.RE |
|
| 246 |
-.sp |
|
| 247 |
-.TP |
|
| 248 |
-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: |
|
| 249 |
-.sp |
|
| 250 |
-.RS |
|
| 251 |
-docker run --volumes-from=fedora-container1 --name=fedora-container2 -i -t fedora bash |
|
| 252 |
-.RE |
|
| 253 |
-.TP |
|
| 254 |
-.sp |
|
| 255 |
-.B Mounting External Volumes |
|
| 256 |
-.TP |
|
| 257 |
-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: |
|
| 258 |
-.sp |
|
| 259 |
-.RS |
|
| 260 |
-docker run -v /var/db:/data1 -i -t fedora bash |
|
| 261 |
-.RE |
|
| 262 |
-.sp |
|
| 263 |
-.TP |
|
| 264 |
-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. |
|
| 265 |
-.sp |
|
| 266 |
-.TP |
|
| 267 |
-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: |
|
| 268 |
-.sp |
|
| 269 |
-.RS |
|
| 270 |
-chcon -Rt svirt_sandbox_file_t /var/db |
|
| 271 |
-.RE |
|
| 272 |
-.sp |
|
| 273 |
-.TP |
|
| 274 |
-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. |
|
| 275 |
-.sp |
|
| 276 |
-.SH HISTORY |
|
| 277 |
-March 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 278 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,49 +0,0 @@ |
| 1 |
-.\" Process this file with |
|
| 2 |
-.\" nroff -man -Tascii docker-tag.1 |
|
| 3 |
-.\" |
|
| 4 |
-.TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker" |
|
| 5 |
-.SH NAME |
|
| 6 |
-docker-tag \- Tag an image in the repository |
|
| 7 |
-.SH SYNOPSIS |
|
| 8 |
-.B docker tag |
|
| 9 |
-[\fB-f\fR|\fB--force\fR[=\fIfalse\fR] |
|
| 10 |
-\fBIMAGE\fR [REGISTRYHOST/][USERNAME/]NAME[:TAG] |
|
| 11 |
-.SH DESCRIPTION |
|
| 12 |
-This will tag an image in the repository. |
|
| 13 |
-.SH "OPTIONS" |
|
| 14 |
-.TP |
|
| 15 |
-.B -f, --force=\fItrue\fR|\fIfalse\fR: |
|
| 16 |
-When set to true, force the tag name. The default is \fIfalse\fR. |
|
| 17 |
-.TP |
|
| 18 |
-.B REGISTRYHOST: |
|
| 19 |
-The hostname of the registry if required. This may also include the port separated by a ':' |
|
| 20 |
-.TP |
|
| 21 |
-.B USERNAME: |
|
| 22 |
-The username or other qualifying identifier for the image. |
|
| 23 |
-.TP |
|
| 24 |
-.B NAME: |
|
| 25 |
-The image name. |
|
| 26 |
-.TP |
|
| 27 |
-.B TAG: |
|
| 28 |
-The tag you are assigning to the image. |
|
| 29 |
-.SH EXAMPLES |
|
| 30 |
-.sp |
|
| 31 |
-.PP |
|
| 32 |
-.B Tagging an image |
|
| 33 |
-.TP |
|
| 34 |
-Here is an example where an image is tagged with the tag 'Version-1.0' : |
|
| 35 |
-.sp |
|
| 36 |
-.RS |
|
| 37 |
-docker tag 0e5574283393 fedora/httpd:Version-1.0 |
|
| 38 |
-.RE |
|
| 39 |
-.sp |
|
| 40 |
-.B Tagging an image for an internal repository |
|
| 41 |
-.TP |
|
| 42 |
-To push an image to an internal Registry and not the default docker.io based registry you must tag it with the registry hostname and port (if needed). |
|
| 43 |
-.sp |
|
| 44 |
-.RS |
|
| 45 |
-docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0 |
|
| 46 |
-.RE |
|
| 47 |
-.sp |
|
| 48 |
-.SH HISTORY |
|
| 49 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 50 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,172 +0,0 @@ |
| 1 |
-.\" Process this file with |
|
| 2 |
-.\" nroff -man -Tascii docker.1 |
|
| 3 |
-.\" |
|
| 4 |
-.TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker" |
|
| 5 |
-.SH NAME |
|
| 6 |
-docker \- Docker image and container command line interface |
|
| 7 |
-.SH SYNOPSIS |
|
| 8 |
-.B docker [OPTIONS] [COMMAND] [arg...] |
|
| 9 |
-.SH DESCRIPTION |
|
| 10 |
-\fBdocker\fR 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 \fBdocker\fR is both a server as deamon and a client to the daemon through the CLI. |
|
| 11 |
-.sp |
|
| 12 |
-To run the Docker deamon you do not specify any of the commands listed below but must specify the \fB-d\fR option. The other options listed below are for the daemon only. |
|
| 13 |
-.sp |
|
| 14 |
-The Docker CLI has over 30 commands. The commands are listed below and each has its own man page which explain usage and arguements. |
|
| 15 |
-.sp |
|
| 16 |
-To see the man page for a command run \fBman docker <command>\fR. |
|
| 17 |
-.SH "OPTIONS" |
|
| 18 |
-.B \-D=false: |
|
| 19 |
-Enable debug mode |
|
| 20 |
-.TP |
|
| 21 |
-.B\-H=[unix:///var/run/docker.sock]: tcp://[host[:port]] to bind or unix://[/path/to/socket] to use. |
|
| 22 |
-When host=[0.0.0.0], port=[2375] or path |
|
| 23 |
-=[/var/run/docker.sock] is omitted, default values are used. |
|
| 24 |
-.TP |
|
| 25 |
-.B \-\-api-enable-cors=false |
|
| 26 |
-Enable CORS headers in the remote API |
|
| 27 |
-.TP |
|
| 28 |
-.B \-b="" |
|
| 29 |
-Attach containers to a pre\-existing network bridge; use 'none' to disable container networking |
|
| 30 |
-.TP |
|
| 31 |
-.B \-\-bip="" |
|
| 32 |
-Use the provided CIDR notation address for the dynamically created bridge (docker0); Mutually exclusive of \-b |
|
| 33 |
-.TP |
|
| 34 |
-.B \-d=false |
|
| 35 |
-Enable daemon mode |
|
| 36 |
-.TP |
|
| 37 |
-.B \-\-dns="" |
|
| 38 |
-Force Docker to use specific DNS servers |
|
| 39 |
-.TP |
|
| 40 |
-.B \-g="/var/lib/docker" |
|
| 41 |
-Path to use as the root of the Docker runtime |
|
| 42 |
-.TP |
|
| 43 |
-.B \-\-icc=true |
|
| 44 |
-Enable inter\-container communication |
|
| 45 |
-.TP |
|
| 46 |
-.B \-\-ip="0.0.0.0" |
|
| 47 |
-Default IP address to use when binding container ports |
|
| 48 |
-.TP |
|
| 49 |
-.B \-\-iptables=true |
|
| 50 |
-Disable Docker's addition of iptables rules |
|
| 51 |
-.TP |
|
| 52 |
-.B \-\-mtu=1500 |
|
| 53 |
-Set the containers network mtu |
|
| 54 |
-.TP |
|
| 55 |
-.B \-p="/var/run/docker.pid" |
|
| 56 |
-Path to use for daemon PID file |
|
| 57 |
-.TP |
|
| 58 |
-.B \-r=true |
|
| 59 |
-Restart previously running containers |
|
| 60 |
-.TP |
|
| 61 |
-.B \-s="" |
|
| 62 |
-Force the Docker runtime to use a specific storage driver |
|
| 63 |
-.TP |
|
| 64 |
-.B \-v=false |
|
| 65 |
-Print version information and quit |
|
| 66 |
-.SH "COMMANDS" |
|
| 67 |
-.TP |
|
| 68 |
-.B attach |
|
| 69 |
-Attach to a running container |
|
| 70 |
-.TP |
|
| 71 |
-.B build |
|
| 72 |
-Build an image from a Dockerfile |
|
| 73 |
-.TP |
|
| 74 |
-.B commit |
|
| 75 |
-Create a new image from a container's changes |
|
| 76 |
-.TP |
|
| 77 |
-.B cp |
|
| 78 |
-Copy files/folders from the containers filesystem to the host at path |
|
| 79 |
-.TP |
|
| 80 |
-.B diff |
|
| 81 |
-Inspect changes on a container's filesystem |
|
| 82 |
- |
|
| 83 |
-.TP |
|
| 84 |
-.B events |
|
| 85 |
-Get real time events from the server |
|
| 86 |
-.TP |
|
| 87 |
-.B export |
|
| 88 |
-Stream the contents of a container as a tar archive |
|
| 89 |
-.TP |
|
| 90 |
-.B history |
|
| 91 |
-Show the history of an image |
|
| 92 |
-.TP |
|
| 93 |
-.B images |
|
| 94 |
-List images |
|
| 95 |
-.TP |
|
| 96 |
-.B import |
|
| 97 |
-Create a new filesystem image from the contents of a tarball |
|
| 98 |
-.TP |
|
| 99 |
-.B info |
|
| 100 |
-Display system-wide information |
|
| 101 |
-.TP |
|
| 102 |
-.B insert |
|
| 103 |
-Insert a file in an image |
|
| 104 |
-.TP |
|
| 105 |
-.B inspect |
|
| 106 |
-Return low-level information on a container |
|
| 107 |
-.TP |
|
| 108 |
-.B kill |
|
| 109 |
-Kill a running container (which includes the wrapper process and everything inside it) |
|
| 110 |
-.TP |
|
| 111 |
-.B load |
|
| 112 |
-Load an image from a tar archive |
|
| 113 |
-.TP |
|
| 114 |
-.B login |
|
| 115 |
-Register or Login to a Docker registry server |
|
| 116 |
-.TP |
|
| 117 |
-.B logs |
|
| 118 |
-Fetch the logs of a container |
|
| 119 |
-.TP |
|
| 120 |
-.B port |
|
| 121 |
-Lookup the public-facing port which is NAT-ed to PRIVATE_PORT |
|
| 122 |
-.TP |
|
| 123 |
-.B ps |
|
| 124 |
-List containers |
|
| 125 |
-.TP |
|
| 126 |
-.B pull |
|
| 127 |
-Pull an image or a repository from a Docker registry server |
|
| 128 |
-.TP |
|
| 129 |
-.B push |
|
| 130 |
-Push an image or a repository to a Docker registry server |
|
| 131 |
-.TP |
|
| 132 |
-.B restart |
|
| 133 |
-Restart a running container |
|
| 134 |
-.TP |
|
| 135 |
-.B rm |
|
| 136 |
-Remove one or more containers |
|
| 137 |
-.TP |
|
| 138 |
-.B rmi |
|
| 139 |
-Remove one or more images |
|
| 140 |
-.TP |
|
| 141 |
-.B run |
|
| 142 |
-Run a command in a new container |
|
| 143 |
-.TP |
|
| 144 |
-.B save |
|
| 145 |
-Save an image to a tar archive |
|
| 146 |
-.TP |
|
| 147 |
-.B search |
|
| 148 |
-Search for an image in the Docker index |
|
| 149 |
-.TP |
|
| 150 |
-.B start |
|
| 151 |
-Start a stopped container |
|
| 152 |
-.TP |
|
| 153 |
-.B stop |
|
| 154 |
-Stop a running container |
|
| 155 |
-.TP |
|
| 156 |
-.B tag |
|
| 157 |
-Tag an image into a repository |
|
| 158 |
-.TP |
|
| 159 |
-.B top |
|
| 160 |
-Lookup the running processes of a container |
|
| 161 |
-.TP |
|
| 162 |
-.B version |
|
| 163 |
-Show the Docker version information |
|
| 164 |
-.TP |
|
| 165 |
-.B wait |
|
| 166 |
-Block until a container stops, then print its exit code |
|
| 167 |
-.SH EXAMPLES |
|
| 168 |
-.sp |
|
| 169 |
-For specific examples please see the man page for the specific Docker command. |
|
| 170 |
-.sp |
|
| 171 |
-.SH HISTORY |
|
| 172 |
-April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work. |
| 0 | 5 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,206 @@ |
| 0 |
+% DOCKERFILE(5) Docker User Manuals |
|
| 1 |
+% Zac Dover |
|
| 2 |
+% May 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+ |
|
| 5 |
+Dockerfile - automate the steps of creating a Docker image |
|
| 6 |
+ |
|
| 7 |
+# INTRODUCTION |
|
| 8 |
+The **Dockerfile** is a configuration file that automates the steps of creating |
|
| 9 |
+a Docker image. It is similar to a Makefile. Docker reads instructions from the |
|
| 10 |
+**Dockerfile** to automate the steps otherwise performed manually to create an |
|
| 11 |
+image. To build an image, create a file called **Dockerfile**. The |
|
| 12 |
+**Dockerfile** describes the steps taken to assemble the image. When the |
|
| 13 |
+**Dockerfile** has been created, call the **docker build** command, using the |
|
| 14 |
+path of directory that contains **Dockerfile** as the argument. |
|
| 15 |
+ |
|
| 16 |
+# SYNOPSIS |
|
| 17 |
+ |
|
| 18 |
+INSTRUCTION arguments |
|
| 19 |
+ |
|
| 20 |
+For example: |
|
| 21 |
+ |
|
| 22 |
+FROM image |
|
| 23 |
+ |
|
| 24 |
+# DESCRIPTION |
|
| 25 |
+ |
|
| 26 |
+A Dockerfile is a file that automates the steps of creating a Docker image. |
|
| 27 |
+A Dockerfile is similar to a Makefile. |
|
| 28 |
+ |
|
| 29 |
+# USAGE |
|
| 30 |
+ |
|
| 31 |
+**sudo docker build .** |
|
| 32 |
+ -- runs the steps and commits them, building a final image |
|
| 33 |
+ The path to the source repository defines where to find the context of the |
|
| 34 |
+ build. The build is run by the docker daemon, not the CLI. The whole |
|
| 35 |
+ context must be transferred to the daemon. The Docker CLI reports |
|
| 36 |
+ "Sending build context to Docker daemon" when the context is sent to the daemon. |
|
| 37 |
+ |
|
| 38 |
+**sudo docker build -t repository/tag .** |
|
| 39 |
+ -- specifies a repository and tag at which to save the new image if the build |
|
| 40 |
+ succeeds. The Docker daemon runs the steps one-by-one, committing the result |
|
| 41 |
+ to a new image if necessary before finally outputting the ID of the new |
|
| 42 |
+ image. The Docker daemon automatically cleans up the context it is given. |
|
| 43 |
+ |
|
| 44 |
+Docker re-uses intermediate images whenever possible. This significantly |
|
| 45 |
+accelerates the *docker build* process. |
|
| 46 |
+ |
|
| 47 |
+# FORMAT |
|
| 48 |
+ |
|
| 49 |
+**FROM image** |
|
| 50 |
+or |
|
| 51 |
+**FROM image:tag** |
|
| 52 |
+ -- The FROM instruction sets the base image for subsequent instructions. A |
|
| 53 |
+ valid Dockerfile must have FROM as its first instruction. The image can be any |
|
| 54 |
+ valid image. It is easy to start by pulling an image from the public |
|
| 55 |
+ repositories. |
|
| 56 |
+ -- FROM must be he first non-comment instruction in Dockerfile. |
|
| 57 |
+ -- FROM may appear multiple times within a single Dockerfile in order to create |
|
| 58 |
+ multiple images. Make a note of the last image id output by the commit before |
|
| 59 |
+ each new FROM command. |
|
| 60 |
+ -- If no tag is given to the FROM instruction, latest is assumed. If the used |
|
| 61 |
+ tag does not exist, an error is returned. |
|
| 62 |
+ |
|
| 63 |
+**MAINTAINER** |
|
| 64 |
+ --The MAINTAINER instruction sets the Author field for the generated images. |
|
| 65 |
+ |
|
| 66 |
+**RUN** |
|
| 67 |
+ --RUN has two forms: |
|
| 68 |
+ **RUN <command>** |
|
| 69 |
+ -- (the command is run in a shell - /bin/sh -c) |
|
| 70 |
+ **RUN ["executable", "param1", "param2"]** |
|
| 71 |
+ --The above is executable form. |
|
| 72 |
+ --The RUN instruction executes any commands in a new layer on top of the |
|
| 73 |
+ current image and commits the results. The committed image is used for the next |
|
| 74 |
+ step in Dockerfile. |
|
| 75 |
+ --Layering RUN instructions and generating commits conforms to the core |
|
| 76 |
+ concepts of Docker where commits are cheap and containers can be created from |
|
| 77 |
+ any point in the history of an image. This is similar to source control. The |
|
| 78 |
+ exec form makes it possible to avoid shell string munging. The exec form makes |
|
| 79 |
+ it possible to RUN commands using a base image that does not contain /bin/sh. |
|
| 80 |
+ |
|
| 81 |
+**CMD** |
|
| 82 |
+ --CMD has three forms: |
|
| 83 |
+ **CMD ["executable", "param1", "param2"]** This is the preferred form, the |
|
| 84 |
+ exec form. |
|
| 85 |
+ **CMD ["param1", "param2"]** This command provides default parameters to |
|
| 86 |
+ ENTRYPOINT) |
|
| 87 |
+ **CMD command param1 param2** This command is run as a shell. |
|
| 88 |
+ --There can be only one CMD in a Dockerfile. If more than one CMD is listed, only |
|
| 89 |
+ the last CMD takes effect. |
|
| 90 |
+ The main purpose of a CMD is to provide defaults for an executing container. |
|
| 91 |
+ These defaults may include an executable, or they can omit the executable. If |
|
| 92 |
+ they omit the executable, an ENTRYPOINT must be specified. |
|
| 93 |
+ When used in the shell or exec formats, the CMD instruction sets the command to |
|
| 94 |
+ be executed when running the image. |
|
| 95 |
+ If you use the shell form of of the CMD, the <command> executes in /bin/sh -c: |
|
| 96 |
+ **FROM ubuntu** |
|
| 97 |
+ **CMD echo "This is a test." | wc -** |
|
| 98 |
+ If you run <command> wihtout a shell, then you must express the command as a |
|
| 99 |
+ JSON arry and give the full path to the executable. This array form is the |
|
| 100 |
+ preferred form of CMD. All additional parameters must be individually expressed |
|
| 101 |
+ as strings in the array: |
|
| 102 |
+ **FROM ubuntu** |
|
| 103 |
+ **CMD ["/usr/bin/wc","--help"]** |
|
| 104 |
+ To make the container run the same executable every time, use ENTRYPOINT in |
|
| 105 |
+ combination with CMD. |
|
| 106 |
+ If the user specifies arguments to docker run, the specified commands override |
|
| 107 |
+ the default in CMD. |
|
| 108 |
+ Do not confuse **RUN** with **CMD**. RUN runs a command and commits the result. CMD |
|
| 109 |
+ executes nothing at build time, but specifies the intended command for the |
|
| 110 |
+ image. |
|
| 111 |
+ |
|
| 112 |
+**EXPOSE** |
|
| 113 |
+ --**EXPOSE <port> [<port>...]** |
|
| 114 |
+ The **EXPOSE** instruction informs Docker that the container listens on the |
|
| 115 |
+ specified network ports at runtime. Docker uses this information to |
|
| 116 |
+ interconnect containers using links, and to set up port redirection on the host |
|
| 117 |
+ system. |
|
| 118 |
+ |
|
| 119 |
+**ENV** |
|
| 120 |
+ --**ENV <key> <value>** |
|
| 121 |
+ The ENV instruction sets the environment variable <key> to |
|
| 122 |
+ the value <value>. This value is passed to all future RUN instructions. This is |
|
| 123 |
+ functionally equivalent to prefixing the command with **<key>=<value>**. The |
|
| 124 |
+ environment variables that are set with ENV persist when a container is run |
|
| 125 |
+ from the resulting image. Use docker inspect to inspect these values, and |
|
| 126 |
+ change them using docker run **--env <key>=<value>.** |
|
| 127 |
+ |
|
| 128 |
+ Note that setting Setting **ENV DEBIAN_FRONTEND noninteractive** may cause |
|
| 129 |
+ unintended consequences, because it will persist when the container is run |
|
| 130 |
+ interactively, as with the following command: **docker run -t -i image bash** |
|
| 131 |
+ |
|
| 132 |
+**ADD** |
|
| 133 |
+ --**ADD <src> <dest>** The ADD instruction copies new files from <src> and adds them |
|
| 134 |
+ to the filesystem of the container at path <dest>. <src> must be the path to a |
|
| 135 |
+ file or directory relative to the source directory that is being built (the |
|
| 136 |
+ context of the build) or a remote file URL. <dest> is the absolute path to |
|
| 137 |
+ which the source is copied inside the target container. All new files and |
|
| 138 |
+ directories are created with mode 0755, with uid and gid 0. |
|
| 139 |
+ |
|
| 140 |
+**ENTRYPOINT** |
|
| 141 |
+ --**ENTRYPOINT** has two forms: ENTRYPOINT ["executable", "param1", "param2"] |
|
| 142 |
+ (This is like an exec, and is the preferred form.) ENTRYPOINT command param1 |
|
| 143 |
+ param2 (This is running as a shell.) An ENTRYPOINT helps you configure a |
|
| 144 |
+ container that can be run as an executable. When you specify an ENTRYPOINT, |
|
| 145 |
+ the whole container runs as if it was only that executable. The ENTRYPOINT |
|
| 146 |
+ instruction adds an entry command that is not overwritten when arguments are |
|
| 147 |
+ passed to docker run. This is different from the behavior of CMD. This allows |
|
| 148 |
+ arguments to be passed to the entrypoint, for instance docker run <image> -d |
|
| 149 |
+ passes the -d argument to the ENTRYPOINT. Specify parameters either in the |
|
| 150 |
+ ENTRYPOINT JSON array (as in the preferred exec form above), or by using a CMD |
|
| 151 |
+ statement. Parameters in the ENTRYPOINT are not overwritten by the docker run |
|
| 152 |
+ arguments. Parameters specifies via CMD are overwritten by docker run |
|
| 153 |
+ arguments. Specify a plain string for the ENTRYPOINT, and it will execute in |
|
| 154 |
+ /bin/sh -c, like a CMD instruction: |
|
| 155 |
+ FROM ubuntu |
|
| 156 |
+ ENTRYPOINT wc -l - |
|
| 157 |
+ This means that the Dockerfile's image always takes stdin as input (that's |
|
| 158 |
+ what "-" means), and prints the number of lines (that's what "-l" means). To |
|
| 159 |
+ make this optional but default, use a CMD: |
|
| 160 |
+ FROM ubuntu |
|
| 161 |
+ CMD ["-l", "-"] |
|
| 162 |
+ ENTRYPOINT ["/usr/bin/wc"] |
|
| 163 |
+ |
|
| 164 |
+**VOLUME** |
|
| 165 |
+ --**VOLUME ["/data"]** |
|
| 166 |
+ The VOLUME instruction creates a mount point with the specified name and marks |
|
| 167 |
+ it as holding externally-mounted volumes from the native host or from other |
|
| 168 |
+ containers. |
|
| 169 |
+ |
|
| 170 |
+**USER** |
|
| 171 |
+ -- **USER daemon** |
|
| 172 |
+ The USER instruction sets the username or UID that is used when running the |
|
| 173 |
+ image. |
|
| 174 |
+ |
|
| 175 |
+**WORKDIR** |
|
| 176 |
+ -- **WORKDIR /path/to/workdir** |
|
| 177 |
+ The WORKDIR instruction sets the working directory for the **RUN**, **CMD**, and **ENTRYPOINT** Dockerfile commands that follow it. |
|
| 178 |
+ It can be used multiple times in a single Dockerfile. Relative paths are defined relative to the path of the previous **WORKDIR** instruction. For example: |
|
| 179 |
+ **WORKDIR /a WORKDIR /b WORKDIR c RUN pwd** |
|
| 180 |
+ In the above example, the output of the **pwd** command is **a/b/c**. |
|
| 181 |
+ |
|
| 182 |
+**ONBUILD** |
|
| 183 |
+ -- **ONBUILD [INSTRUCTION]** |
|
| 184 |
+ The ONBUILD instruction adds a trigger instruction to the image, which is |
|
| 185 |
+ executed at a later time, when the image is used as the base for another |
|
| 186 |
+ build. The trigger is executed in the context of the downstream build, as |
|
| 187 |
+ if it had been inserted immediately after the FROM instruction in the |
|
| 188 |
+ downstream Dockerfile. Any build instruction can be registered as a |
|
| 189 |
+ trigger. This is useful if you are building an image to be |
|
| 190 |
+ used as a base for building other images, for example an application build |
|
| 191 |
+ environment or a daemon to be customized with a user-specific |
|
| 192 |
+ configuration. For example, if your image is a reusable python |
|
| 193 |
+ application builder, it requires application source code to be |
|
| 194 |
+ added in a particular directory, and might require a build script |
|
| 195 |
+ to be called after that. You can't just call ADD and RUN now, because |
|
| 196 |
+ you don't yet have access to the application source code, and it |
|
| 197 |
+ is different for each application build. Providing |
|
| 198 |
+ application developers with a boilerplate Dockerfile to copy-paste |
|
| 199 |
+ into their application is inefficient, error-prone, and |
|
| 200 |
+ difficult to update because it mixes with application-specific code. |
|
| 201 |
+ The solution is to use **ONBUILD** to register instructions in advance, to |
|
| 202 |
+ run later, during the next build stage. |
|
| 203 |
+ |
|
| 204 |
+# HISTORY |
|
| 205 |
+*May 2014, Compiled by Zac Dover (zdover at redhat dot com) based on docker.io Dockerfile documentation. |
| 0 | 206 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,71 @@ |
| 0 |
+Docker Documentation |
|
| 1 |
+==================== |
|
| 2 |
+ |
|
| 3 |
+This directory contains the Docker user manual in the Markdown format. |
|
| 4 |
+Do *not* edit the man pages in the man1 directory. Instead, amend the |
|
| 5 |
+Markdown (*.md) files. |
|
| 6 |
+ |
|
| 7 |
+# File List |
|
| 8 |
+ |
|
| 9 |
+ docker.md |
|
| 10 |
+ docker-attach.md |
|
| 11 |
+ docker-build.md |
|
| 12 |
+ docker-commit.md |
|
| 13 |
+ docker-cp.md |
|
| 14 |
+ docker-diff.md |
|
| 15 |
+ docker-events.md |
|
| 16 |
+ docker-export.md |
|
| 17 |
+ docker-history.md |
|
| 18 |
+ docker-images.md |
|
| 19 |
+ docker-import.md |
|
| 20 |
+ docker-info.md |
|
| 21 |
+ docker-inspect.md |
|
| 22 |
+ docker-kill.md |
|
| 23 |
+ docker-load.md |
|
| 24 |
+ docker-login.md |
|
| 25 |
+ docker-logs.md |
|
| 26 |
+ docker-port.md |
|
| 27 |
+ docker-ps.md |
|
| 28 |
+ docker-pull.md |
|
| 29 |
+ docker-push.md |
|
| 30 |
+ docker-restart.md |
|
| 31 |
+ docker-rmi.md |
|
| 32 |
+ docker-rm.md |
|
| 33 |
+ docker-run.md |
|
| 34 |
+ docker-save.md |
|
| 35 |
+ docker-search.md |
|
| 36 |
+ docker-start.md |
|
| 37 |
+ docker-stop.md |
|
| 38 |
+ docker-tag.md |
|
| 39 |
+ docker-top.md |
|
| 40 |
+ docker-wait.md |
|
| 41 |
+ Dockerfile |
|
| 42 |
+ md2man-all.sh |
|
| 43 |
+ |
|
| 44 |
+# Generating man pages from the Markdown files |
|
| 45 |
+ |
|
| 46 |
+The recommended approach for generating the man pages is via a Docker |
|
| 47 |
+container. Using the supplied Dockerfile, Docker will create a Fedora based |
|
| 48 |
+container and isolate the Pandoc installation. This is a seamless process, |
|
| 49 |
+saving you from dealing with Pandoc and dependencies on your own computer. |
|
| 50 |
+ |
|
| 51 |
+## Building the Fedora / Pandoc image |
|
| 52 |
+ |
|
| 53 |
+There is a Dockerfile provided in the `docker/contrib/man/md` directory. |
|
| 54 |
+ |
|
| 55 |
+Using this Dockerfile, create a Docker image tagged `fedora/pandoc`: |
|
| 56 |
+ |
|
| 57 |
+ docker build -t fedora/pandoc . |
|
| 58 |
+ |
|
| 59 |
+## Utilizing the Fedora / Pandoc image |
|
| 60 |
+ |
|
| 61 |
+Once the image is built, run a container using the image with *volumes*: |
|
| 62 |
+ |
|
| 63 |
+ docker run -v /<path-to-git-dir>/docker/contrib/man:/pandoc:rw \ |
|
| 64 |
+ -w /pandoc -i fedora/pandoc /pandoc/md/md2man-all.sh |
|
| 65 |
+ |
|
| 66 |
+The Pandoc Docker container will process the Markdown files and generate |
|
| 67 |
+the man pages inside the `docker/contrib/man/man1` directory using |
|
| 68 |
+Docker volumes. For more information on Docker volumes see the man page for |
|
| 69 |
+`docker run` and also look at the article [Sharing Directories via Volumes] |
|
| 70 |
+(http://docs.docker.io/use/working_with_volumes/). |
| 0 | 71 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,58 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-attach - Attach to a running container |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker attach** **--no-stdin**[=*false*] **--sig-proxy**[=*true*] CONTAINER |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+If you **docker run** a container in detached mode (**-d**), you can reattach to |
|
| 11 |
+the detached container with **docker attach** using the container's ID or name. |
|
| 12 |
+ |
|
| 13 |
+You can detach from the container again (and leave it running) with `CTRL-q |
|
| 14 |
+CTRL-q` (for a quiet exit), or `CTRL-c` which will send a SIGKILL to the |
|
| 15 |
+container, or `CTRL-\` to get a stacktrace of the Docker client when it quits. |
|
| 16 |
+When you detach from a container the exit code will be returned to |
|
| 17 |
+the client. |
|
| 18 |
+ |
|
| 19 |
+# OPTIONS |
|
| 20 |
+**--no-stdin**=*true*|*false* |
|
| 21 |
+When set to true, do not attach to stdin. The default is *false*. |
|
| 22 |
+ |
|
| 23 |
+**--sig-proxy**=*true*|*false*: |
|
| 24 |
+When set to true, proxify all received signal to the process (even in non-tty |
|
| 25 |
+mode). The default is *true*. |
|
| 26 |
+ |
|
| 27 |
+# EXAMPLES |
|
| 28 |
+ |
|
| 29 |
+## Attaching to a container |
|
| 30 |
+ |
|
| 31 |
+In this example the top command is run inside a container, from an image called |
|
| 32 |
+fedora, in detached mode. The ID from the container is passed into the **docker |
|
| 33 |
+attach** command: |
|
| 34 |
+ |
|
| 35 |
+ # ID=$(sudo docker run -d fedora /usr/bin/top -b) |
|
| 36 |
+ # sudo docker attach $ID |
|
| 37 |
+ top - 02:05:52 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 |
|
| 38 |
+ Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie |
|
| 39 |
+ 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 |
|
| 40 |
+ Mem: 373572k total, 355560k used, 18012k free, 27872k buffers |
|
| 41 |
+ Swap: 786428k total, 0k used, 786428k free, 221740k cached |
|
| 42 |
+ |
|
| 43 |
+ PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
|
| 44 |
+ 1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top |
|
| 45 |
+ |
|
| 46 |
+ top - 02:05:55 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 |
|
| 47 |
+ Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie |
|
| 48 |
+ 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 |
|
| 49 |
+ Mem: 373572k total, 355244k used, 18328k free, 27872k buffers |
|
| 50 |
+ Swap: 786428k total, 0k used, 786428k free, 221776k cached |
|
| 51 |
+ |
|
| 52 |
+ PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
|
| 53 |
+ 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top |
|
| 54 |
+ |
|
| 55 |
+# HISTORY |
|
| 56 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 57 |
+based on docker.io source material and internal work. |
| 0 | 58 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,117 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-build - Build an image from a Dockerfile source at PATH |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker build** [**--no-cache**[=*false*]] [**-q**|**--quiet**[=*false*]] |
|
| 8 |
+ [**--rm**] [**-t**|**--tag**=TAG] PATH | URL | - |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+This will read the Dockerfile from the directory specified in **PATH**. |
|
| 12 |
+It also sends any other files and directories found in the current |
|
| 13 |
+directory to the Docker daemon. The contents of this directory would |
|
| 14 |
+be used by **ADD** commands found within the Dockerfile. |
|
| 15 |
+ |
|
| 16 |
+Warning, this will send a lot of data to the Docker daemon depending |
|
| 17 |
+on the contents of the current directory. The build is run by the Docker |
|
| 18 |
+daemon, not by the CLI, so the whole context must be transferred to the daemon. |
|
| 19 |
+The Docker CLI reports "Sending build context to Docker daemon" when the context is sent to |
|
| 20 |
+the daemon. |
|
| 21 |
+ |
|
| 22 |
+When a single Dockerfile is given as the URL, then no context is set. |
|
| 23 |
+When a Git repository is set as the **URL**, the repository is used |
|
| 24 |
+as context. |
|
| 25 |
+ |
|
| 26 |
+# OPTIONS |
|
| 27 |
+ |
|
| 28 |
+**-q**, **--quiet**=*true*|*false* |
|
| 29 |
+ When set to true, suppress verbose build output. Default is *false*. |
|
| 30 |
+ |
|
| 31 |
+**--rm**=*true*|*false* |
|
| 32 |
+ When true, remove intermediate containers that are created during the |
|
| 33 |
+build process. The default is true. |
|
| 34 |
+ |
|
| 35 |
+**-t**, **--tag**=*tag* |
|
| 36 |
+ The name to be applied to the resulting image on successful completion of |
|
| 37 |
+the build. `tag` in this context means the entire image name including the |
|
| 38 |
+optional TAG after the ':'. |
|
| 39 |
+ |
|
| 40 |
+**--no-cache**=*true*|*false* |
|
| 41 |
+ When set to true, do not use a cache when building the image. The |
|
| 42 |
+default is *false*. |
|
| 43 |
+ |
|
| 44 |
+# EXAMPLES |
|
| 45 |
+ |
|
| 46 |
+## Building an image using a Dockefile located inside the current directory |
|
| 47 |
+ |
|
| 48 |
+Docker images can be built using the build command and a Dockerfile: |
|
| 49 |
+ |
|
| 50 |
+ docker build . |
|
| 51 |
+ |
|
| 52 |
+During the build process Docker creates intermediate images. In order to |
|
| 53 |
+keep them, you must explicitly set `--rm=false`. |
|
| 54 |
+ |
|
| 55 |
+ docker build --rm=false . |
|
| 56 |
+ |
|
| 57 |
+A good practice is to make a sub-directory with a related name and create |
|
| 58 |
+the Dockerfile in that directory. For example, a directory called mongo may |
|
| 59 |
+contain a Dockerfile to create a Docker MongoDB image. Likewise, another |
|
| 60 |
+directory called httpd may be used to store Dockerfiles for Apache web |
|
| 61 |
+server images. |
|
| 62 |
+ |
|
| 63 |
+It is also a good practice to add the files required for the image to the |
|
| 64 |
+sub-directory. These files will then be specified with the `ADD` instruction |
|
| 65 |
+in the Dockerfile. Note: If you include a tar file (a good practice!), then |
|
| 66 |
+Docker will automatically extract the contents of the tar file |
|
| 67 |
+specified within the `ADD` instruction into the specified target. |
|
| 68 |
+ |
|
| 69 |
+## Building an image and naming that image |
|
| 70 |
+ |
|
| 71 |
+A good practice is to give a name to the image you are building. There are |
|
| 72 |
+no hard rules here but it is best to give the names consideration. |
|
| 73 |
+ |
|
| 74 |
+The **-t**/**--tag** flag is used to rename an image. Here are some examples: |
|
| 75 |
+ |
|
| 76 |
+Though it is not a good practice, image names can be arbtrary: |
|
| 77 |
+ |
|
| 78 |
+ docker build -t myimage . |
|
| 79 |
+ |
|
| 80 |
+A better approach is to provide a fully qualified and meaningful repository, |
|
| 81 |
+name, and tag (where the tag in this context means the qualifier after |
|
| 82 |
+the ":"). In this example we build a JBoss image for the Fedora repository |
|
| 83 |
+and give it the version 1.0: |
|
| 84 |
+ |
|
| 85 |
+ docker build -t fedora/jboss:1.0 |
|
| 86 |
+ |
|
| 87 |
+The next example is for the "whenry" user repository and uses Fedora and |
|
| 88 |
+JBoss and gives it the version 2.1 : |
|
| 89 |
+ |
|
| 90 |
+ docker build -t whenry/fedora-jboss:V2.1 |
|
| 91 |
+ |
|
| 92 |
+If you do not provide a version tag then Docker will assign `latest`: |
|
| 93 |
+ |
|
| 94 |
+ docker build -t whenry/fedora-jboss |
|
| 95 |
+ |
|
| 96 |
+When you list the images, the image above will have the tag `latest`. |
|
| 97 |
+ |
|
| 98 |
+So renaming an image is arbitrary but consideration should be given to |
|
| 99 |
+a useful convention that makes sense for consumers and should also take |
|
| 100 |
+into account Docker community conventions. |
|
| 101 |
+ |
|
| 102 |
+ |
|
| 103 |
+## Building an image using a URL |
|
| 104 |
+ |
|
| 105 |
+This will clone the specified Github repository from the URL and use it |
|
| 106 |
+as context. The Dockerfile at the root of the repository is used as |
|
| 107 |
+Dockerfile. This only works if the Github repository is a dedicated |
|
| 108 |
+repository. |
|
| 109 |
+ |
|
| 110 |
+ docker build github.com/scollier/Fedora-Dockerfiles/tree/master/apache |
|
| 111 |
+ |
|
| 112 |
+Note: You can set an arbitrary Git repository via the `git://` schema. |
|
| 113 |
+ |
|
| 114 |
+# HISTORY |
|
| 115 |
+March 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 116 |
+based on docker.io source material and internal work. |
| 0 | 117 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,34 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-commit - Create a new image from the changes to an existing |
|
| 5 |
+container |
|
| 6 |
+ |
|
| 7 |
+# SYNOPSIS |
|
| 8 |
+**docker commit** **-a**|**--author**[=""] **-m**|**--message**[=""] |
|
| 9 |
+CONTAINER [REPOSITORY[:TAG]] |
|
| 10 |
+ |
|
| 11 |
+# DESCRIPTION |
|
| 12 |
+Using an existing container's name or ID you can create a new image. |
|
| 13 |
+ |
|
| 14 |
+# OPTIONS |
|
| 15 |
+**-a, --author**="" |
|
| 16 |
+ Author name. (eg. "John Hannibal Smith <hannibal@a-team.com>" |
|
| 17 |
+ |
|
| 18 |
+**-m, --message**="" |
|
| 19 |
+ Commit message |
|
| 20 |
+ |
|
| 21 |
+# EXAMPLES |
|
| 22 |
+ |
|
| 23 |
+## Creating a new image from an existing container |
|
| 24 |
+An existing Fedora based container has had Apache installed while running |
|
| 25 |
+in interactive mode with the bash shell. Apache is also running. To |
|
| 26 |
+create a new image run docker ps to find the container's ID and then run: |
|
| 27 |
+ |
|
| 28 |
+ # docker commit -m= "Added Apache to Fedora base image" \ |
|
| 29 |
+ -a="A D Ministrator" 98bd7fc99854 fedora/fedora_httpd:20 |
|
| 30 |
+ |
|
| 31 |
+# HISTORY |
|
| 32 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 33 |
+based on docker.io source material and in |
| 0 | 34 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,24 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-cp - Copy files/folders from the PATH to the HOSTPATH |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker cp** CONTAINER:PATH HOSTPATH |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+Copy files/folders from the containers filesystem to the host |
|
| 11 |
+path. Paths are relative to the root of the filesystem. Files |
|
| 12 |
+can be copied from a running or stopped container. |
|
| 13 |
+ |
|
| 14 |
+# EXAMPLE |
|
| 15 |
+An important shell script file, created in a bash shell, is copied from |
|
| 16 |
+the exited container to the current dir on the host: |
|
| 17 |
+ |
|
| 18 |
+ # docker cp c071f3c3ee81:setup.sh . |
|
| 19 |
+ |
|
| 20 |
+# HISTORY |
|
| 21 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 22 |
+based on docker.io source material and internal work. |
|
| 23 |
+ |
| 0 | 24 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,44 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-diff - Inspect changes on a container's filesystem |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker diff** CONTAINER |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+Inspect changes on a container's filesystem. You can use the full or |
|
| 11 |
+shortened container ID or the container name set using |
|
| 12 |
+**docker run --name** option. |
|
| 13 |
+ |
|
| 14 |
+# EXAMPLE |
|
| 15 |
+Inspect the changes to on a nginx container: |
|
| 16 |
+ |
|
| 17 |
+ # docker diff 1fdfd1f54c1b |
|
| 18 |
+ C /dev |
|
| 19 |
+ C /dev/console |
|
| 20 |
+ C /dev/core |
|
| 21 |
+ C /dev/stdout |
|
| 22 |
+ C /dev/fd |
|
| 23 |
+ C /dev/ptmx |
|
| 24 |
+ C /dev/stderr |
|
| 25 |
+ C /dev/stdin |
|
| 26 |
+ C /run |
|
| 27 |
+ A /run/nginx.pid |
|
| 28 |
+ C /var/lib/nginx/tmp |
|
| 29 |
+ A /var/lib/nginx/tmp/client_body |
|
| 30 |
+ A /var/lib/nginx/tmp/fastcgi |
|
| 31 |
+ A /var/lib/nginx/tmp/proxy |
|
| 32 |
+ A /var/lib/nginx/tmp/scgi |
|
| 33 |
+ A /var/lib/nginx/tmp/uwsgi |
|
| 34 |
+ C /var/log/nginx |
|
| 35 |
+ A /var/log/nginx/access.log |
|
| 36 |
+ A /var/log/nginx/error.log |
|
| 37 |
+ |
|
| 38 |
+ |
|
| 39 |
+# HISTORY |
|
| 40 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 41 |
+based on docker.io source material and internal work. |
|
| 42 |
+ |
|
| 43 |
+ |
| 0 | 44 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,46 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-events - Get real time events from the server |
|
| 5 |
+ |
|
| 6 |
+**docker events** **--since**=""|*epoch-time* |
|
| 7 |
+ |
|
| 8 |
+# DESCRIPTION |
|
| 9 |
+Get event information from the Docker daemon. Information can include historical |
|
| 10 |
+information and real-time information. |
|
| 11 |
+ |
|
| 12 |
+# OPTIONS |
|
| 13 |
+**--since**="" |
|
| 14 |
+Show previously created events and then stream. This can be in either |
|
| 15 |
+seconds since epoch, or date string. |
|
| 16 |
+ |
|
| 17 |
+# EXAMPLES |
|
| 18 |
+ |
|
| 19 |
+## Listening for Docker events |
|
| 20 |
+ |
|
| 21 |
+After running docker events a container 786d698004576 is started and stopped |
|
| 22 |
+(The container name has been shortened in the output below): |
|
| 23 |
+ |
|
| 24 |
+ # docker events |
|
| 25 |
+ [2014-04-12 18:23:04 -0400 EDT] 786d69800457: (from whenry/testimage:latest) start |
|
| 26 |
+ [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) die |
|
| 27 |
+ [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) stop |
|
| 28 |
+ |
|
| 29 |
+## Listening for events since a given date |
|
| 30 |
+Again the output container IDs have been shortened for the purposes of this document: |
|
| 31 |
+ |
|
| 32 |
+ # docker events --since '2014-04-12' |
|
| 33 |
+ [2014-04-12 18:11:28 -0400 EDT] c655dbf640dc: (from whenry/testimage:latest) create |
|
| 34 |
+ [2014-04-12 18:11:28 -0400 EDT] c655dbf640dc: (from whenry/testimage:latest) start |
|
| 35 |
+ [2014-04-12 18:14:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) create |
|
| 36 |
+ [2014-04-12 18:14:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) start |
|
| 37 |
+ [2014-04-12 18:22:44 -0400 EDT] 786d69800457: (from whenry/testimage:latest) die |
|
| 38 |
+ [2014-04-12 18:22:44 -0400 EDT] 786d69800457: (from whenry/testimage:latest) stop |
|
| 39 |
+ [2014-04-12 18:23:04 -0400 EDT] 786d69800457: (from whenry/testimage:latest) start |
|
| 40 |
+ [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) die |
|
| 41 |
+ [2014-04-12 18:23:13 -0400 EDT] 786d69800457: (from whenry/testimage:latest) stop |
|
| 42 |
+ |
|
| 43 |
+# HISTORY |
|
| 44 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 45 |
+based on docker.io source material and internal work. |
| 0 | 46 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,26 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-export - Export the contents of a filesystem as a tar archive to |
|
| 5 |
+STDOUT. |
|
| 6 |
+ |
|
| 7 |
+# SYNOPSIS |
|
| 8 |
+**docker export** CONTAINER |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+Export the contents of a container's filesystem using the full or shortened |
|
| 12 |
+container ID or container name. The output is exported to STDOUT and can be |
|
| 13 |
+redirected to a tar file. |
|
| 14 |
+ |
|
| 15 |
+# EXAMPLE |
|
| 16 |
+Export the contents of the container called angry_bell to a tar file |
|
| 17 |
+called test.tar: |
|
| 18 |
+ |
|
| 19 |
+ # docker export angry_bell > test.tar |
|
| 20 |
+ # ls *.tar |
|
| 21 |
+ test.tar |
|
| 22 |
+ |
|
| 23 |
+# HISTORY |
|
| 24 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 25 |
+based on docker.io source material and internal work. |
| 0 | 26 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,32 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-history - Show the history of an image |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker history** **--no-trunc**[=*false*] [**-q**|**--quiet**[=*false*]] |
|
| 8 |
+ IMAGE |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+ |
|
| 12 |
+Show the history of when and how an image was created. |
|
| 13 |
+ |
|
| 14 |
+# OPTIONS |
|
| 15 |
+ |
|
| 16 |
+**--no-trunc**=*true*|*false* |
|
| 17 |
+ When true don't truncate output. Default is false |
|
| 18 |
+ |
|
| 19 |
+**-q**, **--quiet=*true*|*false* |
|
| 20 |
+ When true only show numeric IDs. Default is false. |
|
| 21 |
+ |
|
| 22 |
+# EXAMPLE |
|
| 23 |
+ $ sudo docker history fedora |
|
| 24 |
+ IMAGE CREATED CREATED BY SIZE |
|
| 25 |
+ 105182bb5e8b 5 days ago /bin/sh -c #(nop) ADD file:71356d2ad59aa3119d 372.7 MB |
|
| 26 |
+ 73bd853d2ea5 13 days ago /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar 0 B |
|
| 27 |
+ 511136ea3c5a 10 months ago 0 B |
|
| 28 |
+ |
|
| 29 |
+# HISTORY |
|
| 30 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 31 |
+based on docker.io source material and internal work. |
| 0 | 32 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,99 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-images - List the images in the local repository |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker images** |
|
| 8 |
+[**-a**|**--all**=*false*] |
|
| 9 |
+[**--no-trunc**[=*false*] |
|
| 10 |
+[**-q**|**--quiet**[=*false*] |
|
| 11 |
+[**-t**|**--tree**=*false*] |
|
| 12 |
+[**-v**|**--viz**=*false*] |
|
| 13 |
+[NAME] |
|
| 14 |
+ |
|
| 15 |
+# DESCRIPTION |
|
| 16 |
+This command lists the images stored in the local Docker repository. |
|
| 17 |
+ |
|
| 18 |
+By default, intermediate images, used during builds, are not listed. Some of the |
|
| 19 |
+output, e.g. image ID, is truncated, for space reasons. However the truncated |
|
| 20 |
+image ID, and often the first few characters, are enough to be used in other |
|
| 21 |
+Docker commands that use the image ID. The output includes repository, tag, image |
|
| 22 |
+ID, date created and the virtual size. |
|
| 23 |
+ |
|
| 24 |
+The title REPOSITORY for the first title may seem confusing. It is essentially |
|
| 25 |
+the image name. However, because you can tag a specific image, and multiple tags |
|
| 26 |
+(image instances) can be associated with a single name, the name is really a |
|
| 27 |
+repository for all tagged images of the same name. For example consider an image |
|
| 28 |
+called fedora. It may be tagged with 18, 19, or 20, etc. to manage different |
|
| 29 |
+versions. |
|
| 30 |
+ |
|
| 31 |
+# OPTIONS |
|
| 32 |
+ |
|
| 33 |
+**-a**, **--all**=*true*|*false* |
|
| 34 |
+ When set to true, also include all intermediate images in the list. The |
|
| 35 |
+default is false. |
|
| 36 |
+ |
|
| 37 |
+**--no-trunc**=*true*|*false* |
|
| 38 |
+ When set to true, list the full image ID and not the truncated ID. The |
|
| 39 |
+default is false. |
|
| 40 |
+ |
|
| 41 |
+**-q**, **--quiet**=*true*|*false* |
|
| 42 |
+ When set to true, list the complete image ID as part of the output. The |
|
| 43 |
+default is false. |
|
| 44 |
+ |
|
| 45 |
+**-t**, **--tree**=*true*|*false* |
|
| 46 |
+ When set to true, list the images in a tree dependency tree (hierarchy) |
|
| 47 |
+format. The default is false. |
|
| 48 |
+ |
|
| 49 |
+**-v**, **--viz**=*true*|*false* |
|
| 50 |
+ When set to true, list the graph in graphviz format. The default is |
|
| 51 |
+*false*. |
|
| 52 |
+ |
|
| 53 |
+# EXAMPLES |
|
| 54 |
+ |
|
| 55 |
+## Listing the images |
|
| 56 |
+ |
|
| 57 |
+To list the images in a local repository (not the registry) run: |
|
| 58 |
+ |
|
| 59 |
+ docker images |
|
| 60 |
+ |
|
| 61 |
+The list will contain the image repository name, a tag for the image, and an |
|
| 62 |
+image ID, when it was created and its virtual size. Columns: REPOSITORY, TAG, |
|
| 63 |
+IMAGE ID, CREATED, and VIRTUAL SIZE. |
|
| 64 |
+ |
|
| 65 |
+To get a verbose list of images which contains all the intermediate images |
|
| 66 |
+used in builds use **-a**: |
|
| 67 |
+ |
|
| 68 |
+ docker images -a |
|
| 69 |
+ |
|
| 70 |
+## List images dependency tree hierarchy |
|
| 71 |
+ |
|
| 72 |
+To list the images in the local repository (not the registry) in a dependency |
|
| 73 |
+tree format, use the **-t** option. |
|
| 74 |
+ |
|
| 75 |
+ docker images -t |
|
| 76 |
+ |
|
| 77 |
+This displays a staggered hierarchy tree where the less indented image is |
|
| 78 |
+the oldest with dependent image layers branching inward (to the right) on |
|
| 79 |
+subsequent lines. The newest or top level image layer is listed last in |
|
| 80 |
+any tree branch. |
|
| 81 |
+ |
|
| 82 |
+## List images in GraphViz format |
|
| 83 |
+ |
|
| 84 |
+To display the list in a format consumable by a GraphViz tools run with |
|
| 85 |
+**-v**. For example to produce a .png graph file of the hierarchy use: |
|
| 86 |
+ |
|
| 87 |
+ docker images --viz | dot -Tpng -o docker.png |
|
| 88 |
+ |
|
| 89 |
+## Listing only the shortened image IDs |
|
| 90 |
+ |
|
| 91 |
+Listing just the shortened image IDs. This can be useful for some automated |
|
| 92 |
+tools. |
|
| 93 |
+ |
|
| 94 |
+ docker images -q |
|
| 95 |
+ |
|
| 96 |
+# HISTORY |
|
| 97 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 98 |
+based on docker.io source material and internal work. |
| 0 | 99 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,39 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-import - Create an empty filesystem image and import the contents |
|
| 5 |
+of the tarball into it. |
|
| 6 |
+ |
|
| 7 |
+# SYNOPSIS |
|
| 8 |
+**docker import** URL|- [REPOSITORY[:TAG]] |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+Create a new filesystem image from the contents of a tarball (`.tar`, |
|
| 12 |
+`.tar.gz`, `.tgz`, `.bzip`, `.tar.xz`, `.txz`) into it, then optionally tag it. |
|
| 13 |
+ |
|
| 14 |
+# EXAMPLES |
|
| 15 |
+ |
|
| 16 |
+## Import from a remote location |
|
| 17 |
+ |
|
| 18 |
+ # docker import http://example.com/exampleimage.tgz example/imagerepo |
|
| 19 |
+ |
|
| 20 |
+## Import from a local file |
|
| 21 |
+ |
|
| 22 |
+Import to docker via pipe and stdin: |
|
| 23 |
+ |
|
| 24 |
+ # cat exampleimage.tgz | docker import - example/imagelocal |
|
| 25 |
+ |
|
| 26 |
+## Import from a local file and tag |
|
| 27 |
+ |
|
| 28 |
+Import to docker via pipe and stdin: |
|
| 29 |
+ |
|
| 30 |
+ # cat exampleimageV2.tgz | docker import - example/imagelocal:V-2.0 |
|
| 31 |
+ |
|
| 32 |
+## Import from a local directory |
|
| 33 |
+ |
|
| 34 |
+ # tar -c . | docker import - exampleimagedir |
|
| 35 |
+ |
|
| 36 |
+# HISTORY |
|
| 37 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 38 |
+based on docker.io source material and internal work. |
| 0 | 39 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,46 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-info - Display system wide information |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker info** |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+This command displays system wide information regarding the Docker installation. |
|
| 11 |
+Information displayed includes the number of containers and images, pool name, |
|
| 12 |
+data file, metadata file, data space used, total data space, metadata space used |
|
| 13 |
+, total metadata space, execution driver, and the kernel version. |
|
| 14 |
+ |
|
| 15 |
+The data file is where the images are stored and the metadata file is where the |
|
| 16 |
+meta data regarding those images are stored. When run for the first time Docker |
|
| 17 |
+allocates a certain amount of data space and meta data space from the space |
|
| 18 |
+available on the volume where `/var/lib/docker` is mounted. |
|
| 19 |
+ |
|
| 20 |
+# OPTIONS |
|
| 21 |
+There are no available options. |
|
| 22 |
+ |
|
| 23 |
+# EXAMPLES |
|
| 24 |
+ |
|
| 25 |
+## Display Docker system information |
|
| 26 |
+ |
|
| 27 |
+Here is a sample output: |
|
| 28 |
+ |
|
| 29 |
+ # docker info |
|
| 30 |
+ Containers: 18 |
|
| 31 |
+ Images: 95 |
|
| 32 |
+ Storage Driver: devicemapper |
|
| 33 |
+ Pool Name: docker-8:1-170408448-pool |
|
| 34 |
+ Data file: /var/lib/docker/devicemapper/devicemapper/data |
|
| 35 |
+ Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata |
|
| 36 |
+ Data Space Used: 9946.3 Mb |
|
| 37 |
+ Data Space Total: 102400.0 Mb |
|
| 38 |
+ Metadata Space Used: 9.9 Mb |
|
| 39 |
+ Metadata Space Total: 2048.0 Mb |
|
| 40 |
+ Execution Driver: native-0.1 |
|
| 41 |
+ Kernel Version: 3.10.0-116.el7.x86_64 |
|
| 42 |
+ |
|
| 43 |
+# HISTORY |
|
| 44 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 45 |
+based on docker.io source material and internal work. |
| 0 | 46 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,229 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-inspect - Return low-level information on a container/image |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker inspect** [**-f**|**--format**="" CONTAINER|IMAGE |
|
| 8 |
+[CONTAINER|IMAGE...] |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+ |
|
| 12 |
+This displays all the information available in Docker for a given |
|
| 13 |
+container or image. By default, this will render all results in a JSON |
|
| 14 |
+array. If a format is specified, the given template will be executed for |
|
| 15 |
+each result. |
|
| 16 |
+ |
|
| 17 |
+# OPTIONS |
|
| 18 |
+**-f**, **--format**="" |
|
| 19 |
+ The text/template package of Go describes all the details of the |
|
| 20 |
+format. See examples section |
|
| 21 |
+ |
|
| 22 |
+# EXAMPLES |
|
| 23 |
+ |
|
| 24 |
+## Getting information on a container |
|
| 25 |
+ |
|
| 26 |
+To get information on a container use it's ID or instance name: |
|
| 27 |
+ |
|
| 28 |
+ #docker inspect 1eb5fabf5a03 |
|
| 29 |
+ [{
|
|
| 30 |
+ "ID": "1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b", |
|
| 31 |
+ "Created": "2014-04-04T21:33:52.02361335Z", |
|
| 32 |
+ "Path": "/usr/sbin/nginx", |
|
| 33 |
+ "Args": [], |
|
| 34 |
+ "Config": {
|
|
| 35 |
+ "Hostname": "1eb5fabf5a03", |
|
| 36 |
+ "Domainname": "", |
|
| 37 |
+ "User": "", |
|
| 38 |
+ "Memory": 0, |
|
| 39 |
+ "MemorySwap": 0, |
|
| 40 |
+ "CpuShares": 0, |
|
| 41 |
+ "AttachStdin": false, |
|
| 42 |
+ "AttachStdout": false, |
|
| 43 |
+ "AttachStderr": false, |
|
| 44 |
+ "PortSpecs": null, |
|
| 45 |
+ "ExposedPorts": {
|
|
| 46 |
+ "80/tcp": {}
|
|
| 47 |
+ }, |
|
| 48 |
+ "Tty": true, |
|
| 49 |
+ "OpenStdin": false, |
|
| 50 |
+ "StdinOnce": false, |
|
| 51 |
+ "Env": [ |
|
| 52 |
+ "HOME=/", |
|
| 53 |
+ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
|
| 54 |
+ ], |
|
| 55 |
+ "Cmd": [ |
|
| 56 |
+ "/usr/sbin/nginx" |
|
| 57 |
+ ], |
|
| 58 |
+ "Dns": null, |
|
| 59 |
+ "DnsSearch": null, |
|
| 60 |
+ "Image": "summit/nginx", |
|
| 61 |
+ "Volumes": null, |
|
| 62 |
+ "VolumesFrom": "", |
|
| 63 |
+ "WorkingDir": "", |
|
| 64 |
+ "Entrypoint": null, |
|
| 65 |
+ "NetworkDisabled": false, |
|
| 66 |
+ "OnBuild": null, |
|
| 67 |
+ "Context": {
|
|
| 68 |
+ "mount_label": "system_u:object_r:svirt_sandbox_file_t:s0:c0,c650", |
|
| 69 |
+ "process_label": "system_u:system_r:svirt_lxc_net_t:s0:c0,c650" |
|
| 70 |
+ } |
|
| 71 |
+ }, |
|
| 72 |
+ "State": {
|
|
| 73 |
+ "Running": true, |
|
| 74 |
+ "Pid": 858, |
|
| 75 |
+ "ExitCode": 0, |
|
| 76 |
+ "StartedAt": "2014-04-04T21:33:54.16259207Z", |
|
| 77 |
+ "FinishedAt": "0001-01-01T00:00:00Z", |
|
| 78 |
+ "Ghost": false |
|
| 79 |
+ }, |
|
| 80 |
+ "Image": "df53773a4390e25936f9fd3739e0c0e60a62d024ea7b669282b27e65ae8458e6", |
|
| 81 |
+ "NetworkSettings": {
|
|
| 82 |
+ "IPAddress": "172.17.0.2", |
|
| 83 |
+ "IPPrefixLen": 16, |
|
| 84 |
+ "Gateway": "172.17.42.1", |
|
| 85 |
+ "Bridge": "docker0", |
|
| 86 |
+ "PortMapping": null, |
|
| 87 |
+ "Ports": {
|
|
| 88 |
+ "80/tcp": [ |
|
| 89 |
+ {
|
|
| 90 |
+ "HostIp": "0.0.0.0", |
|
| 91 |
+ "HostPort": "80" |
|
| 92 |
+ } |
|
| 93 |
+ ] |
|
| 94 |
+ } |
|
| 95 |
+ }, |
|
| 96 |
+ "ResolvConfPath": "/etc/resolv.conf", |
|
| 97 |
+ "HostnamePath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/hostname", |
|
| 98 |
+ "HostsPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/hosts", |
|
| 99 |
+ "Name": "/ecstatic_ptolemy", |
|
| 100 |
+ "Driver": "devicemapper", |
|
| 101 |
+ "ExecDriver": "native-0.1", |
|
| 102 |
+ "Volumes": {},
|
|
| 103 |
+ "VolumesRW": {},
|
|
| 104 |
+ "HostConfig": {
|
|
| 105 |
+ "Binds": null, |
|
| 106 |
+ "ContainerIDFile": "", |
|
| 107 |
+ "LxcConf": [], |
|
| 108 |
+ "Privileged": false, |
|
| 109 |
+ "PortBindings": {
|
|
| 110 |
+ "80/tcp": [ |
|
| 111 |
+ {
|
|
| 112 |
+ "HostIp": "0.0.0.0", |
|
| 113 |
+ "HostPort": "80" |
|
| 114 |
+ } |
|
| 115 |
+ ] |
|
| 116 |
+ }, |
|
| 117 |
+ "Links": null, |
|
| 118 |
+ "PublishAllPorts": false, |
|
| 119 |
+ "DriverOptions": {
|
|
| 120 |
+ "lxc": null |
|
| 121 |
+ }, |
|
| 122 |
+ "CliAddress": "" |
|
| 123 |
+ } |
|
| 124 |
+ |
|
| 125 |
+## Getting the IP address of a container instance |
|
| 126 |
+ |
|
| 127 |
+To get the IP address of a container use: |
|
| 128 |
+ |
|
| 129 |
+ # docker inspect --format='{{.NetworkSettings.IPAddress}}' 1eb5fabf5a03
|
|
| 130 |
+ 172.17.0.2 |
|
| 131 |
+ |
|
| 132 |
+## Listing all port bindings |
|
| 133 |
+ |
|
| 134 |
+One can loop over arrays and maps in the results to produce simple text |
|
| 135 |
+output: |
|
| 136 |
+ |
|
| 137 |
+ # docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} \
|
|
| 138 |
+ {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' 1eb5fabf5a03
|
|
| 139 |
+ |
|
| 140 |
+ 80/tcp -> 80 |
|
| 141 |
+ |
|
| 142 |
+## Getting information on an image |
|
| 143 |
+ |
|
| 144 |
+Use an image's ID or name (e.g. repository/name[:tag]) to get information |
|
| 145 |
+ on it. |
|
| 146 |
+ |
|
| 147 |
+ # docker inspect 58394af37342 |
|
| 148 |
+ [{
|
|
| 149 |
+ "id": "58394af373423902a1b97f209a31e3777932d9321ef10e64feaaa7b4df609cf9", |
|
| 150 |
+ "parent": "8abc22bad04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", |
|
| 151 |
+ "created": "2014-02-03T16:10:40.500814677Z", |
|
| 152 |
+ "container": "f718f19a28a5147da49313c54620306243734bafa63c76942ef6f8c4b4113bc5", |
|
| 153 |
+ "container_config": {
|
|
| 154 |
+ "Hostname": "88807319f25e", |
|
| 155 |
+ "Domainname": "", |
|
| 156 |
+ "User": "", |
|
| 157 |
+ "Memory": 0, |
|
| 158 |
+ "MemorySwap": 0, |
|
| 159 |
+ "CpuShares": 0, |
|
| 160 |
+ "AttachStdin": false, |
|
| 161 |
+ "AttachStdout": false, |
|
| 162 |
+ "AttachStderr": false, |
|
| 163 |
+ "PortSpecs": null, |
|
| 164 |
+ "ExposedPorts": null, |
|
| 165 |
+ "Tty": false, |
|
| 166 |
+ "OpenStdin": false, |
|
| 167 |
+ "StdinOnce": false, |
|
| 168 |
+ "Env": [ |
|
| 169 |
+ "HOME=/", |
|
| 170 |
+ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
|
| 171 |
+ ], |
|
| 172 |
+ "Cmd": [ |
|
| 173 |
+ "/bin/sh", |
|
| 174 |
+ "-c", |
|
| 175 |
+ "#(nop) ADD fedora-20-dummy.tar.xz in /" |
|
| 176 |
+ ], |
|
| 177 |
+ "Dns": null, |
|
| 178 |
+ "DnsSearch": null, |
|
| 179 |
+ "Image": "8abc22bad04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", |
|
| 180 |
+ "Volumes": null, |
|
| 181 |
+ "VolumesFrom": "", |
|
| 182 |
+ "WorkingDir": "", |
|
| 183 |
+ "Entrypoint": null, |
|
| 184 |
+ "NetworkDisabled": false, |
|
| 185 |
+ "OnBuild": null, |
|
| 186 |
+ "Context": null |
|
| 187 |
+ }, |
|
| 188 |
+ "docker_version": "0.6.3", |
|
| 189 |
+ "author": "I P Babble \u003clsm5@ipbabble.com\u003e - ./buildcontainers.sh", |
|
| 190 |
+ "config": {
|
|
| 191 |
+ "Hostname": "88807319f25e", |
|
| 192 |
+ "Domainname": "", |
|
| 193 |
+ "User": "", |
|
| 194 |
+ "Memory": 0, |
|
| 195 |
+ "MemorySwap": 0, |
|
| 196 |
+ "CpuShares": 0, |
|
| 197 |
+ "AttachStdin": false, |
|
| 198 |
+ "AttachStdout": false, |
|
| 199 |
+ "AttachStderr": false, |
|
| 200 |
+ "PortSpecs": null, |
|
| 201 |
+ "ExposedPorts": null, |
|
| 202 |
+ "Tty": false, |
|
| 203 |
+ "OpenStdin": false, |
|
| 204 |
+ "StdinOnce": false, |
|
| 205 |
+ "Env": [ |
|
| 206 |
+ "HOME=/", |
|
| 207 |
+ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
|
| 208 |
+ ], |
|
| 209 |
+ "Cmd": null, |
|
| 210 |
+ "Dns": null, |
|
| 211 |
+ "DnsSearch": null, |
|
| 212 |
+ "Image": "8abc22bad04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db", |
|
| 213 |
+ "Volumes": null, |
|
| 214 |
+ "VolumesFrom": "", |
|
| 215 |
+ "WorkingDir": "", |
|
| 216 |
+ "Entrypoint": null, |
|
| 217 |
+ "NetworkDisabled": false, |
|
| 218 |
+ "OnBuild": null, |
|
| 219 |
+ "Context": null |
|
| 220 |
+ }, |
|
| 221 |
+ "architecture": "x86_64", |
|
| 222 |
+ "Size": 385520098 |
|
| 223 |
+ }] |
|
| 224 |
+ |
|
| 225 |
+# HISTORY |
|
| 226 |
+ |
|
| 227 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 228 |
+based on docker.io source material and internal work. |
| 0 | 229 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,21 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-kill - Kill a running container (send SIGKILL, or specified signal) |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker kill** **--signal**[=*"KILL"*] CONTAINER [CONTAINER...] |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+ |
|
| 11 |
+The main process inside each container specified will be sent SIGKILL, |
|
| 12 |
+ or any signal specified with option --signal. |
|
| 13 |
+ |
|
| 14 |
+# OPTIONS |
|
| 15 |
+**-s**, **--signal**=*"KILL"* |
|
| 16 |
+ Signal to send to the container |
|
| 17 |
+ |
|
| 18 |
+# HISTORY |
|
| 19 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 20 |
+ based on docker.io source material and internal work. |
| 0 | 21 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,36 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-load - Load an image from a tar archive on STDIN |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker load** **--input**="" |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+ |
|
| 11 |
+Loads a tarred repository from a file or the standard input stream. |
|
| 12 |
+Restores both images and tags. |
|
| 13 |
+ |
|
| 14 |
+# OPTIONS |
|
| 15 |
+ |
|
| 16 |
+**-i**, **--input**="" |
|
| 17 |
+ Read from a tar archive file, instead of STDIN |
|
| 18 |
+ |
|
| 19 |
+# EXAMPLE |
|
| 20 |
+ |
|
| 21 |
+ $ sudo docker images |
|
| 22 |
+ REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE |
|
| 23 |
+ busybox latest 769b9341d937 7 weeks ago 2.489 MB |
|
| 24 |
+ $ sudo docker load --input fedora.tar |
|
| 25 |
+ $ sudo docker images |
|
| 26 |
+ REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE |
|
| 27 |
+ busybox latest 769b9341d937 7 weeks ago 2.489 MB |
|
| 28 |
+ fedora rawhide 0d20aec6529d 7 weeks ago 387 MB |
|
| 29 |
+ fedora 20 58394af37342 7 weeks ago 385.5 MB |
|
| 30 |
+ fedora heisenbug 58394af37342 7 weeks ago 385.5 MB |
|
| 31 |
+ fedora latest 58394af37342 7 weeks ago 385.5 MB |
|
| 32 |
+ |
|
| 33 |
+# HISTORY |
|
| 34 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 35 |
+based on docker.io source material and internal work. |
| 0 | 36 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,35 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-login - Register or Login to a docker registry server. |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker login** [**-e**|**-email**=""] [**-p**|**--password**=""] |
|
| 8 |
+ [**-u**|**--username**=""] [SERVER] |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+Register or Login to a docker registry server, if no server is |
|
| 12 |
+specified "https://index.docker.io/v1/" is the default. If you want to |
|
| 13 |
+login to a private registry you can specify this by adding the server name. |
|
| 14 |
+ |
|
| 15 |
+# OPTIONS |
|
| 16 |
+**-e**, **--email**="" |
|
| 17 |
+ Email address |
|
| 18 |
+ |
|
| 19 |
+**-p**, **--password**="" |
|
| 20 |
+ Password |
|
| 21 |
+ |
|
| 22 |
+**-u**, **--username**="" |
|
| 23 |
+ Username |
|
| 24 |
+ |
|
| 25 |
+# EXAMPLE |
|
| 26 |
+ |
|
| 27 |
+## Login to a local registry |
|
| 28 |
+ |
|
| 29 |
+ # docker login localhost:8080 |
|
| 30 |
+ |
|
| 31 |
+# HISTORY |
|
| 32 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 33 |
+based on docker.io source material and internal work. |
|
| 34 |
+ |
| 0 | 35 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,26 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-logs - Fetch the logs of a container |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker logs** **--follow**[=*false*] CONTAINER |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+The **docker logs** command batch-retrieves whatever logs are present for |
|
| 11 |
+a container at the time of execution. This does not guarantee execution |
|
| 12 |
+order when combined with a docker run (i.e. your run may not have generated |
|
| 13 |
+any logs at the time you execute docker logs). |
|
| 14 |
+ |
|
| 15 |
+The **docker logs --follow** command combines commands **docker logs** and |
|
| 16 |
+**docker attach**. It will first return all logs from the beginning and |
|
| 17 |
+then continue streaming new output from the container’s stdout and stderr. |
|
| 18 |
+ |
|
| 19 |
+# OPTIONS |
|
| 20 |
+**-f, --follow**=*true*|*false* |
|
| 21 |
+ When *true*, follow log output. The default is false. |
|
| 22 |
+ |
|
| 23 |
+# HISTORY |
|
| 24 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 25 |
+based on docker.io source material and internal work. |
| 0 | 26 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,15 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-port - Lookup the public-facing port which is NAT-ed to PRIVATE_PORT |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker port** CONTAINER PRIVATE_PORT |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+Lookup the public-facing port which is NAT-ed to PRIVATE_PORT |
|
| 11 |
+ |
|
| 12 |
+# HISTORY |
|
| 13 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 14 |
+based on docker.io source material and internal work. |
| 0 | 15 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,68 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-ps - List containers |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker ps** [**-a**|**--all**=*false*] [**--before**=""] |
|
| 8 |
+[**-l**|**--latest**=*false*] [**-n**=*-1*] [**--no-trunc**=*false*] |
|
| 9 |
+[**-q**|**--quiet**=*false*] [**-s**|**--size**=*false*] |
|
| 10 |
+[**--since**=""] |
|
| 11 |
+ |
|
| 12 |
+# DESCRIPTION |
|
| 13 |
+ |
|
| 14 |
+List the containers in the local repository. By default this show only |
|
| 15 |
+the running containers. |
|
| 16 |
+ |
|
| 17 |
+# OPTIONS |
|
| 18 |
+ |
|
| 19 |
+**-a**, **--all**=*true*|*false* |
|
| 20 |
+ When true show all containers. Only running containers are shown by |
|
| 21 |
+default. Default is false. |
|
| 22 |
+ |
|
| 23 |
+**--before**="" |
|
| 24 |
+ Show only container created before Id or Name, include non-running |
|
| 25 |
+ones. |
|
| 26 |
+ |
|
| 27 |
+**-l**, **--latest**=*true*|*false* |
|
| 28 |
+ When true show only the latest created container, include non-running |
|
| 29 |
+ones. The default is false. |
|
| 30 |
+ |
|
| 31 |
+**-n**=NUM |
|
| 32 |
+ Show NUM (integer) last created containers, include non-running ones. |
|
| 33 |
+The default is -1 (none) |
|
| 34 |
+ |
|
| 35 |
+**--no-trunc**=*true*|*false* |
|
| 36 |
+ When true truncate output. Default is false. |
|
| 37 |
+ |
|
| 38 |
+**-q**, **--quiet**=*true*|*false* |
|
| 39 |
+ When false only display numeric IDs. Default is false. |
|
| 40 |
+ |
|
| 41 |
+**-s**, **--size**=*true*|*false* |
|
| 42 |
+ When true display container sizes. Default is false. |
|
| 43 |
+ |
|
| 44 |
+**--since**="" |
|
| 45 |
+ Show only containers created since Id or Name, include non-running ones. |
|
| 46 |
+ |
|
| 47 |
+# EXAMPLE |
|
| 48 |
+# Display all containers, including non-running |
|
| 49 |
+ |
|
| 50 |
+ # docker ps -a |
|
| 51 |
+ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 52 |
+ a87ecb4f327c fedora:20 /bin/sh -c #(nop) MA 20 minutes ago Exit 0 desperate_brattain |
|
| 53 |
+ 01946d9d34d8 vpavlin/rhel7:latest /bin/sh -c #(nop) MA 33 minutes ago Exit 0 thirsty_bell |
|
| 54 |
+ c1d3b0166030 acffc0358b9e /bin/sh -c yum -y up 2 weeks ago Exit 1 determined_torvalds |
|
| 55 |
+ 41d50ecd2f57 fedora:20 /bin/sh -c #(nop) MA 2 weeks ago Exit 0 drunk_pike |
|
| 56 |
+ |
|
| 57 |
+# Display only IDs of all containers, including non-running |
|
| 58 |
+ |
|
| 59 |
+ # docker ps -a -q |
|
| 60 |
+ a87ecb4f327c |
|
| 61 |
+ 01946d9d34d8 |
|
| 62 |
+ c1d3b0166030 |
|
| 63 |
+ 41d50ecd2f57 |
|
| 64 |
+ |
|
| 65 |
+# HISTORY |
|
| 66 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 67 |
+based on docker.io source material and internal work. |
| 0 | 68 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,51 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-pull - Pull an image or a repository from the registry |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker pull** [REGISTRY_PATH/]NAME[:TAG] |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+ |
|
| 11 |
+This command pulls down an image or a repository from the registry. If |
|
| 12 |
+there is more than one image for a repository (e.g. fedora) then all |
|
| 13 |
+images for that repository name are pulled down including any tags. |
|
| 14 |
+It is also possible to specify a non-default registry to pull from. |
|
| 15 |
+ |
|
| 16 |
+# EXAMPLES |
|
| 17 |
+ |
|
| 18 |
+# Pull a repository with multiple images |
|
| 19 |
+ |
|
| 20 |
+ $ sudo docker pull fedora |
|
| 21 |
+ Pulling repository fedora |
|
| 22 |
+ ad57ef8d78d7: Download complete |
|
| 23 |
+ 105182bb5e8b: Download complete |
|
| 24 |
+ 511136ea3c5a: Download complete |
|
| 25 |
+ 73bd853d2ea5: Download complete |
|
| 26 |
+ |
|
| 27 |
+ $ sudo docker images |
|
| 28 |
+ REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE |
|
| 29 |
+ fedora rawhide ad57ef8d78d7 5 days ago 359.3 MB |
|
| 30 |
+ fedora 20 105182bb5e8b 5 days ago 372.7 MB |
|
| 31 |
+ fedora heisenbug 105182bb5e8b 5 days ago 372.7 MB |
|
| 32 |
+ fedora latest 105182bb5e8b 5 days ago 372.7 MB |
|
| 33 |
+ |
|
| 34 |
+# Pull an image, manually specifying path to the registry and tag |
|
| 35 |
+ |
|
| 36 |
+ $ sudo docker pull registry.hub.docker.com/fedora:20 |
|
| 37 |
+ Pulling repository fedora |
|
| 38 |
+ 3f2fed40e4b0: Download complete |
|
| 39 |
+ 511136ea3c5a: Download complete |
|
| 40 |
+ fd241224e9cf: Download complete |
|
| 41 |
+ |
|
| 42 |
+ $ sudo docker images |
|
| 43 |
+ REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE |
|
| 44 |
+ fedora 20 3f2fed40e4b0 4 days ago 372.7 MB |
|
| 45 |
+ |
|
| 46 |
+ |
|
| 47 |
+# HISTORY |
|
| 48 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 49 |
+based on docker.io source material and internal work. |
|
| 50 |
+ |
| 0 | 51 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,44 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-push - Push an image or a repository to the registry |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker push** NAME[:TAG] |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+Push an image or a repository to a registry. The default registry is the Docker |
|
| 11 |
+Index located at [index.docker.io](https://index.docker.io/v1/). However the |
|
| 12 |
+image can be pushed to another, perhaps private, registry as demonstrated in |
|
| 13 |
+the example below. |
|
| 14 |
+ |
|
| 15 |
+# EXAMPLE |
|
| 16 |
+ |
|
| 17 |
+# Pushing a new image to a registry |
|
| 18 |
+ |
|
| 19 |
+First save the new image by finding the container ID (using **docker ps**) |
|
| 20 |
+and then committing it to a new image name: |
|
| 21 |
+ |
|
| 22 |
+ # docker commit c16378f943fe rhel-httpd |
|
| 23 |
+ |
|
| 24 |
+Now push the image to the registry using the image ID. In this example |
|
| 25 |
+the registry is on host named registry-host and listening on port 5000. |
|
| 26 |
+Default Docker commands will push to the default `index.docker.io` |
|
| 27 |
+registry. Instead, push to the local registry, which is on a host called |
|
| 28 |
+registry-host*. To do this, tag the image with the host name or IP |
|
| 29 |
+address, and the port of the registry: |
|
| 30 |
+ |
|
| 31 |
+ # docker tag rhel-httpd registry-host:5000/myadmin/rhel-httpd |
|
| 32 |
+ # docker push registry-host:5000/myadmin/rhel-httpd |
|
| 33 |
+ |
|
| 34 |
+Check that this worked by running: |
|
| 35 |
+ |
|
| 36 |
+ # docker images |
|
| 37 |
+ |
|
| 38 |
+You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd` |
|
| 39 |
+listed. |
|
| 40 |
+ |
|
| 41 |
+# HISTORY |
|
| 42 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 43 |
+based on docker.io source material and internal work. |
| 0 | 44 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,21 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-restart - Restart a running container |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker restart** [**-t**|**--time**[=*10*]] CONTAINER [CONTAINER...] |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+Restart each container listed. |
|
| 11 |
+ |
|
| 12 |
+# OPTIONS |
|
| 13 |
+**-t**, **--time**=NUM |
|
| 14 |
+ Number of seconds to try to stop for before killing the container. Once |
|
| 15 |
+killed it will then be restarted. Default=10 |
|
| 16 |
+ |
|
| 17 |
+# HISTORY |
|
| 18 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 19 |
+based on docker.io source material and internal work. |
|
| 20 |
+ |
| 0 | 21 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,56 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+ |
|
| 4 |
+# NAME |
|
| 5 |
+ |
|
| 6 |
+docker-rm - Remove one or more containers. |
|
| 7 |
+ |
|
| 8 |
+# SYNOPSIS |
|
| 9 |
+ |
|
| 10 |
+**docker rm** [**-f**|**--force**[=*false*] [**-l**|**--link**[=*false*] [**-v**| |
|
| 11 |
+**--volumes**[=*false*] |
|
| 12 |
+CONTAINER [CONTAINER...] |
|
| 13 |
+ |
|
| 14 |
+# DESCRIPTION |
|
| 15 |
+ |
|
| 16 |
+**docker rm** will remove one or more containers from the host node. The |
|
| 17 |
+container name or ID can be used. This does not remove images. You cannot |
|
| 18 |
+remove a running container unless you use the \fB-f\fR option. To see all |
|
| 19 |
+containers on a host use the **docker ps -a** command. |
|
| 20 |
+ |
|
| 21 |
+# OPTIONS |
|
| 22 |
+ |
|
| 23 |
+**-f**, **--force**=*true*|*false* |
|
| 24 |
+ When set to true, force the removal of the container. The default is |
|
| 25 |
+*false*. |
|
| 26 |
+ |
|
| 27 |
+**-l**, **--link**=*true*|*false* |
|
| 28 |
+ When set to true, remove the specified link and not the underlying |
|
| 29 |
+container. The default is *false*. |
|
| 30 |
+ |
|
| 31 |
+**-v**, **--volumes**=*true*|*false* |
|
| 32 |
+ When set to true, remove the volumes associated to the container. The |
|
| 33 |
+default is *false*. |
|
| 34 |
+ |
|
| 35 |
+# EXAMPLES |
|
| 36 |
+ |
|
| 37 |
+##Removing a container using its ID## |
|
| 38 |
+ |
|
| 39 |
+To remove a container using its ID, find either from a **docker ps -a** |
|
| 40 |
+command, or use the ID returned from the **docker run** command, or retrieve |
|
| 41 |
+it from a file used to store it using the **docker run --cidfile**: |
|
| 42 |
+ |
|
| 43 |
+ docker rm abebf7571666 |
|
| 44 |
+ |
|
| 45 |
+##Removing a container using the container name## |
|
| 46 |
+ |
|
| 47 |
+The name of the container can be found using the **docker ps -a** |
|
| 48 |
+command. The use that name as follows: |
|
| 49 |
+ |
|
| 50 |
+ docker rm hopeful_morse |
|
| 51 |
+ |
|
| 52 |
+# HISTORY |
|
| 53 |
+ |
|
| 54 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 55 |
+based on docker.io source material and internal work. |
| 0 | 56 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,35 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-rmi \- Remove one or more images. |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+ |
|
| 8 |
+**docker rmi** [**-f**|**--force**[=*false*] IMAGE [IMAGE...] |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+ |
|
| 12 |
+This will remove one or more images from the host node. This does not |
|
| 13 |
+remove images from a registry. You cannot remove an image of a running |
|
| 14 |
+container unless you use the **-f** option. To see all images on a host |
|
| 15 |
+use the **docker images** command. |
|
| 16 |
+ |
|
| 17 |
+# OPTIONS |
|
| 18 |
+ |
|
| 19 |
+**-f**, **--force**=*true*|*false* |
|
| 20 |
+ When set to true, force the removal of the image. The default is |
|
| 21 |
+*false*. |
|
| 22 |
+ |
|
| 23 |
+# EXAMPLES |
|
| 24 |
+ |
|
| 25 |
+## Removing an image |
|
| 26 |
+ |
|
| 27 |
+Here is an example of removing and image: |
|
| 28 |
+ |
|
| 29 |
+ docker rmi fedora/httpd |
|
| 30 |
+ |
|
| 31 |
+# HISTORY |
|
| 32 |
+ |
|
| 33 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 34 |
+based on docker.io source material and internal work. |
| 0 | 35 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,356 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-run - Run a process in an isolated container |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker run** |
|
| 8 |
+[**-a**|**--attach**[=]] [**-c**|**--cpu-shares**[=0] |
|
| 9 |
+[**-m**|**--memory**=*memory-limit*] |
|
| 10 |
+[**--cidfile**=*file*] [**-d**|**--detach**[=*false*]] [**--dns**=*IP-address*] |
|
| 11 |
+[**--name**=*name*] [**-u**|**--user**=*username*|*uid*] |
|
| 12 |
+[**--link**=*name*:*alias*] |
|
| 13 |
+[**-e**|**--env**=*environment*] [**--entrypoint**=*command*] |
|
| 14 |
+[**--expose**=*port*] [**-P**|**--publish-all**[=*false*]] |
|
| 15 |
+[**-p**|**--publish**=*port-mappping*] [**-h**|**--hostname**=*hostname*] |
|
| 16 |
+[**--rm**[=*false*]] [**--privileged**[=*false*]] |
|
| 17 |
+[**-i**|**--interactive**[=*false*]] |
|
| 18 |
+[**-t**|**--tty**[=*false*]] [**--lxc-conf**=*options*] |
|
| 19 |
+[**-n**|**--networking**[=*true*]] |
|
| 20 |
+[**-v**|**--volume**=*volume*] [**--volumes-from**=*container-id*] |
|
| 21 |
+[**-w**|**--workdir**=*directory*] [**--sig-proxy**[=*true*]] |
|
| 22 |
+IMAGE [COMMAND] [ARG...] |
|
| 23 |
+ |
|
| 24 |
+# DESCRIPTION |
|
| 25 |
+ |
|
| 26 |
+Run a process in a new container. **docker run** starts a process with its own |
|
| 27 |
+file system, its own networking, and its own isolated process tree. The IMAGE |
|
| 28 |
+which starts the process may define defaults related to the process that will be |
|
| 29 |
+run in the container, the networking to expose, and more, but **docker run** |
|
| 30 |
+gives final control to the operator or administrator who starts the container |
|
| 31 |
+from the image. For that reason **docker run** has more options than any other |
|
| 32 |
+Docker command. |
|
| 33 |
+ |
|
| 34 |
+If the IMAGE is not already loaded then **docker run** will pull the IMAGE, and |
|
| 35 |
+all image dependencies, from the repository in the same way running **docker |
|
| 36 |
+pull** IMAGE, before it starts the container from that image. |
|
| 37 |
+ |
|
| 38 |
+# OPTIONS |
|
| 39 |
+ |
|
| 40 |
+**-a**, **--attach**=*stdin*|*stdout*|*stderr* |
|
| 41 |
+ Attach to stdin, stdout or stderr. In foreground mode (the default when |
|
| 42 |
+**-d** is not specified), **docker run** can start the process in the container |
|
| 43 |
+and attach the console to the process’s standard input, output, and standard |
|
| 44 |
+error. It can even pretend to be a TTY (this is what most commandline |
|
| 45 |
+executables expect) and pass along signals. The **-a** option can be set for |
|
| 46 |
+each of stdin, stdout, and stderr. |
|
| 47 |
+ |
|
| 48 |
+**-c**, **--cpu-shares**=0 |
|
| 49 |
+ CPU shares in relative weight. You can increase the priority of a container |
|
| 50 |
+with the -c option. By default, all containers run at the same priority and get |
|
| 51 |
+the same proportion of CPU cycles, but you can tell the kernel to give more |
|
| 52 |
+shares of CPU time to one or more containers when you start them via **docker |
|
| 53 |
+run**. |
|
| 54 |
+ |
|
| 55 |
+**--cidfile**=*file* |
|
| 56 |
+ Write the container ID to the file specified. |
|
| 57 |
+ |
|
| 58 |
+ |
|
| 59 |
+**-d**, **-detach**=*true*|*false* |
|
| 60 |
+ Detached mode. This runs the container in the background. It outputs the new |
|
| 61 |
+container's ID and any error messages. At any time you can run **docker ps** in |
|
| 62 |
+the other shell to view a list of the running containers. You can reattach to a |
|
| 63 |
+detached container with **docker attach**. If you choose to run a container in |
|
| 64 |
+the detached mode, then you cannot use the **-rm** option. |
|
| 65 |
+ |
|
| 66 |
+ When attached in the tty mode, you can detach from a running container without |
|
| 67 |
+stopping the process by pressing the keys CTRL-P CTRL-Q. |
|
| 68 |
+ |
|
| 69 |
+ |
|
| 70 |
+**--dns**=*IP-address* |
|
| 71 |
+ Set custom DNS servers. This option can be used to override the DNS |
|
| 72 |
+configuration passed to the container. Typically this is necessary when the |
|
| 73 |
+host DNS configuration is invalid for the container (eg. 127.0.0.1). When this |
|
| 74 |
+is the case the **-dns** flags is necessary for every run. |
|
| 75 |
+ |
|
| 76 |
+ |
|
| 77 |
+**-e**, **-env**=*environment* |
|
| 78 |
+ Set environment variables. This option allows you to specify arbitrary |
|
| 79 |
+environment variables that are available for the process that will be launched |
|
| 80 |
+inside of the container. |
|
| 81 |
+ |
|
| 82 |
+ |
|
| 83 |
+**--entrypoint**=*command* |
|
| 84 |
+ This option allows you to overwrite the default entrypoint of the image that |
|
| 85 |
+is set in the Dockerfile. The ENTRYPOINT of an image is similar to a COMMAND |
|
| 86 |
+because it specifies what executable to run when the container starts, but it is |
|
| 87 |
+(purposely) more difficult to override. The ENTRYPOINT gives a container its |
|
| 88 |
+default nature or behavior, so that when you set an ENTRYPOINT you can run the |
|
| 89 |
+container as if it were that binary, complete with default options, and you can |
|
| 90 |
+pass in more options via the COMMAND. But, sometimes an operator may want to run |
|
| 91 |
+something else inside the container, so you can override the default ENTRYPOINT |
|
| 92 |
+at runtime by using a **--entrypoint** and a string to specify the new |
|
| 93 |
+ENTRYPOINT. |
|
| 94 |
+ |
|
| 95 |
+**--expose**=*port* |
|
| 96 |
+ Expose a port from the container without publishing it to your host. A |
|
| 97 |
+containers port can be exposed to other containers in three ways: 1) The |
|
| 98 |
+developer can expose the port using the EXPOSE parameter of the Dockerfile, 2) |
|
| 99 |
+the operator can use the **--expose** option with **docker run**, or 3) the |
|
| 100 |
+container can be started with the **--link**. |
|
| 101 |
+ |
|
| 102 |
+**-m**, **-memory**=*memory-limit* |
|
| 103 |
+ Allows you to constrain the memory available to a container. If the host |
|
| 104 |
+supports swap memory, then the -m memory setting can be larger than physical |
|
| 105 |
+RAM. If a limit of 0 is specified, the container's memory is not limited. The |
|
| 106 |
+memory limit format: <number><optional unit>, where unit = b, k, m or g. |
|
| 107 |
+ |
|
| 108 |
+**-P**, **-publish-all**=*true*|*false* |
|
| 109 |
+ When set to true publish all exposed ports to the host interfaces. The |
|
| 110 |
+default is false. If the operator uses -P (or -p) then Docker will make the |
|
| 111 |
+exposed port accessible on the host and the ports will be available to any |
|
| 112 |
+client that can reach the host. To find the map between the host ports and the |
|
| 113 |
+exposed ports, use **docker port**. |
|
| 114 |
+ |
|
| 115 |
+ |
|
| 116 |
+**-p**, **-publish**=[] |
|
| 117 |
+ Publish a container's port to the host (format: ip:hostPort:containerPort | |
|
| 118 |
+ip::containerPort | hostPort:containerPort) (use **docker port** to see the |
|
| 119 |
+actual mapping) |
|
| 120 |
+ |
|
| 121 |
+ |
|
| 122 |
+**-h**, **-hostname**=*hostname* |
|
| 123 |
+ Sets the container host name that is available inside the container. |
|
| 124 |
+ |
|
| 125 |
+ |
|
| 126 |
+**-i**, **-interactive**=*true*|*false* |
|
| 127 |
+ When set to true, keep stdin open even if not attached. The default is false. |
|
| 128 |
+ |
|
| 129 |
+ |
|
| 130 |
+**--link**=*name*:*alias* |
|
| 131 |
+ Add link to another container. The format is name:alias. If the operator |
|
| 132 |
+uses **--link** when starting the new client container, then the client |
|
| 133 |
+container can access the exposed port via a private networking interface. Docker |
|
| 134 |
+will set some environment variables in the client container to help indicate |
|
| 135 |
+which interface and port to use. |
|
| 136 |
+ |
|
| 137 |
+ |
|
| 138 |
+**-n**, **-networking**=*true*|*false* |
|
| 139 |
+ By default, all containers have networking enabled (true) and can make |
|
| 140 |
+outgoing connections. The operator can disable networking with **--networking** |
|
| 141 |
+to false. This disables all incoming and outgoing networking. In cases like this |
|
| 142 |
+, I/O can only be performed through files or by using STDIN/STDOUT. |
|
| 143 |
+ |
|
| 144 |
+Also by default, the container will use the same DNS servers as the host. The |
|
| 145 |
+operator may override this with **-dns**. |
|
| 146 |
+ |
|
| 147 |
+ |
|
| 148 |
+**--name**=*name* |
|
| 149 |
+ Assign a name to the container. The operator can identify a container in |
|
| 150 |
+three ways: |
|
| 151 |
+ |
|
| 152 |
+ UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”) |
|
| 153 |
+ UUID short identifier (“f78375b1c487”) |
|
| 154 |
+ Name (“jonah”) |
|
| 155 |
+ |
|
| 156 |
+The UUID identifiers come from the Docker daemon, and if a name is not assigned |
|
| 157 |
+to the container with **--name** then the daemon will also generate a random |
|
| 158 |
+string name. The name is useful when defining links (see **--link**) (or any |
|
| 159 |
+other place you need to identify a container). This works for both background |
|
| 160 |
+and foreground Docker containers. |
|
| 161 |
+ |
|
| 162 |
+ |
|
| 163 |
+**--privileged**=*true*|*false* |
|
| 164 |
+ Give extended privileges to this container. By default, Docker containers are |
|
| 165 |
+“unprivileged” (=false) and cannot, for example, run a Docker daemon inside the |
|
| 166 |
+Docker container. This is because by default a container is not allowed to |
|
| 167 |
+access any devices. A “privileged” container is given access to all devices. |
|
| 168 |
+ |
|
| 169 |
+When the operator executes **docker run --privileged**, Docker will enable access |
|
| 170 |
+to all devices on the host as well as set some configuration in AppArmor to |
|
| 171 |
+allow the container nearly all the same access to the host as processes running |
|
| 172 |
+outside of a container on the host. |
|
| 173 |
+ |
|
| 174 |
+ |
|
| 175 |
+**--rm**=*true*|*false* |
|
| 176 |
+ If set to *true* the container is automatically removed when it exits. The |
|
| 177 |
+default is *false*. This option is incompatible with **-d**. |
|
| 178 |
+ |
|
| 179 |
+ |
|
| 180 |
+**--sig-proxy**=*true*|*false* |
|
| 181 |
+ When set to true, proxify all received signals to the process (even in |
|
| 182 |
+non-tty mode). The default is true. |
|
| 183 |
+ |
|
| 184 |
+ |
|
| 185 |
+**-t**, **-tty**=*true*|*false* |
|
| 186 |
+ When set to true Docker can allocate a pseudo-tty and attach to the standard |
|
| 187 |
+input of any container. This can be used, for example, to run a throwaway |
|
| 188 |
+interactive shell. The default is value is false. |
|
| 189 |
+ |
|
| 190 |
+ |
|
| 191 |
+**-u**, **-user**=*username*,*uid* |
|
| 192 |
+ Set a username or UID for the container. |
|
| 193 |
+ |
|
| 194 |
+ |
|
| 195 |
+**-v**, **-volume**=*volume*[:ro|:rw] |
|
| 196 |
+ Bind mount a volume to the container. |
|
| 197 |
+ |
|
| 198 |
+The **-v** option can be used one or |
|
| 199 |
+more times to add one or more mounts to a container. These mounts can then be |
|
| 200 |
+used in other containers using the **--volumes-from** option. |
|
| 201 |
+ |
|
| 202 |
+The volume may be optionally suffixed with :ro or :rw to mount the volumes in |
|
| 203 |
+read-only or read-write mode, respectively. By default, the volumes are mounted |
|
| 204 |
+read-write. See examples. |
|
| 205 |
+ |
|
| 206 |
+**--volumes-from**=*container-id*[:ro|:rw] |
|
| 207 |
+ Will mount volumes from the specified container identified by container-id. |
|
| 208 |
+Once a volume is mounted in a one container it can be shared with other |
|
| 209 |
+containers using the **--volumes-from** option when running those other |
|
| 210 |
+containers. The volumes can be shared even if the original container with the |
|
| 211 |
+mount is not running. |
|
| 212 |
+ |
|
| 213 |
+The container ID may be optionally suffixed with :ro or |
|
| 214 |
+:rw to mount the volumes in read-only or read-write mode, respectively. By |
|
| 215 |
+default, the volumes are mounted in the same mode (read write or read only) as |
|
| 216 |
+the reference container. |
|
| 217 |
+ |
|
| 218 |
+ |
|
| 219 |
+**-w**, **-workdir**=*directory* |
|
| 220 |
+ Working directory inside the container. The default working directory for |
|
| 221 |
+running binaries within a container is the root directory (/). The developer can |
|
| 222 |
+set a different default with the Dockerfile WORKDIR instruction. The operator |
|
| 223 |
+can override the working directory by using the **-w** option. |
|
| 224 |
+ |
|
| 225 |
+ |
|
| 226 |
+**IMAGE** |
|
| 227 |
+ The image name or ID. |
|
| 228 |
+ |
|
| 229 |
+ |
|
| 230 |
+**COMMAND** |
|
| 231 |
+ The command or program to run inside the image. |
|
| 232 |
+ |
|
| 233 |
+ |
|
| 234 |
+**ARG** |
|
| 235 |
+ The arguments for the command to be run in the container. |
|
| 236 |
+ |
|
| 237 |
+# EXAMPLES |
|
| 238 |
+ |
|
| 239 |
+## Exposing log messages from the container to the host's log |
|
| 240 |
+ |
|
| 241 |
+If you want messages that are logged in your container to show up in the host's |
|
| 242 |
+syslog/journal then you should bind mount the /dev/log directory as follows. |
|
| 243 |
+ |
|
| 244 |
+ # docker run -v /dev/log:/dev/log -i -t fedora /bin/bash |
|
| 245 |
+ |
|
| 246 |
+From inside the container you can test this by sending a message to the log. |
|
| 247 |
+ |
|
| 248 |
+ (bash)# logger "Hello from my container" |
|
| 249 |
+ |
|
| 250 |
+Then exit and check the journal. |
|
| 251 |
+ |
|
| 252 |
+ # exit |
|
| 253 |
+ |
|
| 254 |
+ # journalctl -b | grep Hello |
|
| 255 |
+ |
|
| 256 |
+This should list the message sent to logger. |
|
| 257 |
+ |
|
| 258 |
+## Attaching to one or more from STDIN, STDOUT, STDERR |
|
| 259 |
+ |
|
| 260 |
+If you do not specify -a then Docker will attach everything (stdin,stdout,stderr) |
|
| 261 |
+. You can specify to which of the three standard streams (stdin, stdout, stderr) |
|
| 262 |
+you’d like to connect instead, as in: |
|
| 263 |
+ |
|
| 264 |
+ # docker run -a stdin -a stdout -i -t fedora /bin/bash |
|
| 265 |
+ |
|
| 266 |
+## Linking Containers |
|
| 267 |
+ |
|
| 268 |
+The link feature allows multiple containers to communicate with each other. For |
|
| 269 |
+example, a container whose Dockerfile has exposed port 80 can be run and named |
|
| 270 |
+as follows: |
|
| 271 |
+ |
|
| 272 |
+ # docker run --name=link-test -d -i -t fedora/httpd |
|
| 273 |
+ |
|
| 274 |
+A second container, in this case called linker, can communicate with the httpd |
|
| 275 |
+container, named link-test, by running with the **--link=<name>:<alias>** |
|
| 276 |
+ |
|
| 277 |
+ # docker run -t -i --link=link-test:lt --name=linker fedora /bin/bash |
|
| 278 |
+ |
|
| 279 |
+Now the container linker is linked to container link-test with the alias lt. |
|
| 280 |
+Running the **env** command in the linker container shows environment variables |
|
| 281 |
+ with the LT (alias) context (**LT_**) |
|
| 282 |
+ |
|
| 283 |
+ # env |
|
| 284 |
+ HOSTNAME=668231cb0978 |
|
| 285 |
+ TERM=xterm |
|
| 286 |
+ LT_PORT_80_TCP=tcp://172.17.0.3:80 |
|
| 287 |
+ LT_PORT_80_TCP_PORT=80 |
|
| 288 |
+ LT_PORT_80_TCP_PROTO=tcp |
|
| 289 |
+ LT_PORT=tcp://172.17.0.3:80 |
|
| 290 |
+ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
|
| 291 |
+ PWD=/ |
|
| 292 |
+ LT_NAME=/linker/lt |
|
| 293 |
+ SHLVL=1 |
|
| 294 |
+ HOME=/ |
|
| 295 |
+ LT_PORT_80_TCP_ADDR=172.17.0.3 |
|
| 296 |
+ _=/usr/bin/env |
|
| 297 |
+ |
|
| 298 |
+When linking two containers Docker will use the exposed ports of the container |
|
| 299 |
+to create a secure tunnel for the parent to access. |
|
| 300 |
+ |
|
| 301 |
+ |
|
| 302 |
+## Mapping Ports for External Usage |
|
| 303 |
+ |
|
| 304 |
+The exposed port of an application can be mapped to a host port using the **-p** |
|
| 305 |
+flag. For example a httpd port 80 can be mapped to the host port 8080 using the |
|
| 306 |
+following: |
|
| 307 |
+ |
|
| 308 |
+ # docker run -p 8080:80 -d -i -t fedora/httpd |
|
| 309 |
+ |
|
| 310 |
+## Creating and Mounting a Data Volume Container |
|
| 311 |
+ |
|
| 312 |
+Many applications require the sharing of persistent data across several |
|
| 313 |
+containers. Docker allows you to create a Data Volume Container that other |
|
| 314 |
+containers can mount from. For example, create a named container that contains |
|
| 315 |
+directories /var/volume1 and /tmp/volume2. The image will need to contain these |
|
| 316 |
+directories so a couple of RUN mkdir instructions might be required for you |
|
| 317 |
+fedora-data image: |
|
| 318 |
+ |
|
| 319 |
+ # docker run --name=data -v /var/volume1 -v /tmp/volume2 -i -t fedora-data true |
|
| 320 |
+ # docker run --volumes-from=data --name=fedora-container1 -i -t fedora bash |
|
| 321 |
+ |
|
| 322 |
+Multiple --volumes-from parameters will bring together multiple data volumes from |
|
| 323 |
+multiple containers. And it's possible to mount the volumes that came from the |
|
| 324 |
+DATA container in yet another container via the fedora-container1 intermidiery |
|
| 325 |
+container, allowing to abstract the actual data source from users of that data: |
|
| 326 |
+ |
|
| 327 |
+ # docker run --volumes-from=fedora-container1 --name=fedora-container2 -i -t fedora bash |
|
| 328 |
+ |
|
| 329 |
+## Mounting External Volumes |
|
| 330 |
+ |
|
| 331 |
+To mount a host directory as a container volume, specify the absolute path to |
|
| 332 |
+the directory and the absolute path for the container directory separated by a |
|
| 333 |
+colon: |
|
| 334 |
+ |
|
| 335 |
+ # docker run -v /var/db:/data1 -i -t fedora bash |
|
| 336 |
+ |
|
| 337 |
+When using SELinux, be aware that the host has no knowledge of container SELinux |
|
| 338 |
+policy. Therefore, in the above example, if SELinux policy is enforced, the |
|
| 339 |
+`/var/db` directory is not writable to the container. A "Permission Denied" |
|
| 340 |
+message will occur and an avc: message in the host's syslog. |
|
| 341 |
+ |
|
| 342 |
+ |
|
| 343 |
+To work around this, at time of writing this man page, the following command |
|
| 344 |
+needs to be run in order for the proper SELinux policy type label to be attached |
|
| 345 |
+to the host directory: |
|
| 346 |
+ |
|
| 347 |
+ # chcon -Rt svirt_sandbox_file_t /var/db |
|
| 348 |
+ |
|
| 349 |
+ |
|
| 350 |
+Now, writing to the /data1 volume in the container will be allowed and the |
|
| 351 |
+changes will also be reflected on the host in /var/db. |
|
| 352 |
+ |
|
| 353 |
+# HISTORY |
|
| 354 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 355 |
+based on docker.io source material and internal work. |
| 0 | 356 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,35 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-save - Save an image to a tar archive (streamed to STDOUT by default) |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker save** [**-o**|**--output**=""] IMAGE |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+Produces a tarred repository to the standard output stream. Contains all |
|
| 11 |
+parent layers, and all tags + versions, or specified repo:tag. |
|
| 12 |
+ |
|
| 13 |
+Stream to a file instead of STDOUT by using **-o**. |
|
| 14 |
+ |
|
| 15 |
+# OPTIONS |
|
| 16 |
+**-o**, **--output**="" |
|
| 17 |
+ Write to an file, instead of STDOUT |
|
| 18 |
+ |
|
| 19 |
+# EXAMPLE |
|
| 20 |
+ |
|
| 21 |
+Save all fedora repository images to a fedora-all.tar and save the latest |
|
| 22 |
+fedora image to a fedora-latest.tar: |
|
| 23 |
+ |
|
| 24 |
+ $ sudo docker save fedora > fedora-all.tar |
|
| 25 |
+ $ sudo docker save --output=fedora-latest.tar fedora:latest |
|
| 26 |
+ $ ls -sh fedora-all.tar |
|
| 27 |
+ 721M fedora-all.tar |
|
| 28 |
+ $ ls -sh fedora-latest.tar |
|
| 29 |
+ 367M fedora-latest.tar |
|
| 30 |
+ |
|
| 31 |
+# HISTORY |
|
| 32 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 33 |
+based on docker.io source material and internal work. |
|
| 34 |
+ |
| 0 | 35 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,55 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-search - Search the docker index for images |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker search** **--no-trunc**[=*false*] **--automated**[=*false*] |
|
| 8 |
+ **-s**|**--stars**[=*0*] TERM |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+ |
|
| 12 |
+Search an index for an image with that matches the term TERM. The table |
|
| 13 |
+of images returned displays the name, description (truncated by default), |
|
| 14 |
+number of stars awarded, whether the image is official, and whether it |
|
| 15 |
+is automated. |
|
| 16 |
+ |
|
| 17 |
+# OPTIONS |
|
| 18 |
+**--no-trunc**=*true*|*false* |
|
| 19 |
+ When true display the complete description. The default is false. |
|
| 20 |
+ |
|
| 21 |
+**-s**, **--stars**=NUM |
|
| 22 |
+ Only displays with at least NUM (integer) stars. I.e. only those images |
|
| 23 |
+ranked >=NUM. |
|
| 24 |
+ |
|
| 25 |
+**--automated**=*true*|*false* |
|
| 26 |
+ When true only show automated builds. The default is false. |
|
| 27 |
+ |
|
| 28 |
+# EXAMPLE |
|
| 29 |
+ |
|
| 30 |
+## Search the registry for ranked images |
|
| 31 |
+ |
|
| 32 |
+Search the registry for the term 'fedora' and only display those images |
|
| 33 |
+ranked 3 or higher: |
|
| 34 |
+ |
|
| 35 |
+ $ sudo docker search -s 3 fedora |
|
| 36 |
+ NAME DESCRIPTION STARS OFFICIAL AUTOMATED |
|
| 37 |
+ mattdm/fedora A basic Fedora image corresponding roughly... 50 |
|
| 38 |
+ fedora (Semi) Official Fedora base image. 38 |
|
| 39 |
+ mattdm/fedora-small A small Fedora image on which to build. Co... 8 |
|
| 40 |
+ goldmann/wildfly A WildFly application server running on a ... 3 [OK] |
|
| 41 |
+ |
|
| 42 |
+## Search the registry for automated images |
|
| 43 |
+ |
|
| 44 |
+Search the registry for the term 'fedora' and only display automated images |
|
| 45 |
+ranked 1 or higher: |
|
| 46 |
+ |
|
| 47 |
+ $ sudo docker search -s 1 -t fedora |
|
| 48 |
+ NAME DESCRIPTION STARS OFFICIAL AUTOMATED |
|
| 49 |
+ goldmann/wildfly A WildFly application server running on a ... 3 [OK] |
|
| 50 |
+ tutum/fedora-20 Fedora 20 image with SSH access. For the r... 1 [OK] |
|
| 51 |
+ |
|
| 52 |
+# HISTORY |
|
| 53 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 54 |
+based on docker.io source material and internal work. |
| 0 | 55 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,29 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-start - Restart a stopped container |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker start** [**a**|**--attach**[=*false*]] [**-i**|**--interactive** |
|
| 8 |
+[=*true*] CONTAINER [CONTAINER...] |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+ |
|
| 12 |
+Start a stopped container. |
|
| 13 |
+ |
|
| 14 |
+# OPTION |
|
| 15 |
+**-a**, **--attach**=*true*|*false* |
|
| 16 |
+ When true attach to container's stdout/stderr and forward all signals to |
|
| 17 |
+the process |
|
| 18 |
+ |
|
| 19 |
+**-i**, **--interactive**=*true*|*false* |
|
| 20 |
+ When true attach to container's stdin |
|
| 21 |
+ |
|
| 22 |
+# NOTES |
|
| 23 |
+If run on a started container, start takes no action and succeeds |
|
| 24 |
+unconditionally. |
|
| 25 |
+ |
|
| 26 |
+# HISTORY |
|
| 27 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 28 |
+based on docker.io source material and internal work. |
| 0 | 29 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,22 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-stop - Stop a running container |
|
| 5 |
+ grace period) |
|
| 6 |
+ |
|
| 7 |
+# SYNOPSIS |
|
| 8 |
+**docker stop** [**-t**|**--time**[=*10*]] CONTAINER [CONTAINER...] |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+Stop a running container (Send SIGTERM, and then SIGKILL after |
|
| 12 |
+ grace period) |
|
| 13 |
+ |
|
| 14 |
+# OPTIONS |
|
| 15 |
+**-t**, **--time**=NUM |
|
| 16 |
+ Wait NUM number of seconds for the container to stop before killing it. |
|
| 17 |
+The default is 10 seconds. |
|
| 18 |
+ |
|
| 19 |
+# HISTORY |
|
| 20 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 21 |
+based on docker.io source material and internal work. |
| 0 | 22 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,52 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-tag - Tag an image in the repository |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker tag** [**-f**|**--force**[=*false*] |
|
| 8 |
+IMAGE [REGISTRYHOST/][USERNAME/]NAME[:TAG] |
|
| 9 |
+ |
|
| 10 |
+# DESCRIPTION |
|
| 11 |
+This will give a new alias to an image in the repository. This refers to the |
|
| 12 |
+entire image name including the optional TAG after the ':'. |
|
| 13 |
+ |
|
| 14 |
+# "OPTIONS" |
|
| 15 |
+**-f**, **--force**=*true*|*false* |
|
| 16 |
+ When set to true, force the alias. The default is *false*. |
|
| 17 |
+ |
|
| 18 |
+**REGISTRYHOST** |
|
| 19 |
+ The hostname of the registry if required. This may also include the port |
|
| 20 |
+separated by a ':' |
|
| 21 |
+ |
|
| 22 |
+**USERNAME** |
|
| 23 |
+ The username or other qualifying identifier for the image. |
|
| 24 |
+ |
|
| 25 |
+**NAME** |
|
| 26 |
+ The image name. |
|
| 27 |
+ |
|
| 28 |
+**TAG** |
|
| 29 |
+ The tag you are assigning to the image. Though this is arbitrary it is |
|
| 30 |
+recommended to be used for a version to disinguish images with the same name. |
|
| 31 |
+Note that here TAG is a part of the overall name or "tag". |
|
| 32 |
+ |
|
| 33 |
+# EXAMPLES |
|
| 34 |
+ |
|
| 35 |
+## Giving an image a new alias |
|
| 36 |
+ |
|
| 37 |
+Here is an example of aliasing an image (e.g. 0e5574283393) as "httpd" and |
|
| 38 |
+tagging it into the "fedora" repository with "version1.0": |
|
| 39 |
+ |
|
| 40 |
+ docker tag 0e5574283393 fedora/httpd:version1.0 |
|
| 41 |
+ |
|
| 42 |
+## Tagging an image for a private repository |
|
| 43 |
+ |
|
| 44 |
+To push an image to an private registry and not the central Docker |
|
| 45 |
+registry you must tag it with the registry hostname and port (if needed). |
|
| 46 |
+ |
|
| 47 |
+ docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0 |
|
| 48 |
+ |
|
| 49 |
+# HISTORY |
|
| 50 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 51 |
+based on docker.io source material and internal work. |
| 0 | 52 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,27 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-top - Lookup the running processes of a container |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker top** CONTAINER [ps-OPTION] |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+ |
|
| 11 |
+Look up the running process of the container. ps-OPTION can be any of the |
|
| 12 |
+ options you would pass to a Linux ps command. |
|
| 13 |
+ |
|
| 14 |
+# EXAMPLE |
|
| 15 |
+ |
|
| 16 |
+Run **docker top** with the ps option of -x: |
|
| 17 |
+ |
|
| 18 |
+ $ sudo docker top 8601afda2b -x |
|
| 19 |
+ PID TTY STAT TIME COMMAND |
|
| 20 |
+ 16623 ? Ss 0:00 sleep 99999 |
|
| 21 |
+ |
|
| 22 |
+ |
|
| 23 |
+# HISTORY |
|
| 24 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 25 |
+based on docker.io source material and internal work. |
|
| 26 |
+ |
| 0 | 27 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,23 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker-wait - Block until a container stops, then print its exit code. |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker wait** CONTAINER [CONTAINER...] |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+Block until a container stops, then print its exit code. |
|
| 11 |
+ |
|
| 12 |
+#EXAMPLE |
|
| 13 |
+ |
|
| 14 |
+ $ sudo docker run -d fedora sleep 99 |
|
| 15 |
+ 079b83f558a2bc52ecad6b2a5de13622d584e6bb1aea058c11b36511e85e7622 |
|
| 16 |
+ $ sudo docker wait 079b83f558a2bc |
|
| 17 |
+ 0 |
|
| 18 |
+ |
|
| 19 |
+# HISTORY |
|
| 20 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
| 21 |
+based on docker.io source material and internal work. |
|
| 22 |
+ |
| 0 | 23 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,187 @@ |
| 0 |
+% DOCKER(1) Docker User Manuals |
|
| 1 |
+% William Henry |
|
| 2 |
+% APRIL 2014 |
|
| 3 |
+# NAME |
|
| 4 |
+docker \- Docker image and container command line interface |
|
| 5 |
+ |
|
| 6 |
+# SYNOPSIS |
|
| 7 |
+**docker** [OPTIONS] COMMAND [arg...] |
|
| 8 |
+ |
|
| 9 |
+# DESCRIPTION |
|
| 10 |
+**docker** has two distinct functions. It is used for starting the Docker |
|
| 11 |
+daemon and to run the CLI (i.e., to command the daemon to manage images, |
|
| 12 |
+containers etc.) So **docker** is both a server, as a daemon, and a client |
|
| 13 |
+to the daemon, through the CLI. |
|
| 14 |
+ |
|
| 15 |
+To run the Docker daemon you do not specify any of the commands listed below but |
|
| 16 |
+must specify the **-d** option. The other options listed below are for the |
|
| 17 |
+daemon only. |
|
| 18 |
+ |
|
| 19 |
+The Docker CLI has over 30 commands. The commands are listed below and each has |
|
| 20 |
+its own man page which explain usage and arguments. |
|
| 21 |
+ |
|
| 22 |
+To see the man page for a command run **man docker <command>**. |
|
| 23 |
+ |
|
| 24 |
+# OPTIONS |
|
| 25 |
+**-D**=*true*|*false* |
|
| 26 |
+ Enable debug mode. Default is false. |
|
| 27 |
+ |
|
| 28 |
+**-H**, **--host**=[unix:///var/run/docker.sock]: tcp://[host:port] to bind or |
|
| 29 |
+unix://[/path/to/socket] to use. |
|
| 30 |
+ The socket(s) to bind to in daemon mode specified using one or more |
|
| 31 |
+ tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd. |
|
| 32 |
+ |
|
| 33 |
+**--api-enable-cors**=*true*|*false* |
|
| 34 |
+ Enable CORS headers in the remote API. Default is false. |
|
| 35 |
+ |
|
| 36 |
+**-b**="" |
|
| 37 |
+ Attach containers to a pre\-existing network bridge; use 'none' to disable container networking |
|
| 38 |
+ |
|
| 39 |
+**--bip**="" |
|
| 40 |
+ Use the provided CIDR notation address for the dynamically created bridge (docker0); Mutually exclusive of \-b |
|
| 41 |
+ |
|
| 42 |
+**-d**=*true*|*false* |
|
| 43 |
+ Enable daemon mode. Default is false. |
|
| 44 |
+ |
|
| 45 |
+**--dns**="" |
|
| 46 |
+ Force Docker to use specific DNS servers |
|
| 47 |
+ |
|
| 48 |
+**-g**="" |
|
| 49 |
+ Path to use as the root of the Docker runtime. Default is `/var/lib/docker`. |
|
| 50 |
+ |
|
| 51 |
+**--icc**=*true*|*false* |
|
| 52 |
+ Enable inter\-container communication. Default is true. |
|
| 53 |
+ |
|
| 54 |
+**--ip**="" |
|
| 55 |
+ Default IP address to use when binding container ports. Default is `0.0.0.0`. |
|
| 56 |
+ |
|
| 57 |
+**--iptables**=*true*|*false* |
|
| 58 |
+ Disable Docker's addition of iptables rules. Default is true. |
|
| 59 |
+ |
|
| 60 |
+**--mtu**=VALUE |
|
| 61 |
+ Set the containers network mtu. Default is `1500`. |
|
| 62 |
+ |
|
| 63 |
+**-p**="" |
|
| 64 |
+ Path to use for daemon PID file. Default is `/var/run/docker.pid` |
|
| 65 |
+ |
|
| 66 |
+**-r**=*true*|*false* |
|
| 67 |
+ Restart previously running containers. Default is true. |
|
| 68 |
+ |
|
| 69 |
+**-s**="" |
|
| 70 |
+ Force the Docker runtime to use a specific storage driver. |
|
| 71 |
+ |
|
| 72 |
+**-v**=*true*|*false* |
|
| 73 |
+ Print version information and quit. Default is false. |
|
| 74 |
+ |
|
| 75 |
+**--selinux-enabled**=*true*|*false* |
|
| 76 |
+ Enable selinux support. Default is false. |
|
| 77 |
+ |
|
| 78 |
+# COMMANDS |
|
| 79 |
+**docker-attach(1)** |
|
| 80 |
+ Attach to a running container |
|
| 81 |
+ |
|
| 82 |
+**docker-build(1)** |
|
| 83 |
+ Build an image from a Dockerfile |
|
| 84 |
+ |
|
| 85 |
+**docker-commit(1)** |
|
| 86 |
+ Create a new image from a container's changes |
|
| 87 |
+ |
|
| 88 |
+**docker-cp(1)** |
|
| 89 |
+ Copy files/folders from the containers filesystem to the host at path |
|
| 90 |
+ |
|
| 91 |
+**docker-diff(1)** |
|
| 92 |
+ Inspect changes on a container's filesystem |
|
| 93 |
+ |
|
| 94 |
+ |
|
| 95 |
+**docker-events(1)** |
|
| 96 |
+ Get real time events from the server |
|
| 97 |
+ |
|
| 98 |
+**docker-export(1)** |
|
| 99 |
+ Stream the contents of a container as a tar archive |
|
| 100 |
+ |
|
| 101 |
+**docker-history(1)** |
|
| 102 |
+ Show the history of an image |
|
| 103 |
+ |
|
| 104 |
+**docker-images(1)** |
|
| 105 |
+ List images |
|
| 106 |
+ |
|
| 107 |
+**docker-import(1)** |
|
| 108 |
+ Create a new filesystem image from the contents of a tarball |
|
| 109 |
+ |
|
| 110 |
+**docker-info(1)** |
|
| 111 |
+ Display system-wide information |
|
| 112 |
+ |
|
| 113 |
+**docker-inspect(1)** |
|
| 114 |
+ Return low-level information on a container |
|
| 115 |
+ |
|
| 116 |
+**docker-kill(1)** |
|
| 117 |
+ Kill a running container (which includes the wrapper process and everything |
|
| 118 |
+inside it) |
|
| 119 |
+ |
|
| 120 |
+**docker-load(1)** |
|
| 121 |
+ Load an image from a tar archive |
|
| 122 |
+ |
|
| 123 |
+**docker-login(1)** |
|
| 124 |
+ Register or Login to a Docker registry server |
|
| 125 |
+ |
|
| 126 |
+**docker-logs(1)** |
|
| 127 |
+ Fetch the logs of a container |
|
| 128 |
+ |
|
| 129 |
+**docker-port(1)** |
|
| 130 |
+ Lookup the public-facing port which is NAT-ed to PRIVATE_PORT |
|
| 131 |
+ |
|
| 132 |
+**docker-ps(1)** |
|
| 133 |
+ List containers |
|
| 134 |
+ |
|
| 135 |
+**docker-pull(1)** |
|
| 136 |
+ Pull an image or a repository from a Docker registry server |
|
| 137 |
+ |
|
| 138 |
+**docker-push(1)** |
|
| 139 |
+ Push an image or a repository to a Docker registry server |
|
| 140 |
+ |
|
| 141 |
+**docker-restart(1)** |
|
| 142 |
+ Restart a running container |
|
| 143 |
+ |
|
| 144 |
+**docker-rm(1)** |
|
| 145 |
+ Remove one or more containers |
|
| 146 |
+ |
|
| 147 |
+**docker-rmi(1)** |
|
| 148 |
+ Remove one or more images |
|
| 149 |
+ |
|
| 150 |
+**docker-run(1)** |
|
| 151 |
+ Run a command in a new container |
|
| 152 |
+ |
|
| 153 |
+**docker-save(1)** |
|
| 154 |
+ Save an image to a tar archive |
|
| 155 |
+ |
|
| 156 |
+**docker-search(1)** |
|
| 157 |
+ Search for an image in the Docker index |
|
| 158 |
+ |
|
| 159 |
+**docker-start(1)** |
|
| 160 |
+ Start a stopped container |
|
| 161 |
+ |
|
| 162 |
+**docker-stop(1)** |
|
| 163 |
+ Stop a running container |
|
| 164 |
+ |
|
| 165 |
+**docker-tag(1)** |
|
| 166 |
+ Tag an image into a repository |
|
| 167 |
+ |
|
| 168 |
+**docker-top(1)** |
|
| 169 |
+ Lookup the running processes of a container |
|
| 170 |
+ |
|
| 171 |
+**version** |
|
| 172 |
+ Show the Docker version information |
|
| 173 |
+ |
|
| 174 |
+**docker-wait(1)** |
|
| 175 |
+ Block until a container stops, then print its exit code |
|
| 176 |
+ |
|
| 177 |
+# EXAMPLES |
|
| 178 |
+ |
|
| 179 |
+For specific examples please see the man page for the specific Docker command. |
|
| 180 |
+For example: |
|
| 181 |
+ |
|
| 182 |
+ man docker run |
|
| 183 |
+ |
|
| 184 |
+# HISTORY |
|
| 185 |
+April 2014, Originally compiled by William Henry (whenry at redhat dot com) based |
|
| 186 |
+ on docker.io source material and internal work. |
| 0 | 187 |
new file mode 100755 |
| ... | ... |
@@ -0,0 +1,22 @@ |
| 0 |
+#!/bin/bash |
|
| 1 |
+set -e |
|
| 2 |
+ |
|
| 3 |
+# get into this script's directory |
|
| 4 |
+cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" |
|
| 5 |
+ |
|
| 6 |
+[ "$1" = '-q' ] || {
|
|
| 7 |
+ set -x |
|
| 8 |
+ pwd |
|
| 9 |
+} |
|
| 10 |
+ |
|
| 11 |
+for FILE in *.md; do |
|
| 12 |
+ base="$(basename "$FILE")" |
|
| 13 |
+ name="${base%.md}"
|
|
| 14 |
+ num="${name##*.}"
|
|
| 15 |
+ if [ -z "$num" -o "$name" = "$num" ]; then |
|
| 16 |
+ # skip files that aren't of the format xxxx.N.md (like README.md) |
|
| 17 |
+ continue |
|
| 18 |
+ fi |
|
| 19 |
+ mkdir -p "../man${num}"
|
|
| 20 |
+ pandoc -s -t man "$FILE" -o "../man${num}/${name}"
|
|
| 21 |
+done |
| ... | ... |
@@ -47,10 +47,10 @@ bundle_ubuntu() {
|
| 47 | 47 |
cp contrib/completion/fish/docker.fish $DIR/etc/fish/completions/ |
| 48 | 48 |
|
| 49 | 49 |
# Include contributed man pages |
| 50 |
- contrib/man/md/md2man-all.sh -q |
|
| 50 |
+ docs/man/md2man-all.sh -q |
|
| 51 | 51 |
manRoot="$DIR/usr/share/man" |
| 52 | 52 |
mkdir -p "$manRoot" |
| 53 |
- for manDir in contrib/man/man*; do |
|
| 53 |
+ for manDir in docs/man?; do |
|
| 54 | 54 |
manBase="$(basename "$manDir")" # "man1" |
| 55 | 55 |
for manFile in "$manDir"/*; do |
| 56 | 56 |
manName="$(basename "$manFile")" # "docker-build.1" |