gliderlabs / gliderlabs/docker-consul

Consul container immediately shuts down

Open
#130 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1.1k
Forks
270
PR merge metrics
No merged PRs in 30d

Description

```
$ docker run -d --name=consul --net=host gliderlabs/consul-server -bootstrap
```

This command succeeds.

```
$ docker start consul
```

This command succeeds.

Except.. when you look at the following:

```
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3b90dca86b21 gliderlabs/registrator:latest "/bin/registrator co 54 minutes ago Exited (1) 41 minutes ago registrator
7b6248dcd560 gliderlabs/consul-server:latest "/bin/consul agent - 56 minutes ago Exited (1) 2 minutes ago consul
```

This is what I get from the docker logs:

```
$ docker logs consul
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
==> Starting Consul agent...
==> Error starting agent: Failed to get advertise address: Multiple private IPs found. Please configure one.
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
==> Starting Consul agent...
==> Error starting agent: Failed to get advertise address: Multiple private IPs found. Please configure one.
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
==> Starting Consul agent...
==> Error starting agent: Failed to get advertise address: Multiple private IPs found. Please configure one.
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
==> Starting Consul agent...
==> Error starting agent: Failed to get advertise address: Multiple private IPs found. Please configure one.
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
==> Starting Consul agent...
==> Error starting agent: Failed to get advertise address: Multiple private IPs found. Please configure one.
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
==> Starting Consul agent...
==> Error starting agent: Failed to get advertise address: Multiple private IPs found. Please configure one.
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
==> Starting Consul agent...
==> Error starting agent: Failed to get advertise address: Multiple private IPs found. Please configure one.
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
==> Starting Consul agent...
==> Error starting agent: Failed to get advertise address: Multiple private IPs found. Please configure one.
```

Registrator also shuts down immeditely since it can't forma connection to the consul container.

I think this is related to https://github.com/hashicorp/consul/issues/725.

What I did was install Consul directly on the Ubuntu 14.04 box, and faced the same error.

Referred to the above mentioned issue on consul, these two commands work (although just running the server cannot elect a leader :).

```
$ consul agent -server -bind=:: -advertise=2001:db8::1 -data-dir=/tmp/what
$ consul agent -dev -bind=:: -advertise=2001:db8::1
```

I am new to docker/consul but I am pretty sure https://github.com/gliderlabs/docker-consul/blob/master/0.6/consul-server/Dockerfile#L3 is not something we want to muck with to add `-bind` etc to. Might be wrong though.

Update:
Sidenote, I have just gone through your personal and organization github accounts. Thanks for all the contributions to the community!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.