# In Windows we can't set the data directory (--mount type=bind,source=//d/ProgramData/etcd-data.tmp,destination=/etcd-data) because etcd checks folder permissions (700 versus 777), see https://github.com/etcd-io/etcd/blob/release-3.4/pkg/fileutil/fileutil.godocker run -p 2379:2379 -p 2380:2380 --name etcd-gcr-v3.4.12 gcr.io/etcd-development/etcd:v3.4.12 /usr/local/bin/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 --log-level info --logger zap --log-outputs stderr
dockerexecetcd-gcr-v3.4.12/bin/sh-c"/usr/local/bin/etcd --version"dockerexecetcd-gcr-v3.4.12/bin/sh-c"/usr/local/bin/etcdctl version"dockerexecetcd-gcr-v3.4.12/bin/sh-c"/usr/local/bin/etcdctl endpoint health"dockerexecetcd-gcr-v3.4.12/bin/sh-c"/usr/local/bin/etcdctl put foo bar"dockerexecetcd-gcr-v3.4.12/bin/sh-c"/usr/local/bin/etcdctl get foo"dockerexecetcd-gcr-v3.4.12/bin/sh-c"/usr/local/bin/etcdctl del foo"dockerstopetcd-gcr-v3.4.12dockerrmetcd-gcr-v3.4.12
# for WindowsSETETCDCTL_API=3# see https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/etcdctlsnapshotsaveetcd_snapshot.dbetcdctl--write-out=tablesnapshotstatusetcd_snapshot.db# see https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/recovery.md#restoring-a-clusteretcdctlsnapshotrestoreetcd_snapshot.db--namem1--initial-clusterm1=http://0.0.0.0:2380--initial-cluster-tokenetcd-cluster-1--initial-advertise-peer-urlshttp://0.0.0.0:2380# will create m1.etcd folderetcd--namem1--data-dirm1.etcd--listen-client-urlshttp://0.0.0.0:2379--advertise-client-urlshttp://0.0.0.0:2379--listen-peer-urlshttp://0.0.0.0:2380