diff --git a/content/en/docs/v3.5/install.md b/content/en/docs/v3.5/install.md index 5cc11a50..18f2091f 100644 --- a/content/en/docs/v3.5/install.md +++ b/content/en/docs/v3.5/install.md @@ -124,6 +124,47 @@ The recommended way to install etcd on Linux is either through [pre-built binari ... ``` +## Docker + +etcd uses [`gcr.io/etcd-development/etcd`](https://gcr.io/etcd-development/etcd) as a +primary container registry, and [`quay.io/coreos/etcd`](https://quay.io/coreos/etcd) as +secondary. + +To run etcd using Docker: + +```sh +ETCD_VER={{< param git_version_tag >}} + +rm -rf /tmp/etcd-data.tmp && mkdir -p /tmp/etcd-data.tmp && \ + docker rmi gcr.io/etcd-development/etcd:${ETCD_VER} || true && \ + docker run \ + -p 2379:2379 \ + -p 2380:2380 \ + --mount type=bind,source=/tmp/etcd-data.tmp,destination=/etcd-data \ + --name etcd-gcr-${ETCD_VER} \ + gcr.io/etcd-development/etcd:${ETCD_VER} \ + /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 + +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcd --version +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl version +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdutl version +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl endpoint health +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl put foo bar +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl get foo +``` + ## Installation as part of Kubernetes installation - [Running etcd as a Kubernetes StatefulSet][] diff --git a/content/en/docs/v3.6/install.md b/content/en/docs/v3.6/install.md index 5699a0da..5fa2c9df 100644 --- a/content/en/docs/v3.6/install.md +++ b/content/en/docs/v3.6/install.md @@ -129,6 +129,47 @@ The recommended way to install etcd on Linux is either through [pre-built binari ... ``` +## Docker + +etcd uses [`gcr.io/etcd-development/etcd`](https://gcr.io/etcd-development/etcd) as a +primary container registry, and [`quay.io/coreos/etcd`](https://quay.io/coreos/etcd) as +secondary. + +To run etcd using Docker: + +```sh +ETCD_VER={{< param git_version_tag >}} + +rm -rf /tmp/etcd-data.tmp && mkdir -p /tmp/etcd-data.tmp && \ + docker rmi gcr.io/etcd-development/etcd:${ETCD_VER} || true && \ + docker run \ + -p 2379:2379 \ + -p 2380:2380 \ + --mount type=bind,source=/tmp/etcd-data.tmp,destination=/etcd-data \ + --name etcd-gcr-${ETCD_VER} \ + gcr.io/etcd-development/etcd:${ETCD_VER} \ + /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 + +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcd --version +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl version +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdutl version +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl endpoint health +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl put foo bar +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl get foo +``` + ## Installation as part of Kubernetes installation - [Running etcd as a Kubernetes StatefulSet][] diff --git a/content/en/docs/v3.7/install.md b/content/en/docs/v3.7/install.md index e5b10bcf..936393e2 100644 --- a/content/en/docs/v3.7/install.md +++ b/content/en/docs/v3.7/install.md @@ -124,6 +124,47 @@ The recommended way to install etcd on Linux is either through [pre-built binari ... ``` +## Docker + +etcd uses [`gcr.io/etcd-development/etcd`](https://gcr.io/etcd-development/etcd) as a +primary container registry, and [`quay.io/coreos/etcd`](https://quay.io/coreos/etcd) as +secondary. + +To run etcd using Docker: + +```sh +ETCD_VER={{< param git_version_tag >}} + +rm -rf /tmp/etcd-data.tmp && mkdir -p /tmp/etcd-data.tmp && \ + docker rmi gcr.io/etcd-development/etcd:${ETCD_VER} || true && \ + docker run \ + -p 2379:2379 \ + -p 2380:2380 \ + --mount type=bind,source=/tmp/etcd-data.tmp,destination=/etcd-data \ + --name etcd-gcr-${ETCD_VER} \ + gcr.io/etcd-development/etcd:${ETCD_VER} \ + /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 + +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcd --version +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl version +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdutl version +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl endpoint health +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl put foo bar +docker exec etcd-gcr-${ETCD_VER} /usr/local/bin/etcdctl get foo +``` + ## Installation as part of Kubernetes installation - [Running etcd as a Kubernetes StatefulSet][]