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/consuldocker run -P --rm isim/consul agent -server -bootstrap-expect 1 -node agent01 -config-dir /opt/consul/configdocker run --rm -P isim/consul agent -node agent-02 --config-dir /opt/consul/configTo test kv store:
curl -X PUT -d "myvalue" $DOCKER_HOST_IP:$MAPPED_PORT/v1/kv/mykeycurl $DOCKER_HOST_IP:$MAPPED_PORT/v1/kv/mykeycurl -X DELETE $DOCKER_HOST_IP:$MAPPED_PORT/v1/kv/mykeywhere:
$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 IPAddressdocker exec $AGENT2_CONTAINER_ID consul join $AGENT1_IP_ADDRESSdocker exec $AGENT2_CONTAINTER_ID consul membersYou 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:
Content type
Image
Digest
sha256:164e88686…
Size
76.1 MB
Last updated
almost 11 years ago
docker pull isim/consul