Merge pull request #5669 from sleto-it/install-improvements

Install InfluxDB using Docker Compose - fixes & improvements
pull/5668/head^2
Jason Stirnaman 2024-11-08 12:05:12 -06:00 committed by GitHub
commit 357e0f94b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 13 deletions

View File

@ -54,9 +54,9 @@ Follow steps to set up and run InfluxDB using Docker Compose and `secrets`:
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME_FILE: /run/secrets/influxdb2-admin-username
DOCKER_INFLUXDB_INIT_PASSWORD_FILE: /run/secrets/influxdb2-admin-password
DOCKER_INFLUXDB_INIT_PASSWORD_FILE: /run/secrets/influxdb2-admin-password
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE: /run/secrets/influxdb2-admin-token
DOCKER_INFLUXDB_INIT_ORG: docs
DOCKER_INFLUXDB_INIT_ORG: docs
DOCKER_INFLUXDB_INIT_BUCKET: home
secrets:
- influxdb2-admin-username
@ -114,15 +114,15 @@ Follow steps to set up and run InfluxDB using Docker Compose and `secrets`:
At runtime, the `influxdb` image:
1. Mounts `secrets` files from your host filesystem to `/run/secrets/<SECRET_NAME>`
in the container.
in the container.
2. Assigns the environment variables to the specified files--for example:
```yaml
environment:
DOCKER_INFLUXDB_INIT_USERNAME_FILE: /run/secrets/influxdb2-admin-username
DOCKER_INFLUXDB_INIT_PASSWORD_FILE: /run/secrets/influxdb2-admin-password
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE: /run/secrets/influxdb2-admin-token
```
```yaml
environment:
DOCKER_INFLUXDB_INIT_USERNAME_FILE: /run/secrets/influxdb2-admin-username
DOCKER_INFLUXDB_INIT_PASSWORD_FILE: /run/secrets/influxdb2-admin-password
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE: /run/secrets/influxdb2-admin-token
```
3. Retrieves the secrets from the mounted files and runs setup.
4. Starts InfluxDB.
@ -131,17 +131,21 @@ in the container.
If successful, InfluxDB initializes the user, password, organization, bucket,
and _[Operator token](/influxdb/v2/admin/tokens/#operator-token)_, and then
logs to stdout.
logs to stdout. You can view the InfluxDB UI at <http://localhost:8086>.
_Although Docker prevents inadvertently exposing secrets (for example, in
{{% warn %}}
Although Docker prevents inadvertently exposing secrets (for example, in
`docker inspect` output), a
user that has access to the running container's filesystem can view the secrets._
user that has access to the running container's filesystem can view the secrets.
{{% /warn %}}
### Run InfluxDB CLI commands in a container
After you start a container using the `influxdb` Docker Hub image, you can
[use `docker exec` with the `influx` and `influxd`
CLIs](/influxdb/v2/install/#run-influxdb-cli-commands-in-a-container) inside the
CLIs](/influxdb/v2/install/?t=Docker#run-influxdb-cli-commands-in-a-container) inside the
container.
### Manage files in mounted volumes