Unable to use "-" character in the names of docker secrets

Hello, if it can be useful I would like to report that the use of “-” character in the names of secrets is not allowed.

For example:

services:

  telegraf:
    container_name: telegraf
    ...
    ...
    secrets:
      - influxdb2-telegraf
    environment:
      - INFLUXDB_ORG=${INFLUXDB_ORG}
      - INFLUXDB_BUCKET=${TELEGRAF_BUCKET}
    restart: unless-stopped

secrets:
  influxdb2-telegraf:
    environment: TELEGRAF_TOKEN

The file /run/secrets/influxdb2-telegraf is created and its content is correct but telegraf fails to authenticate to influxdb2. If the name is changed to influxdb2_telegraf there are no problems.

However, with the image of InfluxDB2 there are no problems, “-” can be used in the names of the secrets.

Hello @andrea86,
Sorry for the delay :confused: could you please file an issue here?

thanks!

@andrea86 that’s correct, you can only use underscores…

1 Like

It’s not a big problem, it can be easily bypassed. I wanted to report it only because maybe it can happen to other people :blush: