etcd is a distributed reliable key-value store for the most critical data of a distributed system, with a focus on being:
- Simple: well-defined, user-facing API (gRPC)
- Secure: automatic TLS with optional client cert authentication
- Fast: benchmarked 10,000 writes/sec
- Reliable: properly distributed using Raft
etcd is written in Go and uses the Raft consensus algorithm to manage a highly-available replicated log.
etcd is used in production by many companies, and the development team stands behind it in critical deployment scenarios, where etcd is frequently teamed with applications such as Kubernetes, locksmith, vulcand, Doorman, and many others. Reliability is further ensured by rigorous testing.
See etcdctl for a simple command line client.
PS: If you are using GitHub Container Registry the path to the docker image should be ghcr.io/zaherg/docker-etcd
.
You can pass any argument to it as normal:
docker run \
-p 2379:2379 \
-p 2380:2380 \
--mount type=bind,source=/tmp/etcd-data.tmp,destination=/etcd-data \
--name etcd \
zaherg/docker-etcd:latest etcd \
--name s1 \
--data-dir /etcd-data \
--listen-client-urls http://0.0.0.0:2379 \
--advertise-client-urls http://0.0.0.0:2379 \
--listen-peer-urls http://0.0.0.0:2380 \
--initial-advertise-peer-urls http://0.0.0.0:2380 \
--initial-cluster s1=http://0.0.0.0:2380 \
--initial-cluster-token tkn \
--initial-cluster-state new
docker exec etcd sh -c "etcd --version"
docker exec etcd sh -c "ETCDCTL_API=3 etcdctl version"
docker exec etcd sh -c "ETCDCTL_API=3 etcdctl endpoint health"
docker exec etcd sh -c "ETCDCTL_API=3 etcdctl put foo bar"
docker exec etcd sh -c "ETCDCTL_API=3 etcdctl get foo"
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.