[consul]

Consul is a service discovery and configuration service. In this post, I will show you how to run your consul service in docker.

Consul service

Server
1
2
3
docker run -d --restart always -p 8300:8300 -p 8301:8301 -p 8301:8301/udp -p 8302:8302/udp \
-p 8302:8302 -p 8400:8400 -p 8500:8500 -p 53:53/udp -h consul-server1 --name=consul-server1 progrium/consul \
-server -bootstrap -ui-dir /ui -advertise server-ip
Agents
1
2
3
docker run -d --restart always -p 8300:8300 -p 8301:8301 -p 8301:8301/udp -p 8302:8302/udp \
-p 8302:8302 -p 8400:8400 -p 8500:8500 -p 53:53/udp -h consul-agent1 --name=consul-agent1 progrium/consul \
-ui-dir /ui -join server-ip -advertise agent-ip

Plaintext on consul

PUT
1
crypt set -backend="consul" -endpoint="server-ip:8500" -plaintext target_path source_file_path
GET
1
crypt get -backend="consul" -endpoint="server-ip:8500" -plaintext target_path