Merge branch '1.5'

This commit is contained in:
Bryan Boreham committed 2016-06-15 13:50:47 +01:00
commit bb203a2d18
16 files changed
+47 -39

No files matched your search

+8
View File
@@ -91,6 +91,14 @@ You must permit traffic to flow through TCP 6783 and UDP 6783/6784,
which are Weave’s control and data ports. which are Weave’s control and data ports.
**<a name=own-image></a>Q: Why do you use your own Docker image `weaveworks/ubuntu`?**
The official Ubuntu image does not contain the `ping` and `nc`
commands which are used in many of our examples throughout the
documentation. The `weaveworks/ubuntu` image is simply the official
Ubuntu image with those two commands added.
**See Also** **See Also**
* [Troubleshooting Weave](/site/troubleshooting.md) * [Troubleshooting Weave](/site/troubleshooting.md)
+3 -3
View File
@@ -81,7 +81,7 @@ See [Using the Weave Docker API Proxy](/site/weave-docker-api/using-proxy.md).
Weave Net can also be used as a [Docker plugin](https://docs.docker.com/engine/extend/plugins_network/). A Docker network Weave Net can also be used as a [Docker plugin](https://docs.docker.com/engine/extend/plugins_network/). A Docker network
named `weave` is created by `weave launch`, which is used as follows: named `weave` is created by `weave launch`, which is used as follows:
$ docker run --net=weave -ti ubuntu $ docker run --net=weave -ti weaveworks/ubuntu
Using the Weave plugin enables you to take advantage of [Docker's network functionality](https://docs.docker.com/engine/extend/plugins_network/). Using the Weave plugin enables you to take advantage of [Docker's network functionality](https://docs.docker.com/engine/extend/plugins_network/).
@@ -119,8 +119,8 @@ For a discussion on how Weave Net uses IPAM, see [Automatic IP Address Managemen
Named containers are automatically registered in [weaveDNS](/site/weavedns.md), Named containers are automatically registered in [weaveDNS](/site/weavedns.md),
and are discoverable by using standard, simple name lookups: and are discoverable by using standard, simple name lookups:
host1$ docker run -dti --name=service ubuntu host1$ docker run -dti --name=service weaveworks/ubuntu
host1$ docker run -ti ubuntu host1$ docker run -ti weaveworks/ubuntu
root@7b21498fb103:/# ping service root@7b21498fb103:/# ping service
WeaveDNS also supports [load balancing](/site/weavedns/load-balance-fault-weavedns.md), [fault resilience](/site/weavedns/load-balance-fault-weavedns.md) and [hot swapping](/site/weavedns/managing-entries-weavedns.md). WeaveDNS also supports [load balancing](/site/weavedns/load-balance-fault-weavedns.md), [fault resilience](/site/weavedns/load-balance-fault-weavedns.md) and [hot swapping](/site/weavedns/managing-entries-weavedns.md).
+2 -2
View File
@@ -15,13 +15,13 @@ allocation of an address from a particular subnet, set the
`WEAVE_CIDR` environment variable to `net:<subnet>` when creating the `WEAVE_CIDR` environment variable to `net:<subnet>` when creating the
container, for example: container, for example:
host1$ docker run -e WEAVE_CIDR=net:10.2.7.0/24 -ti ubuntu host1$ docker run -e WEAVE_CIDR=net:10.2.7.0/24 -ti weaveworks/ubuntu
You can ask for multiple addresses in different subnets and add in You can ask for multiple addresses in different subnets and add in
manually-assigned addresses (outside the automatic allocation range), manually-assigned addresses (outside the automatic allocation range),
for instance: for instance:
host1$ docker run -e WEAVE_CIDR="net:10.2.7.0/24 net:10.2.8.0/24 ip:10.3.9.1/24" -ti ubuntu host1$ docker run -e WEAVE_CIDR="net:10.2.7.0/24 net:10.2.8.0/24 ip:10.3.9.1/24" -ti weaveworks/ubuntu
>**Note:** The ".0" and ".-1" addresses in a subnet are not used, as required by >**Note:** The ".0" and ".-1" addresses in a subnet are not used, as required by
[RFC 1122](https://tools.ietf.org/html/rfc1122#page-29)). [RFC 1122](https://tools.ietf.org/html/rfc1122#page-29)).
+5 -5
View File
@@ -20,7 +20,7 @@ See [Using Weave Net](/site/using-weave.md#peer-connections) for a discussion on
After you've launched Weave Net and peered your hosts, you can start containers using the following, for example: After you've launched Weave Net and peered your hosts, you can start containers using the following, for example:
$ docker run --net=weave -ti ubuntu $ docker run --net=weave -ti weaveworks/ubuntu
on any of the hosts, and they can all communicate with each other on any of the hosts, and they can all communicate with each other
using any protocol, even multicast. using any protocol, even multicast.
@@ -31,8 +31,8 @@ In order to use Weave Net's [Service Discovery](/site/weavedns.md) you
must pass the additional arguments `--dns` and `-dns-search`, for must pass the additional arguments `--dns` and `-dns-search`, for
which a helper is provided in the Weave script: which a helper is provided in the Weave script:
$ docker run --net=weave -h foo.weave.local $(weave dns-args) -tdi ubuntu $ docker run --net=weave -h foo.weave.local $(weave dns-args) -tdi weaveworks/ubuntu
$ docker run --net=weave -h bar.weave.local $(weave dns-args) -ti ubuntu $ docker run --net=weave -h bar.weave.local $(weave dns-args) -ti weaveworks/ubuntu
# ping foo # ping foo
@@ -45,11 +45,11 @@ Just launch the Weave Net router onto each host and make a peer connection with
then run your containers using the Docker command-line: then run your containers using the Docker command-line:
host1$ docker run --net=weave -ti ubuntu host1$ docker run --net=weave -ti weaveworks/ubuntu
root@1458e848cd90:/# hostname -i root@1458e848cd90:/# hostname -i
10.32.0.2 10.32.0.2
host2$ docker run --net=weave -ti ubuntu host2$ docker run --net=weave -ti weaveworks/ubuntu
root@8cc4b5dc5722:/# ping 10.32.0.2 root@8cc4b5dc5722:/# ping 10.32.0.2
PING 10.32.0.2 (10.32.0.2) 56(84) bytes of data. PING 10.32.0.2 (10.32.0.2) 56(84) bytes of data.
+3 -3
View File
@@ -21,13 +21,13 @@ On `$HOST1` run:
host1$ weave launch host1$ weave launch
host1$ eval $(weave env) host1$ eval $(weave env)
host1$ docker run --name a1 -ti ubuntu:trusty host1$ docker run --name a1 -ti weaveworks/ubuntu
Where, Where,
* The first line runs Weave Net. * The first line runs Weave Net.
* The second line configures the Weave Net environment, so that containers launched via the Docker command line are automatically attached to the Weave network, and, * The second line configures the Weave Net environment, so that containers launched via the Docker command line are automatically attached to the Weave network, and,
* The third line runs the application container using [Docker commands](https://docs.Docker.com/engine/reference/commandline/daemon/). * The third line runs the [application container](/site/faq.md#own-image) using [a Docker command](https://docs.docker.com/engine/reference/run/).
>**Note:** If the first command results in an error like >**Note:** If the first command results in an error like
`http:///var/run/Docker.sock/v1.19/containers/create: dial unix `http:///var/run/Docker.sock/v1.19/containers/create: dial unix
@@ -49,7 +49,7 @@ To launch Weave Net on an additional host and create a peer connection, run the
host2$ weave launch $HOST1 host2$ weave launch $HOST1
host2$ eval $(weave env) host2$ eval $(weave env)
host2$ docker run --name a2 -ti ubuntu:trusty host2$ docker run --name a2 -ti weaveworks/ubuntu
As noted above, the same steps are repeated for `$HOST2`. The only difference, besides the application container’s name, is that `$HOST2` is told to peer with Weave Net on `$HOST1` during launch. As noted above, the same steps are repeated for `$HOST2`. The only difference, besides the application container’s name, is that `$HOST2` is told to peer with Weave Net on `$HOST1` during launch.
+5 -5
View File
@@ -26,13 +26,13 @@ specified.
Next, launch the two netcat containers onto the default subnet: Next, launch the two netcat containers onto the default subnet:
host1$ docker run --name a1 -ti ubuntu host1$ docker run --name a1 -ti weaveworks/ubuntu
host2$ docker run --name a2 -ti ubuntu host2$ docker run --name a2 -ti weaveworks/ubuntu
And then to test the isolation, launch a few more containers onto a different subnet: And then to test the isolation, launch a few more containers onto a different subnet:
host1$ docker run -e WEAVE_CIDR=net:10.2.2.0/24 --name b1 -ti ubuntu host1$ docker run -e WEAVE_CIDR=net:10.2.2.0/24 --name b1 -ti weaveworks/ubuntu
host2$ docker run -e WEAVE_CIDR=net:10.2.2.0.24 --name b2 -ti ubuntu host2$ docker run -e WEAVE_CIDR=net:10.2.2.0.24 --name b2 -ti weaveworks/ubuntu
Ping each container to confirm that they can talk to each other, but not to the containers of our first subnet: Ping each container to confirm that they can talk to each other, but not to the containers of our first subnet:
@@ -54,7 +54,7 @@ Ping each container to confirm that they can talk to each other, but not to the
If required, a container can also be attached to multiple subnets when it is started using: If required, a container can also be attached to multiple subnets when it is started using:
host1$ docker run -e WEAVE_CIDR="net:default net:10.2.2.0/24" -ti ubuntu host1$ docker run -e WEAVE_CIDR="net:default net:10.2.2.0/24" -ti weaveworks/ubuntu
`net:default` is used to request the allocation of an address from the default subnet in addition to one from an explicitly specified range. `net:default` is used to request the allocation of an address from the default subnet in addition to one from an explicitly specified range.
@@ -8,13 +8,13 @@ When containers may not know the network to which they will be attached, Weave N
To illustrate... To illustrate...
host1$ C=$(docker run -e WEAVE_CIDR=none -dti ubuntu) host1$ C=$(docker run -e WEAVE_CIDR=none -dti weaveworks/ubuntu)
host1$ weave attach $C host1$ weave attach $C
10.2.1.3 10.2.1.3
where, where,
* `C=$(docker run -e WEAVE_CIDR=none -dti ubuntu)` starts a container and assigns its ID to a variable * `C=$(docker run -e WEAVE_CIDR=none -dti weaveworks/ubuntu)` starts a container and assigns its ID to a variable
* `weave attach` – the Weave Net command to attach to the specified container * `weave attach` – the Weave Net command to attach to the specified container
* `10.2.1.3` - the allocated IP address output by `weave attach`, in this case in the default subnet * `10.2.1.3` - the allocated IP address output by `weave attach`, in this case in the default subnet
+2 -2
View File
@@ -21,12 +21,12 @@ For example, we can launch a couple of containers on `$HOST1` and
On `$HOST1`: On `$HOST1`:
host1$ docker run -e WEAVE_CIDR=10.2.1.1/24 -ti ubuntu host1$ docker run -e WEAVE_CIDR=10.2.1.1/24 -ti weaveworks/ubuntu
root@7ca0f6ecf59f:/# root@7ca0f6ecf59f:/#
And `$HOST2`: And `$HOST2`:
host2$ docker run -e WEAVE_CIDR=10.2.1.2/24 -ti ubuntu host2$ docker run -e WEAVE_CIDR=10.2.1.2/24 -ti weaveworks/ubuntu
root@04c4831fafd3:/# root@04c4831fafd3:/#
Then test that the container on `$HOST2` can be reached from the container on `$HOST1`: Then test that the container on `$HOST2` can be reached from the container on `$HOST1`:
@@ -37,7 +37,7 @@ For example, you can launch the proxy using all three flags, as follows:
After launching the Weave Net proxy with these flags, running a container named `aws-12798186823-foo` without labels results in weaveDNS registering the hostname `my-app-foo` and not `aws-12798186823-foo`. After launching the Weave Net proxy with these flags, running a container named `aws-12798186823-foo` without labels results in weaveDNS registering the hostname `my-app-foo` and not `aws-12798186823-foo`.
host1$ docker run -ti --name=aws-12798186823-foo ubuntu ping my-app-foo host1$ docker run -ti --name=aws-12798186823-foo weaveworks/ubuntu ping my-app-foo
PING my-app-foo.weave.local (10.32.0.2) 56(84) bytes of data. PING my-app-foo.weave.local (10.32.0.2) 56(84) bytes of data.
64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=1 ttl=64 time=0.027 ms 64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=1 ttl=64 time=0.027 ms
64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=2 ttl=64 time=0.067 ms 64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=2 ttl=64 time=0.067 ms
@@ -45,7 +45,7 @@ After launching the Weave Net proxy with these flags, running a container named
Also, running a container named `foo` with the label Also, running a container named `foo` with the label
`hostname-label=aws-12798186823-foo` leads to the same hostname registration. `hostname-label=aws-12798186823-foo` leads to the same hostname registration.
host1$ docker run -ti --name=foo --label=hostname-label=aws-12798186823-foo ubuntu ping my-app-foo host1$ docker run -ti --name=foo --label=hostname-label=aws-12798186823-foo weaveworks/ubuntu ping my-app-foo
PING my-app-foo.weave.local (10.32.0.2) 56(84) bytes of data. PING my-app-foo.weave.local (10.32.0.2) 56(84) bytes of data.
64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=1 ttl=64 time=0.031 ms 64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=1 ttl=64 time=0.031 ms
64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=2 ttl=64 time=0.042 ms 64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=2 ttl=64 time=0.042 ms
+4 -4
View File
@@ -8,16 +8,16 @@ If [automatic IP address allocation](/site/ipam.md) is enabled in Weave Net (by
then containers started via the proxy are automatically assigned an IP address, *without having to specify any then containers started via the proxy are automatically assigned an IP address, *without having to specify any
special environment variables or any other options*. special environment variables or any other options*.
host1$ docker run -ti ubuntu host1$ docker run -ti weaveworks/ubuntu
To use a specific subnet, you can pass a `WEAVE_CIDR` to the container, for example: To use a specific subnet, you can pass a `WEAVE_CIDR` to the container, for example:
host1$ docker run -ti -e WEAVE_CIDR=net:10.32.2.0/24 ubuntu host1$ docker run -ti -e WEAVE_CIDR=net:10.32.2.0/24 weaveworks/ubuntu
To start a container without connecting it to the Weave network, pass To start a container without connecting it to the Weave network, pass
`WEAVE_CIDR=none`, for example: `WEAVE_CIDR=none`, for example:
host1$ docker run -ti -e WEAVE_CIDR=none ubuntu host1$ docker run -ti -e WEAVE_CIDR=none weaveworks/ubuntu
###Disabling Automatic IP Address Allocation ###Disabling Automatic IP Address Allocation
@@ -33,7 +33,7 @@ Containers started with a `WEAVE_CIDR` environment variable are handled as befor
To automatically assign an address in this mode, start the To automatically assign an address in this mode, start the
container with a blank `WEAVE_CIDR`, for example: container with a blank `WEAVE_CIDR`, for example:
host1$ docker run -ti -e WEAVE_CIDR="" ubuntu host1$ docker run -ti -e WEAVE_CIDR="" weaveworks/ubuntu
**See Also** **See Also**
@@ -7,7 +7,7 @@ menu_order: 50
If you don't want to use the proxy, you can also launch If you don't want to use the proxy, you can also launch
containers on to the Weave network using `weave run`: containers on to the Weave network using `weave run`:
$ weave run -ti ubuntu $ weave run -ti weaveworks/ubuntu
The arguments after `run` are passed through to `docker run`. Therefore you The arguments after `run` are passed through to `docker run`. Therefore you
can freely specify whatever Docker options you need. can freely specify whatever Docker options you need.
@@ -17,14 +17,14 @@ this example, it obtains an automatically allocated IP.
You can specify IP addresses manually instead: You can specify IP addresses manually instead:
$ weave run 10.2.1.1/24 -ti ubuntu $ weave run 10.2.1.1/24 -ti weaveworks/ubuntu
`weave run` rewrites `/etc/hosts` in the same way `weave run` rewrites `/etc/hosts` in the same way
[the proxy does](/site/weave-docker-api/name-resolution-proxy.md). If you need to keep [the proxy does](/site/weave-docker-api/name-resolution-proxy.md). If you need to keep
the original file, specify `--no-rewrite-hosts` when running the original file, specify `--no-rewrite-hosts` when running
the container: the container:
$ weave run --no-rewrite-hosts 10.2.1.1/24 -ti ubuntu $ weave run --no-rewrite-hosts 10.2.1.1/24 -ti weaveworks/ubuntu
There are some limitations to starting containers using `weave run`: There are some limitations to starting containers using `weave run`:
+3 -3
View File
@@ -16,17 +16,17 @@ Weave network.
To create and start a container via the Weave Net proxy run: To create and start a container via the Weave Net proxy run:
host1$ docker run -ti ubuntu host1$ docker run -ti weaveworks/ubuntu
or, equivalently run: or, equivalently run:
host1$ docker create -ti --name=foo ubuntu host1$ docker create -ti --name=foo weaveworks/ubuntu
host1$ docker start foo host1$ docker start foo
Specific IP addresses and networks can be supplied in the `WEAVE_CIDR` Specific IP addresses and networks can be supplied in the `WEAVE_CIDR`
environment variable, for example: environment variable, for example:
host1$ docker run -e WEAVE_CIDR=10.2.1.1/24 -ti ubuntu host1$ docker run -e WEAVE_CIDR=10.2.1.1/24 -ti weaveworks/ubuntu
Multiple IP addresses and networks can be supplied in the `WEAVE_CIDR` Multiple IP addresses and networks can be supplied in the `WEAVE_CIDR`
variable by space-separating them, as in variable by space-separating them, as in
+2 -2
View File
@@ -27,8 +27,8 @@ resolution, and will register themselves if they either have a
hostname in the weaveDNS domain (`weave.local` by default) or are given an explicit container name: hostname in the weaveDNS domain (`weave.local` by default) or are given an explicit container name:
``` ```
host1$ docker run -dti --name=pingme ubuntu host1$ docker run -dti --name=pingme weaveworks/ubuntu
host1$ docker run -ti --hostname=ubuntu.weave.local ubuntu host1$ docker run -ti --hostname=ubuntu.weave.local weaveworks/ubuntu
root@ubuntu:/# ping pingme root@ubuntu:/# ping pingme
... ...
``` ```
+1 -1
View File
@@ -15,7 +15,7 @@ some ping tests.
``` ```
host2$ weave launch $HOST1 host2$ weave launch $HOST1
host2$ eval $(weave env) host2$ eval $(weave env)
host2$ docker run -dti --name=pingme ubuntu host2$ docker run -dti --name=pingme weaveworks/ubuntu
root@ubuntu:/# ping -nq -c 1 pingme root@ubuntu:/# ping -nq -c 1 pingme
PING pingme.weave.local (10.32.0.2) 56(84) bytes of data. PING pingme.weave.local (10.32.0.2) 56(84) bytes of data.
+1 -1
View File
@@ -25,7 +25,7 @@ behaviour.
docker run -ti \ docker run -ti \
--dns-search=zone1.weave.local --dns-search=zone2.weave.local \ --dns-search=zone1.weave.local --dns-search=zone2.weave.local \
--dns-search=corp1.com --dns-search=corp2.com \ --dns-search=corp1.com --dns-search=corp2.com \
--dns-search=weave.local ubuntu --dns-search=weave.local weaveworks/ubuntu
``` ```
## <a name="local-domain"></a>Using a different local domain ## <a name="local-domain"></a>Using a different local domain
+1 -1
View File
@@ -20,7 +20,7 @@ If you want to give the container a name in DNS *other* than its
hostname, you can register it using the `dns-add` command. For example: hostname, you can register it using the `dns-add` command. For example:
``` ```
$ C=$(docker run -ti ubuntu) $ C=$(docker run -ti weaveworks/ubuntu)
$ weave dns-add $C -h pingme2.weave.local $ weave dns-add $C -h pingme2.weave.local
``` ```