mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Update the docs for --link accept container id
Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
parent
22437eb960
commit
750373875e
6 changed files with 11 additions and 11 deletions
|
@ -102,7 +102,7 @@ IMAGE [COMMAND] [ARG...]
|
|||
'host': use the host shared memory,semaphores and message queues inside the container. Note: the host mode gives the container full access to local shared memory and is therefore considered insecure.
|
||||
|
||||
**--link**=[]
|
||||
Add link to another container in the form of name:alias
|
||||
Add link to another container in the form of <name or id>:alias
|
||||
|
||||
**--lxc-conf**=[]
|
||||
(lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
|
||||
|
|
|
@ -170,7 +170,7 @@ ENTRYPOINT.
|
|||
'host': use the host shared memory,semaphores and message queues inside the container. Note: the host mode gives the container full access to local shared memory and is therefore considered insecure.
|
||||
|
||||
**--link**=[]
|
||||
Add link to another container in the form of name:alias
|
||||
Add link to another container in the form of <name or id>:alias
|
||||
|
||||
If the operator
|
||||
uses **--link** when starting the new client container, then the client
|
||||
|
|
|
@ -105,7 +105,7 @@ Finally, several networking options can only be provided when calling
|
|||
[Configuring DNS](#dns) and
|
||||
[How Docker networks a container](#container-networking)
|
||||
|
||||
* `--link=CONTAINER_NAME:ALIAS` — see
|
||||
* `--link=CONTAINER_NAME_or_ID:ALIAS` — see
|
||||
[Configuring DNS](#dns) and
|
||||
[Communication between containers](#between-containers)
|
||||
|
||||
|
@ -158,10 +158,10 @@ Four different options affect container domain name services.
|
|||
outside the container. It will not appear in `docker ps` nor in the
|
||||
`/etc/hosts` file of any other container.
|
||||
|
||||
* `--link=CONTAINER_NAME:ALIAS` — using this option as you `run` a
|
||||
* `--link=CONTAINER_NAME_or_ID:ALIAS` — using this option as you `run` a
|
||||
container gives the new container's `/etc/hosts` an extra entry
|
||||
named `ALIAS` that points to the IP address of the container named
|
||||
`CONTAINER_NAME`. This lets processes inside the new container
|
||||
named `ALIAS` that points to the IP address of the container identified by
|
||||
`CONTAINER_NAME_or_ID`. This lets processes inside the new container
|
||||
connect to the hostname `ALIAS` without having to know its IP. The
|
||||
`--link=` option is discussed in more detail below, in the section
|
||||
[Communication between containers](#between-containers). Because
|
||||
|
@ -284,7 +284,7 @@ If you choose the most secure setting of `--icc=false`, then how can
|
|||
containers communicate in those cases where you *want* them to provide
|
||||
each other services?
|
||||
|
||||
The answer is the `--link=CONTAINER_NAME:ALIAS` option, which was
|
||||
The answer is the `--link=CONTAINER_NAME_or_ID:ALIAS` option, which was
|
||||
mentioned in the previous section because of its effect upon name
|
||||
services. If the Docker daemon is running with both `--icc=false` and
|
||||
`--iptables=true` then, when it sees `docker run` invoked with the
|
||||
|
|
|
@ -738,7 +738,7 @@ Creates a new container.
|
|||
--ipc="" Default is to create a private IPC namespace (POSIX SysV IPC) for the container
|
||||
'container:<name|id>': reuses another container shared memory, semaphores and message queues
|
||||
'host': use the host shared memory,semaphores and message queues inside the container. Note: the host mode gives the container full access to local shared memory and is therefore considered insecure.
|
||||
--link=[] Add link to another container in the form of name:alias
|
||||
--link=[] Add link to another container in the form of <name or id>:alias
|
||||
--lxc-conf=[] (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
|
||||
-m, --memory="" Memory limit (format: <number><optional unit>, where unit = b, k, m or g)
|
||||
--mac-address="" Container MAC address (e.g. 92:d0:c6:0a:29:33)
|
||||
|
|
|
@ -512,7 +512,7 @@ or override the Dockerfile's exposed defaults:
|
|||
Both hostPort and containerPort can be specified as a range of ports.
|
||||
When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range. (e.g., `-p 1234-1236:1234-1236/tcp`)
|
||||
(use 'docker port' to see the actual mapping)
|
||||
--link="" : Add link to another container (name:alias)
|
||||
--link="" : Add link to another container (<name or id>:alias)
|
||||
|
||||
As mentioned previously, `EXPOSE` (and `--expose`) makes ports available
|
||||
**in** a container for incoming connections. The port number on the
|
||||
|
@ -595,7 +595,7 @@ above, or already defined by the developer with a Dockerfile `ENV`:
|
|||
|
||||
Similarly the operator can set the **hostname** with `-h`.
|
||||
|
||||
`--link name:alias` also sets environment variables, using the *alias* string to
|
||||
`--link <name or id>:alias` also sets environment variables, using the *alias* string to
|
||||
define environment variables within the container that give the IP and PORT
|
||||
information for connecting to the service container. Let's imagine we have a
|
||||
container running Redis:
|
||||
|
|
|
@ -146,7 +146,7 @@ Now, create a new `web` container and link it with your `db` container.
|
|||
This will link the new `web` container with the `db` container you created
|
||||
earlier. The `--link` flag takes the form:
|
||||
|
||||
--link name:alias
|
||||
--link <name or id>:alias
|
||||
|
||||
Where `name` is the name of the container we're linking to and `alias` is an
|
||||
alias for the link name. You'll see how that alias gets used shortly.
|
||||
|
|
Loading…
Reference in a new issue