docs(core, enterprise): add token auth + Docker examples

jm-monolith-gs-restructure
meelahme 2025-06-20 11:08:15 -07:00
parent 7caa21164d
commit b03af149e2
1 changed files with 26 additions and 0 deletions

View File

@ -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 >}}