Sign inSign up

chai2010/etcd

By chai2010

•Updated over 8 years ago

etcd in docker

Image
0

290

chai2010/etcd repository overview

⁠etcd-v3⁠/confd⁠ docker image

Docker Build Status License

⁠Quick Guide (Docker)

$ docker run --rm -it -p 2379:2379 -p 2380:2380 --name etcd chai2010/etcd

$ curl 127.0.0.1:2379/version
$ curl 127.0.0.1:2379/v2/keys

$ curl http://127.0.0.1:2379/v2/keys/message -XPUT -d value="Hello world"

$ curl 127.0.0.1:2379/v2/keys
$ curl http://127.0.0.1:2379/v2/keys/message

⁠Quick Guide (Cluster/Docker Compose)

# start 3 node, port on :2379/:3379/:4379
$ docker-compose up -d

$ curl 127.0.0.1:2379/version
$ curl 127.0.0.1:2379/v2/keys

$ curl http://127.0.0.1:2379/v2/keys/message -XPUT -d value="Hello world"

$ curl 127.0.0.1:2379/v2/keys
$ curl http://127.0.0.1:2379/v2/keys/message

# get from other etcd node
$ curl 127.0.0.1:3379/v2/keys

⁠Quick Guide (confd/etcd)

# start etcd, 3 nodes
$ docker-compose up -d

# start confd on macOS
# windows: make confd-win
# linux: make confd-linux
$ make confd-macos

# view generated ./conf-data/etc/myapp/myapp.json

# change config value in etcd
$ curl http://127.0.0.1:2379/v2/keys/myapp/database/user -XPUT -d value="new value"

# view generated ./conf-data/etc/myapp/myapp.json

⁠Connect to host from docker container

⁠Run Test

make debug
make test
make clean

⁠License

The Apache License.

Tag summary

Content type

Image

Digest

Size

25 MB

Last updated

over 8 years ago

docker pull chai2010/etcd