isim/consul
Docker image for Consul.
A set of default start-up configurations are found in the config/base_config.json
file:
/tmp/data
.INFO
.docker pull isim/consul
docker run -P --rm isim/consul agent -server -bootstrap-expect 1 -node agent01 -config-dir /opt/consul/config
docker run --rm -P isim/consul agent -node agent-02 --config-dir /opt/consul/config
To test kv store:
curl -X PUT -d "myvalue" $DOCKER_HOST_IP:$MAPPED_PORT/v1/kv/mykey
curl $DOCKER_HOST_IP:$MAPPED_PORT/v1/kv/mykey
curl -X DELETE $DOCKER_HOST_IP:$MAPPED_PORT/v1/kv/mykey
where:
$DOCKER_HOST_IP
is the IP address of $DOCKER_HOST
as specified by docker-machine env
.MAPPED_PORT
is the host port that is mapped to the container's port 8500 as seen in docker ps
.To test the agent DNS API: dig @$DOCKER_HOST_IP -p $MAPPED_PORT agent-02.node.consul
where:
$DOCKER_HOST_IP
is the IP address of $DOCKER_HOST
as specified by docker-machine env
.MAPPED_PORT
is the host port that is mapped to the container's port 8500 as seen in docker ps
.To test cluster membership:
docker inspect $AGENT1_CONTAINER_ID | grep IPAddress
docker exec $AGENT2_CONTAINER_ID consul join $AGENT1_IP_ADDRESS
docker exec $AGENT2_CONTAINTER_ID consul members
You should see something like:
Node Address Status Type Build Protocol DC
agent-01 172.17.0.1:8301 alive server 0.5.2 2 dc1
agent-02 172.17.0.3:8301 alive client 0.5.2 2 dc1
Add instructions and configurations for:
docker pull isim/consul