From 6a9a6dc8e3a4c4d773c031cdab768c6a96c49e9e Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Wed, 13 Dec 2023 15:37:20 -0500 Subject: [PATCH 1/2] update dapr init doc Signed-off-by: Hannah Hunter --- .../content/en/reference/cli/dapr-init.md | 72 +++++++++++++++---- 1 file changed, 59 insertions(+), 13 deletions(-) diff --git a/daprdocs/content/en/reference/cli/dapr-init.md b/daprdocs/content/en/reference/cli/dapr-init.md index bdb93bf5d15..180d78b106b 100644 --- a/daprdocs/content/en/reference/cli/dapr-init.md +++ b/daprdocs/content/en/reference/cli/dapr-init.md @@ -49,31 +49,43 @@ dapr init [flags] ### Examples -#### Self hosted environment +{{< tabs "Self-hosted" "Kubernetes" >}} -Install Dapr by pulling container images for Placement, Redis and Zipkin. By default these images are pulled from Docker Hub. To switch to Dapr Github container registry as the default registry, set the `DAPR_DEFAULT_IMAGE_REGISTRY` environment variable value to be `GHCR`. To switch back to Docker Hub as default registry, unset this environment variable. +{{% codetab %}} + +**Install** + +Install Dapr by pulling container images for Placement, Redis, and Zipkin. By default, these images are pulled from Docker Hub. ```bash dapr init ``` +Dapr can also run [Slim self-hosted mode]({{< ref self-hosted-no-docker.md >}}), without Docker. + +```bash +dapr init -s +``` + +> To switch to Dapr Github container registry as the default registry, set the `DAPR_DEFAULT_IMAGE_REGISTRY` environment variable value to be `GHCR`. To switch back to Docker Hub as default registry, unset this environment variable. + +**Specify a runtime version** + You can also specify a specific runtime version. Be default, the latest version is used. ```bash dapr init --runtime-version 1.4.0 ``` +**Install with image variant** + You can also install Dapr with a particular image variant, for example: [mariner]({{< ref "kubernetes-deploy.md#using-mariner-based-images" >}}). ```bash dapr init --image-variant mariner ``` -Dapr can also run [Slim self-hosted mode]({{< ref self-hosted-no-docker.md >}}) without Docker. - -```bash -dapr init -s -``` +**Use Dapr Installer Bundle** In an offline or airgap environment, you can [download a Dapr Installer Bundle](https://github.com/dapr/installer-bundle/releases) and use this to install Dapr instead of pulling images from the network. @@ -87,17 +99,17 @@ Dapr can also run in slim self-hosted mode without Docker in an airgap environme dapr init -s --from-dir ``` -You can also specify a private registry to pull container images from. These images need to be published to private registries as shown below to enable Dapr CLI to pull them successfully via the `dapr init` command - +**Specify private registry** + +You can also specify a private registry to pull container images from. These images need to be published to private registries as shown below to enable Dapr CLI to pull them successfully via the `dapr init` command: 1. Dapr runtime container image(dapr) (Used to run Placement) - dapr/dapr: 2. Redis container image(rejson) - dapr/3rdparty/rejson 3. Zipkin container image(zipkin) - dapr/3rdparty/zipkin -> All the required images used by Dapr needs to be under the`dapr` path. +All the required images used by Dapr needs to be under the `dapr` path. The 3rd party images have to be published under `dapr/3rdparty` path. -> The 3rd party images have to be published under `dapr/3rdparty` path. - -> image-registry uri follows this format - `docker.io/` +`image-registry` uri follows the `docker.io/` format. ```bash dapr init --image-registry docker.io/username @@ -114,7 +126,37 @@ You can specify a different container runtime while setting up Dapr. If you omit dapr init --container-runtime podman ``` -#### Kubernetes environment +**Use Docker network** + +You can deploy local containers into Docker networks, which is useful for deploying into separate networks or when using Docker Compose for local development to deploy applications. + +Create the Docker network. + +```bash +docker network create mynet +``` + +Initialize Dapr and specify the created Docker network. + +```bash +dapr init --network mynet +``` + +Verify all containers are running in the specified network. + +```bash +docker ps +``` + +Uninstall Dapr from that Docker network. + +```bash +dapr uninstall --all --network mynet +``` + +{{% /codetab %}} + +{{% codetab %}} ```bash dapr init -k @@ -149,3 +191,7 @@ Scenario 2 : dapr image hosted under a new/different directory in private regist ```bash dapr init -k --image-registry docker.io/username/ ``` + +{{% /codetab %}} + +{{< /tabs >}} From e41c5bf014970f055a5e95edf913d34c14728bd3 Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Thu, 14 Dec 2023 10:10:00 -0800 Subject: [PATCH 2/2] Update daprdocs/content/en/reference/cli/dapr-init.md Signed-off-by: Mark Fussell --- daprdocs/content/en/reference/cli/dapr-init.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/cli/dapr-init.md b/daprdocs/content/en/reference/cli/dapr-init.md index 180d78b106b..7cc2d86ad7d 100644 --- a/daprdocs/content/en/reference/cli/dapr-init.md +++ b/daprdocs/content/en/reference/cli/dapr-init.md @@ -74,7 +74,7 @@ dapr init -s You can also specify a specific runtime version. Be default, the latest version is used. ```bash -dapr init --runtime-version 1.4.0 +dapr init --runtime-version 1.13.0 ``` **Install with image variant**