0

I am using consul docker to save my key/value pair, this is the command I am using to start docker:

 docker run -d --name=dev-consul -e CONSUL_BIND_INTERFACE=eth0  
-p 8500:8500 
-v /Users/user1/projects/consul/consul_volumn/data:/consul/data  consul

But after I killed the docker instance and re-run this command, all the previously saved data in consul are gone.

I checked the doc and saw the volumn exposed is /consul/data, that is why I am mounting my local file system to the docker instance. But why data is still now persisted here?

Hope to hear your advice.

user3006967
  • 3,291
  • 10
  • 47
  • 72

1 Answers1

0

Had the same issue. Fixed by adding this command:

agent -server -ui -bind 0.0.0.0 -client 0.0.0.0 -bootstrap -bootstrap-expect 1

Try running:

docker run -d --name=dev-consul -e CONSUL_BIND_INTERFACE=eth0 -p 8500:8500 -v /Users/user1/projects/consul/consul_volumn/data:/consul/data consul agent -server -ui -bind 0.0.0.0 -client 0.0.0.0 -bootstrap -bootstrap-expect 1
Ohad Lahav
  • 290
  • 3
  • 7