etcd
- pull 镜像
docker pull bitnami/etcd
- 创建网络
docker network create app-tier --driver bridge
- 运行容器
docker run -d --name etcd-server --network app-tier --publish 2379:2379 --publish 2380:2380 --env ALLOW_NONE_AUTHENTICATION=yes --env ETCD_ADVERTISE_CLIENT_URLS=http://etcd-server:2379 bitnami/etcd:latest
安装etcd-keeper
docker pull evildecay/etcdkeeper
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' etcd-server
docker run -d -p 8080:8080 -e ETCD_SERVERS=http://172.18.0.2:2379 --network=app-tier --name etcd-keeper evildecay/etcdkeeper
访问网页
根据你自己的etcd-server运行
127.0.0.1:8080
命令读写
etcd-server: 是容器服务
docker exec etcd-server etcdctl put mykey "Hello etcd"
docker exec etcd-server etcdctl get mykey
参考文档
https://blog.csdn.net/weixin_43495948/article/details/131132712