This is my docker compose
# docker-compose.yml
version: '2'
services:
consul:
image: consul:0.7.1
command: agent -server -bootstrap-expect=1 -ui
volumes:
- ./consul-data/:/consul/data
ports:
- "8400:8400"
- "8500:8500"
- "8600:53/udp"
expose:
- "8300"
- "8301"
- "8301/udp"
- "8302"
- "8302/udp"
- "8500"
whoami1:
image: emilevauge/whoami
ports:
- 80
Next:
$ docker-compose up
Recreating testconsul_consul_1
Starting testconsul_whoami1_1
Attaching to testconsul_whoami1_1, testconsul_consul_1
whoami1_1 | Starting up on port 80
consul_1 | ==> WARNING: BootstrapExpect Mode is specified as 1; this is the same as Bootstrap mode.
consul_1 | ==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
consul_1 | ==> Starting Consul agent...
consul_1 | ==> Starting Consul agent RPC...
consul_1 | ==> Consul agent running!
consul_1 | Version: 'v0.7.1'
consul_1 | Node name: '34f293021531'
consul_1 | Datacenter: 'dc1'
consul_1 | Server: true (bootstrap: true)
consul_1 | Client Addr: 127.0.0.1 (HTTP: 8500, HTTPS: -1, DNS: 8600, RPC: 8400)
consul_1 | Cluster Addr: 172.19.0.3 (LAN: 8301, WAN: 8302)
consul_1 | Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false
consul_1 | Atlas: <disabled>
consul_1 |
consul_1 | ==> Log data will now stream in as it occurs:
consul_1 |
consul_1 | 2016/11/30 05:56:34 [INFO] raft: Initial configuration (index=1): [{Suffrage:Voter ID:172.19.0.3:8300 Address:172.19.0.3:8300}]
consul_1 | 2016/11/30 05:56:34 [INFO] raft: Node at 172.19.0.3:8300 [Follower] entering Follower state (Leader: "")
consul_1 | 2016/11/30 05:56:34 [INFO] serf: EventMemberJoin: 34f293021531 172.19.0.3
consul_1 | 2016/11/30 05:56:34 [INFO] consul: Adding LAN server 34f293021531 (Addr: tcp/172.19.0.3:8300) (DC: dc1)
consul_1 | 2016/11/30 05:56:34 [INFO] serf: EventMemberJoin: 34f293021531.dc1 172.19.0.3
consul_1 | 2016/11/30 05:56:34 [INFO] consul: Adding WAN server 34f293021531.dc1 (Addr: tcp/172.19.0.3:8300) (DC: dc1)
consul_1 | 2016/11/30 07:50:34 [ERR] agent: failed to sync remote state: No cluster leader
consul_1 | 2016/11/30 07:50:39 [WARN] raft: Heartbeat timeout from "" reached, starting election
consul_1 | 2016/11/30 07:50:39 [INFO] raft: Node at 172.19.0.3:8300 [Candidate] entering Candidate state in term 2
consul_1 | 2016/11/30 07:50:39 [INFO] raft: Election won. Tally: 1
consul_1 | 2016/11/30 07:50:39 [INFO] raft: Node at 172.19.0.3:8300 [Leader] entering Leader state
consul_1 | 2016/11/30 07:50:39 [INFO] consul: cluster leadership acquired
consul_1 | 2016/11/30 07:50:39 [INFO] consul: New leader elected: 34f293021531
consul_1 | 2016/11/30 07:50:39 [INFO] consul: member '34f293021531' joined, marking health alive
consul_1 | 2016/11/30 07:50:41 [INFO] agent: Synced service 'consul'
I have no access to ui:
When I use this docker-compose.yml, without command:
# docker-compose.yml
version: '2'
services:
consul:
image: consul:0.7.1
volumes:
- ./consul-data/:/consul/data
ports:
- "8400:8400"
- "8500:8500"
- "8600:53/udp"
expose:
- "8300"
- "8301"
- "8301/udp"
- "8302"
- "8302/udp"
- "8500"
whoami1:
image: emilevauge/whoami
ports:
- 80
Here, I have access to Consul UI:
$ curl http://127.0.0.1:8500/ui/ -I
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 29230
Content-Type: text/html; charset=utf-8
Last-Modified: Wed, 30 Nov 2016 08:12:44 GMT
Date: Wed, 30 Nov 2016 08:14:37 GMT
Where is my mistake in the first docker compose? What argument to use to get UI?
Best regards,
Stéphane