You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+28-6Lines changed: 28 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,12 @@ The available version can be found here: https://hub.docker.com/r/dockercloud/ha
17
17
18
18
You can use `dockercloud/haproxy` in three different ways:
19
19
20
-
- running in Docker Cloud
21
-
- running with Docker legacy links
22
-
- running with Docker Compose v2 (new links, compatible with Docker Swarm)
20
+
- running in Docker Cloud (Cloud Mode)
21
+
- running with Docker legacy links (Legacy Mode)
22
+
- running with Docker Compose v2 (Compose Mode, compatible with Docker Swarm)
23
+
- running with Docker SwarmMode (Swarm Mode)
23
24
24
-
### Running in Docker Cloud
25
+
### Running in Docker Cloud (Cloud Mode)
25
26
26
27
1. Launch the service you want to load-balance using Docker Cloud.
27
28
@@ -52,7 +53,28 @@ That's it - the haproxy container will start querying Docker Cloud's API for an
52
53
roles:
53
54
- global
54
55
55
-
### Running with docker legacy links
56
+
### Running with Docker SwarmMode (Swarm Mode)
57
+
58
+
Docker 1.12 supports SwarmMode natively. `dockercloud/haproxy` will auto config itself to load balance all the services running on the same network:
59
+
60
+
1. Create a new network using `docker create` command
61
+
62
+
2. Launch `dockercloud/haproxy` service on that network
63
+
64
+
3. Launch your application services that need to be load balanced on the same network.
65
+
66
+
* If your application services need to access other services(database, for example), you can attach your application services to two different network, one is for database and the other one for the proxy
67
+
* This feature is still experimental, please let us know if you find any bugs or have any suggestions.
docker service create --name app --network proxy dockercloud/hello-world
74
+
docker service scale app=2
75
+
docker service update --env-add VIRTUAL_HOST=web.org app
76
+
77
+
### Running with Docker legacy links (Legacy Mode)
56
78
57
79
Legacy link refers to the link created before docker 1.10, and the link created in default bridge network in docker 1.10 or after.
58
80
@@ -79,7 +101,7 @@ Legacy link refers to the link created before docker 1.10, and the link created
79
101
**Note**: Any link alias sharing the same prefix and followed by "-/_" with an integer is considered to be from the same service. For example: `web-1` and `web-2` belong to service `web`, `app_1` and `app_2` are from service `app`, but `app1` and `web2` are from different services.
80
102
81
103
82
-
### Running with Docker Compose v2(new links)
104
+
### Running with Docker Compose v2 (Compose Mode)
83
105
84
106
Docker Compose 1.6 supports a new format of the compose file. In the new version(v2), the old link that injects environment variables is deprecated.
0 commit comments