diff --git a/content/shared/influxdb3-get-started/setup.md b/content/shared/influxdb3-get-started/setup.md index cdfea5ac2..87f7aa760 100644 --- a/content/shared/influxdb3-get-started/setup.md +++ b/content/shared/influxdb3-get-started/setup.md @@ -457,6 +457,7 @@ In your command, replace {{% code-placeholder-key %}}`YOUR_AUTH_TOKEN`{{% /code- {{% tabs %}} [Environment variable (recommended)](#) [Command option](#) +[Docker](#) {{% /tabs %}} {{% tab-content %}} @@ -479,6 +480,31 @@ influxdb3 show databases --token YOUR_AUTH_TOKEN ``` {{% /code-placeholders %}} +{{% /tab-content %}} +{{% tab-content %}} + +Run the CLI in a Docker container using the `INFLUXDB3_AUTH_TOKEN` environment variable: + +{{% code-placeholders "YOUR_AUTH_TOKEN" %}} +```bash +docker run --rm \ + -e INFLUXDB3_AUTH_TOKEN=YOUR_AUTH_TOKEN \ + quay.io/influxdb/influxdb3:latest \ + query \ + --host http://host.docker.internal:8181 \ + --database example_db \ + "SHOW TABLES" +``` +{{% /code-placeholders %}} + +> [!Note] +> Ensure that the database `example_db` exists in the running container. +> To create it, run: +> +> ```bash +> docker exec -it influxdb3-core influxdb3 create database example_db --token YOUR_AUTH_TOKEN +> ``` + {{% /tab-content %}} {{< /tabs-wrapper >}}