Fixed #5283 - literal leftover from cutover

Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
This commit is contained in:
James Turnbull 2014-04-17 18:55:24 -04:00
parent ad8db1aa22
commit 2f3cb370df
20 changed files with 88 additions and 128 deletions

View File

@ -49,13 +49,11 @@ For each container, one cgroup will be created in each hierarchy. On
older systems with older versions of the LXC userland tools, the name of older systems with older versions of the LXC userland tools, the name of
the cgroup will be the name of the container. With more recent versions the cgroup will be the name of the container. With more recent versions
of the LXC tools, the cgroup will be `lxc/<container_name>.` of the LXC tools, the cgroup will be `lxc/<container_name>.`
.literal}
For Docker containers using cgroups, the container name will be the full For Docker containers using cgroups, the container name will be the full
ID or long ID of the container. If a container shows up as ae836c95b4c3 ID or long ID of the container. If a container shows up as ae836c95b4c3
in `docker ps`, its long ID might be something like in `docker ps`, its long ID might be something like
`ae836c95b4c3c9e9179e0e91015512da89fdec91612f63cebae57df9a5444c79` `ae836c95b4c3c9e9179e0e91015512da89fdec91612f63cebae57df9a5444c79`. You can look it up with `docker inspect`
.literal}. You can look it up with `docker inspect`
or `docker ps -notrunc`. or `docker ps -notrunc`.
Putting everything together to look at the memory metrics for a Docker Putting everything together to look at the memory metrics for a Docker
@ -206,14 +204,13 @@ Now that weve covered memory metrics, everything else will look very
simple in comparison. CPU metrics will be found in the simple in comparison. CPU metrics will be found in the
`cpuacct` controller. `cpuacct` controller.
For each container, you will find a pseudo-file `cpuacct.stat` For each container, you will find a pseudo-file `cpuacct.stat`,
.literal}, containing the CPU usage accumulated by the processes of the containing the CPU usage accumulated by the processes of the container,
container, broken down between `user` and broken down between `user` and `system` time. If youre not familiar
`system` time. If youre not familiar with the with the distinction, `user` is the time during which the processes were
distinction, `user` is the time during which the in direct control of the CPU (i.e. executing process code), and `system`
processes were in direct control of the CPU (i.e. executing process is the time during which the CPU was executing system calls on behalf of
code), and `system` is the time during which the CPU those processes.
was executing system calls on behalf of those processes.
Those times are expressed in ticks of 1/100th of a second. Actually, Those times are expressed in ticks of 1/100th of a second. Actually,
they are expressed in "user jiffies". There are `USER_HZ` they are expressed in "user jiffies". There are `USER_HZ`
@ -407,11 +404,10 @@ Sometimes, you do not care about real time metric collection, but when a
container exits, you want to know how much CPU, memory, etc. it has container exits, you want to know how much CPU, memory, etc. it has
used. used.
Docker makes this difficult because it relies on `lxc-start` Docker makes this difficult because it relies on `lxc-start`, which
.literal}, which carefully cleans up after itself, but it is still carefully cleans up after itself, but it is still possible. It is
possible. It is usually easier to collect metrics at regular intervals usually easier to collect metrics at regular intervals (e.g. every
(e.g. every minute, with the collectd LXC plugin) and rely on that minute, with the collectd LXC plugin) and rely on that instead.
instead.
But, if youd still like to gather the stats when a container stops, But, if youd still like to gather the stats when a container stops,
here is how: here is how:

View File

@ -71,8 +71,7 @@ a local version of a common base:
# docker build -t my_ubuntu . # docker build -t my_ubuntu .
**Option 2** is good for testing, but will break other HTTP clients **Option 2** is good for testing, but will break other HTTP clients
which obey `http_proxy`, such as `curl` which obey `http_proxy`, such as `curl`, `wget` and others:
.literal}, `wget` and others:
$ sudo docker run --rm -t -i -e http_proxy=http://dockerhost:3142/ debian bash $ sudo docker run --rm -t -i -e http_proxy=http://dockerhost:3142/ debian bash

View File

@ -25,9 +25,8 @@ volume.
## Add data to the first database ## Add data to the first database
Were assuming your Docker host is reachable at `localhost` Were assuming your Docker host is reachable at `localhost`. If not,
.literal}. If not, replace `localhost` with the replace `localhost` with the public IP of your Docker host.
public IP of your Docker host.
HOST=localhost HOST=localhost
URL="http://$HOST:$(sudo docker port $COUCH1 5984 | grep -Po '\d+$')/_utils/" URL="http://$HOST:$(sudo docker port $COUCH1 5984 | grep -Po '\d+$')/_utils/"
@ -35,8 +34,7 @@ public IP of your Docker host.
## Create second database ## Create second database
This time, were requesting shared access to `$COUCH1` This time, were requesting shared access to `$COUCH1`'s volumes.
.literal}s volumes.
COUCH2=$(sudo docker run -d -p 5984 --volumes-from $COUCH1 shykes/couchdb:2013-05-03) COUCH2=$(sudo docker run -d -p 5984 --volumes-from $COUCH1 shykes/couchdb:2013-05-03)

View File

@ -64,10 +64,8 @@ commands, try things out, and then exit when youre done.
Save the changes we just made in the container to a new image called Save the changes we just made in the container to a new image called
`/builds/github.com/shykes/helloflask/master`. You `/builds/github.com/shykes/helloflask/master`. You
now have 3 different ways to refer to the container: name now have 3 different ways to refer to the container: name
`pybuilder_run`, short-id `c8b2e8228f11` `pybuilder_run`, short-id `c8b2e8228f11`, or long-id
.literal}, or long-id `c8b2e8228f11b8b3e492cbf9a49923ae66496230056d61e07880dc74c5f495f9`.
`c8b2e8228f11b8b3e492cbf9a49923ae66496230056d61e07880dc74c5f495f9`
.literal}.
$ sudo docker commit pybuilder_run /builds/github.com/shykes/helloflask/master $ sudo docker commit pybuilder_run /builds/github.com/shykes/helloflask/master
c8b2e8228f11b8b3e492cbf9a49923ae66496230056d61e07880dc74c5f495f9 c8b2e8228f11b8b3e492cbf9a49923ae66496230056d61e07880dc74c5f495f9

View File

@ -101,8 +101,7 @@ are started:
## Create a `supervisord` configuration file ## Create a `supervisord` configuration file
Create an empty file called `supervisord.conf`. Make Create an empty file called `supervisord.conf`. Make
sure its at the same directory level as your `Dockerfile` sure its at the same directory level as your `Dockerfile`:
.literal}:
touch supervisord.conf touch supervisord.conf

View File

@ -86,7 +86,7 @@ page_keywords: faq, questions, documentation, docker
> full traceability from the production server all the way back > full traceability from the production server all the way back
> to the upstream developer. Docker also implements incremental > to the upstream developer. Docker also implements incremental
> uploads and downloads, similar to `git pull` > uploads and downloads, similar to `git pull`
> .literal}, so new versions of a container can be transferred > , so new versions of a container can be transferred
> by only sending diffs. > by only sending diffs.
> >
> - *Component re-use.* > - *Component re-use.*

View File

@ -77,7 +77,6 @@ Repository.
left side left side
- Search for 2014.03 and select one of the Amazon provided AMI, - Search for 2014.03 and select one of the Amazon provided AMI,
for example `amzn-ami-pv-2014.03.rc-0.x86_64-ebs` for example `amzn-ami-pv-2014.03.rc-0.x86_64-ebs`
.literal}
- For testing you can use the default (possibly free) - For testing you can use the default (possibly free)
`t1.micro` instance (more info on `t1.micro` instance (more info on
[pricing](http://aws.amazon.com/en/ec2/pricing/)). [pricing](http://aws.amazon.com/en/ec2/pricing/)).

View File

@ -26,12 +26,11 @@ bit** architecture.
The `docker-io` package provides Docker on Fedora. The `docker-io` package provides Docker on Fedora.
If you have the (unrelated) `docker` package If you have the (unrelated) `docker` package installed already, it will
installed already, it will conflict with `docker-io` conflict with `docker-io`. Theres a [bug
.literal}. Theres a [bug
report](https://bugzilla.redhat.com/show_bug.cgi?id=1043676) filed for report](https://bugzilla.redhat.com/show_bug.cgi?id=1043676) filed for
it. To proceed with `docker-io` installation on it. To proceed with `docker-io` installation on Fedora 19, please remove
Fedora 19, please remove `docker` first. `docker` first.
sudo yum -y remove docker sudo yum -y remove docker

View File

@ -35,8 +35,8 @@ you will need to set the kernel manually.
# install the new kernel # install the new kernel
apt-get install linux-generic-lts-raring apt-get install linux-generic-lts-raring
Great, now you have the kernel installed in `/boot/` Great, now you have the kernel installed in `/boot/`, next you need to
.literal}, next you need to make it boot next time. make it boot next time.
# find the exact names # find the exact names
find /boot/ -name '*3.8*' find /boot/ -name '*3.8*'

View File

@ -172,8 +172,8 @@ than `docker` should own the Unix socket with the
Warning Warning
The *docker* group (or the group specified with `-G` The *docker* group (or the group specified with `-G`) is
.literal}) is root-equivalent; see [*Docker Daemon Attack root-equivalent; see [*Docker Daemon Attack
Surface*](../../articles/security/#dockersecurity-daemon) details. Surface*](../../articles/security/#dockersecurity-daemon) details.
**Example:** **Example:**

View File

@ -72,10 +72,8 @@ following a link in your application to an OAuth Authorization endpoint.
included, it must be one of the URIs which were submitted when included, it must be one of the URIs which were submitted when
registering your application. registering your application.
- **scope** The extent of access permissions you are requesting. - **scope** The extent of access permissions you are requesting.
Currently, the scope options are `profile_read` Currently, the scope options are `profile_read`, `profile_write`,
.literal}, `profile_write`, `email_read`, and `email_write`. Scopes must be separated by a space. If omitted, the
`email_read`, and `email_write`
.literal}. Scopes must be separated by a space. If omitted, the
default scopes `profile_read email_read` are default scopes `profile_read email_read` are
used. used.
- **state** (Recommended) Used by your application to maintain - **state** (Recommended) Used by your application to maintain
@ -140,7 +138,6 @@ to get an Access Token.
   
- **grant\_type** MUST be set to `authorization_code` - **grant\_type** MUST be set to `authorization_code`
.literal}
- **code** The authorization code received from the users - **code** The authorization code received from the users
redirect request. redirect request.
- **redirect\_uri** The same `redirect_uri` - **redirect\_uri** The same `redirect_uri`
@ -204,7 +201,6 @@ if the user has not revoked access from your application.
   
- **grant\_type** MUST be set to `refresh_token` - **grant\_type** MUST be set to `refresh_token`
.literal}
- **refresh\_token** The `refresh_token` - **refresh\_token** The `refresh_token`
which was issued to your application. which was issued to your application.
- **scope** (optional) The scope of the access token to be - **scope** (optional) The scope of the access token to be

View File

@ -254,9 +254,9 @@ All new files and directories are created with mode 0755, uid and gid 0.
Note Note
if you build using STDIN (`docker build - < somefile` if you build using STDIN (`docker build - < somefile`), there is no
.literal}), there is no build context, so the Dockerfile can only build context, so the Dockerfile can only contain an URL based ADD
contain an URL based ADD statement. statement.
Note Note
@ -335,12 +335,11 @@ that you can run as an executable. That is, when you specify an
`ENTRYPOINT`, then the whole container runs as if it `ENTRYPOINT`, then the whole container runs as if it
was just that executable. was just that executable.
The `ENTRYPOINT` instruction adds an entry command The `ENTRYPOINT` instruction adds an entry command that will **not** be
that will **not** be overwritten when arguments are passed to overwritten when arguments are passed to `docker run`, unlike the
`docker run`, unlike the behavior of `CMD` behavior of `CMD`. This allows arguments to be passed to the entrypoint.
.literal}. This allows arguments to be passed to the entrypoint. i.e. i.e. `docker run <image> -d` will pass the "-d" argument to the
`docker run <image> -d` will pass the "-d" argument ENTRYPOINT.
to the ENTRYPOINT.
You can specify parameters either in the ENTRYPOINT JSON array (as in You can specify parameters either in the ENTRYPOINT JSON array (as in
"like an exec" above), or by using a CMD statement. Parameters in the "like an exec" above), or by using a CMD statement. Parameters in the

View File

@ -19,8 +19,7 @@ no parameters or execute `docker help`:
Single character commandline options can be combined, so rather than Single character commandline options can be combined, so rather than
typing `docker run -t -i --name test busybox sh`, typing `docker run -t -i --name test busybox sh`,
you can write `docker run -ti --name test busybox sh` you can write `docker run -ti --name test busybox sh`.
.literal}.
### Boolean ### Boolean
@ -92,11 +91,9 @@ To set the DNS server for all Docker containers, use
To set the DNS search domain for all Docker containers, use To set the DNS search domain for all Docker containers, use
`docker -d --dns-search example.com`. `docker -d --dns-search example.com`.
To run the daemon with debug output, use `docker -d -D` To run the daemon with debug output, use `docker -d -D`.
.literal}.
To use lxc as the execution driver, use `docker -d -e lxc` To use lxc as the execution driver, use `docker -d -e lxc`.
.literal}.
The docker client will also honor the `DOCKER_HOST` The docker client will also honor the `DOCKER_HOST`
environment variable to set the `-H` flag for the environment variable to set the `-H` flag for the
@ -119,8 +116,7 @@ systemd in the [docker source
tree](https://github.com/dotcloud/docker/blob/master/contrib/init/systemd/socket-activation/). tree](https://github.com/dotcloud/docker/blob/master/contrib/init/systemd/socket-activation/).
Docker supports softlinks for the Docker data directory Docker supports softlinks for the Docker data directory
(`/var/lib/docker`) and for `/tmp` (`/var/lib/docker`) and for `/tmp`. TMPDIR and the data directory can be set like this:
.literal}. TMPDIR and the data directory can be set like this:
TMPDIR=/mnt/disk2/tmp /usr/local/bin/docker -d -D -g /var/lib/docker -H unix:// > /var/lib/boot2docker/docker.log 2>&1 TMPDIR=/mnt/disk2/tmp /usr/local/bin/docker -d -D -g /var/lib/docker -H unix:// > /var/lib/boot2docker/docker.log 2>&1
# or # or
@ -254,8 +250,7 @@ machine and that no parsing of the `Dockerfile`
happens at the client side (where youre running happens at the client side (where youre running
`docker build`). That means that *all* the files at `docker build`). That means that *all* the files at
`PATH` get sent, not just the ones listed to `PATH` get sent, not just the ones listed to
[*ADD*](../../builder/#dockerfile-add) in the `Dockerfile` [*ADD*](../../builder/#dockerfile-add) in the `Dockerfile`.
.literal}.
The transfer of context from the local machine to the Docker daemon is The transfer of context from the local machine to the Docker daemon is
what the `docker` client means when you see the what the `docker` client means when you see the
@ -658,9 +653,8 @@ Restores both images and tags.
The `docker logs` command batch-retrieves all logs The `docker logs` command batch-retrieves all logs
present at the time of execution. present at the time of execution.
The `docker logs --follow` command combines The `docker logs --follow` command combines `docker logs` and `docker
`docker logs` and `docker attach` attach`: it will first return all logs from the beginning and then
.literal}: it will first return all logs from the beginning and then
continue streaming new output from the containers stdout and stderr. continue streaming new output from the containers stdout and stderr.
## `port` ## `port`
@ -957,10 +951,8 @@ container). All three flags, `-e`, `--env`
and `--env-file` can be repeated. and `--env-file` can be repeated.
Regardless of the order of these three flags, the `--env-file` Regardless of the order of these three flags, the `--env-file`
are processed first, and then `-e` are processed first, and then `-e`, `--env` flags. This way, the
.literal}/`--env` flags. This way, the `-e` or `--env` will override variables as needed.
`-e` or `--env` will override
variables as needed.
$ cat ./env.list $ cat ./env.list
TEST_FOO=BAR TEST_FOO=BAR

View File

@ -46,8 +46,8 @@ and nearly all the defaults set by the Docker runtime itself.
## [Operator Exclusive Options](#id4) ## [Operator Exclusive Options](#id4)
Only the operator (the person executing `docker run` Only the operator (the person executing `docker run`) can set the
.literal}) can set the following options. following options.
- [Detached vs Foreground](#detached-vs-foreground) - [Detached vs Foreground](#detached-vs-foreground)
- [Detached (-d)](#detached-d) - [Detached (-d)](#detached-d)
@ -72,14 +72,12 @@ default foreground mode:
#### [Detached (-d)](#id3) #### [Detached (-d)](#id3)
In detached mode (`-d=true` or just `-d` In detached mode (`-d=true` or just `-d`), all I/O should be done
.literal}), all I/O should be done through network connections or shared through network connections or shared volumes because the container is
volumes because the container is no longer listening to the commandline no longer listening to the commandline where you executed `docker run`.
where you executed `docker run`. You can reattach to You can reattach to a detached container with `docker`
a detached container with `docker`
[*attach*](../commandline/cli/#cli-attach). If you choose to run a [*attach*](../commandline/cli/#cli-attach). If you choose to run a
container in the detached mode, then you cannot use the `--rm` container in the detached mode, then you cannot use the `--rm` option.
option.
#### [Foreground](#id4) #### [Foreground](#id4)
@ -196,12 +194,12 @@ by default a container is not allowed to access any devices, but a
and documentation on [cgroups and documentation on [cgroups
devices](https://www.kernel.org/doc/Documentation/cgroups/devices.txt)). devices](https://www.kernel.org/doc/Documentation/cgroups/devices.txt)).
When the operator executes `docker run --privileged` When the operator executes `docker run --privileged`, Docker will enable
.literal}, Docker will enable to access to all devices on the host as to access to all devices on the host as well as set some configuration
well as set some configuration in AppArmor to allow the container nearly in AppArmor to allow the container nearly all the same access to the
all the same access to the host as processes running outside containers host as processes running outside containers on the host. Additional
on the host. Additional information about running with information about running with `--privileged` is available on the
`--privileged` is available on the [Docker [Docker
Blog](http://blog.docker.io/2013/09/docker-can-now-run-within-docker/). Blog](http://blog.docker.io/2013/09/docker-can-now-run-within-docker/).
If the Docker daemon was started using the `lxc` If the Docker daemon was started using the `lxc`
@ -259,19 +257,17 @@ as arguments to the `ENTRYPOINT`.
--entrypoint="": Overwrite the default entrypoint set by the image --entrypoint="": Overwrite the default entrypoint set by the image
The ENTRYPOINT of an image is similar to a `COMMAND` The ENTRYPOINT of an image is similar to a `COMMAND` because it
because it specifies what executable to run when the container starts, specifies what executable to run when the container starts, but it is
but it is (purposely) more difficult to override. The (purposely) more difficult to override. The `ENTRYPOINT` gives a
`ENTRYPOINT` gives a container its default nature or container its default nature or behavior, so that when you set an
behavior, so that when you set an `ENTRYPOINT` you `ENTRYPOINT` you can run the container *as if it were that binary*,
can run the container *as if it were that binary*, complete with default complete with default options, and you can pass in more options via the
options, and you can pass in more options via the `COMMAND` `COMMAND`. But, sometimes an operator may want to run something else
.literal}. But, sometimes an operator may want to run something else inside the container, so you can override the default `ENTRYPOINT` at
inside the container, so you can override the default runtime by using a string to specify the new `ENTRYPOINT`. Here is an
`ENTRYPOINT` at runtime by using a string to specify example of how to run a shell in a container that has been set up to
the new `ENTRYPOINT`. Here is an example of how to automatically run something else (like `/usr/bin/redis-server`):
run a shell in a container that has been set up to automatically run
something else (like `/usr/bin/redis-server`):
docker run -i -t --entrypoint /bin/bash example/redis docker run -i -t --entrypoint /bin/bash example/redis
@ -330,8 +326,7 @@ port to use.
The operator can **set any environment variable** in the container by The operator can **set any environment variable** in the container by
using one or more `-e` flags, even overriding those using one or more `-e` flags, even overriding those
already defined by the developer with a Dockefile `ENV` already defined by the developer with a Dockefile `ENV`:
.literal}:
$ docker run -e "deep=purple" --rm ubuntu /bin/bash -c export $ docker run -e "deep=purple" --rm ubuntu /bin/bash -c export
declare -x HOME="/" declare -x HOME="/"
@ -343,8 +338,7 @@ already defined by the developer with a Dockefile `ENV`
declare -x container="lxc" declare -x container="lxc"
declare -x deep="purple" declare -x deep="purple"
Similarly the operator can set the **hostname** with `-h` Similarly the operator can set the **hostname** with `-h`.
.literal}.
`--link name:alias` also sets environment variables, `--link name:alias` also sets environment variables,
using the *alias* string to define environment variables within the using the *alias* string to define environment variables within the

View File

@ -23,7 +23,6 @@ an image name using one of three different commands:
A Fully Qualified Image Name (FQIN) can be made up of 3 parts: A Fully Qualified Image Name (FQIN) can be made up of 3 parts:
`[registry_hostname[:port]/][user_name/](repository_name:version_tag)` `[registry_hostname[:port]/][user_name/](repository_name:version_tag)`
.literal}
`username` and `registry_hostname` `username` and `registry_hostname`
default to an empty string. When `registry_hostname` default to an empty string. When `registry_hostname`

View File

@ -135,8 +135,7 @@ the `-e` command line option.
`--expose 1234 -e REDIS_PORT_1234_TCP=tcp://192.168.1.52:6379` `--expose 1234 -e REDIS_PORT_1234_TCP=tcp://192.168.1.52:6379`
will forward the local `1234` port to the will forward the local `1234` port to the
remote IP and port - in this case `192.168.1.52:6379` remote IP and port - in this case `192.168.1.52:6379`.
.literal}.
# #
# #

View File

@ -39,8 +39,7 @@ characters of the full image ID - which can be found using
`docker inspect` or `docker inspect` or
`docker images --no-trunc=true` `docker images --no-trunc=true`
**If youre using OS X** then you shouldnt use `sudo` **If youre using OS X** then you shouldnt use `sudo`.
.literal}
## Running an interactive shell ## Running an interactive shell

View File

@ -27,12 +27,11 @@ managed by Docker for this purpose. When the Docker daemon starts it :
docker0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx docker0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0 inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0
At runtime, a [*specific kind of virtual interface*](#what-is-the-vethxxxx-device) At runtime, a [*specific kind of virtual interface*](#vethxxxx-device)
is given to each container which is then bonded to the is given to each container which is then bonded to the `docker0` bridge.
`docker0` bridge. Each container also receives a Each container also receives a dedicated IP address from the same range
dedicated IP address from the same range as `docker0` as `docker0`. The `docker0` IP address is used as the default gateway
.literal}. The `docker0` IP address is used as the for the container.
default gateway for the container.
# Run a container # Run a container
$ sudo docker run -t -i -d base /bin/bash $ sudo docker run -t -i -d base /bin/bash
@ -42,9 +41,8 @@ default gateway for the container.
bridge name bridge id STP enabled interfaces bridge name bridge id STP enabled interfaces
docker0 8000.fef213db5a66 no vethQCDY1N docker0 8000.fef213db5a66 no vethQCDY1N
Above, `docker0` acts as a bridge for the Above, `docker0` acts as a bridge for the `vethQCDY1N` interface which
`vethQCDY1N` interface which is dedicated to the is dedicated to the 52f811c5d3d6 container.
52f811c5d3d6 container.
## How to use a specific IP address range ## How to use a specific IP address range

View File

@ -62,9 +62,8 @@ combinations of options for TCP port are the following:
# Bind TCP port 8080 of the container to a dynamically allocated TCP port on all available interfaces of the host machine. # Bind TCP port 8080 of the container to a dynamically allocated TCP port on all available interfaces of the host machine.
docker run -p 8080 <image> <cmd> docker run -p 8080 <image> <cmd>
UDP ports can also be bound by adding a trailing `/udp` UDP ports can also be bound by adding a trailing `/udp`. All the
.literal}. All the combinations described for TCP work. Here is only one combinations described for TCP work. Here is only one example:
example:
# Bind UDP port 5353 of the container to UDP port 53 on 127.0.0.1 of the host machine. # Bind UDP port 5353 of the container to UDP port 53 on 127.0.0.1 of the host machine.
docker run -p 127.0.0.1:53:5353/udp <image> <cmd> docker run -p 127.0.0.1:53:5353/udp <image> <cmd>
@ -112,16 +111,14 @@ a Dockerfile:
# Expose port 80 # Expose port 80
docker run --expose 80 --name server <image> <cmd> docker run --expose 80 --name server <image> <cmd>
The `client` then links to the `server` The `client` then links to the `server`:
.literal}:
# Link # Link
docker run --name client --link server:linked-server <image> <cmd> docker run --name client --link server:linked-server <image> <cmd>
`client` locally refers to `server` `client` locally refers to `server`
as `linked-server`. The following as `linked-server`. The following
environment variables, among others, are available on `client` environment variables, among others, are available on `client`:
.literal}:
# The default protocol, ip, and port of the service running in the container # The default protocol, ip, and port of the service running in the container
LINKED-SERVER_PORT=tcp://172.17.0.8:80 LINKED-SERVER_PORT=tcp://172.17.0.8:80

View File

@ -109,8 +109,7 @@ container. Similarly, some daemons (such as `sshd`)
will scrub them when spawning shells for connection. will scrub them when spawning shells for connection.
You can work around this by storing the initial `env` You can work around this by storing the initial `env`
in a file, or looking at `/proc/1/environ` in a file, or looking at `/proc/1/environ`.
.literal}.
Running `docker ps` shows the 2 containers, and the Running `docker ps` shows the 2 containers, and the
`webapp/db` alias name for the Redis container. `webapp/db` alias name for the Redis container.