运行官方consul docker镜像

问题描述 投票:0回答:3

我正在尝试通过执行以下操作来运行官方 docker 映像

docker pull consul
docker run -d --name=dev-consul -p 8500:8500 consul

当我尝试使用curl访问consul服务器时,我得到一个空回复

   vagrant@docker:~$ curl localhost:8500/v1/catalog/nodes --verbose
* Hostname was NOT found in DNS cache
*   Trying ::1...
* Connected to localhost (::1) port 8500 (#0)
> GET /v1/catalog/nodes HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8500
> Accept: */*
> 
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server

我错过了什么?

curl docker consul
3个回答
11
投票

我开始领事:

docker run  -p 8500:8500 -p 8600:8600/udp --name=consul consul:v0.6.4 agent -server -bootstrap -ui -client=0.0.0.0

1
投票
docker run -d -p 8500:8500 -p 8600:8600/udp --name=my-consul consul agent -server -ui -node=server-1 -bootstrap-expect=1 -client=0.0.0.0

如果此命令不起作用,请将代码替换为此命令。

-client="0.0.0.0"
(双引号内的参数)

docker run -d -p 8500:8500 -p 8600:8600/udp --name=my-consul consul agent -server -ui -node=server-1 -bootstrap-expect=1 -client="0.0.0.0"

0
投票

下载最新的consul docker镜像...只是问题

docker pull hashicorp/consul:latest    # pull the latest image

根据文档https://github.com/hashicorp/consul/issues/17973

# docker pull consul:latest   # <-- BAD its obsolete ... replace with above
© www.soinside.com 2019 - 2024. All rights reserved.