dockerdocker-composedockerfiletidb

Which path should I put config.toml in TiDB docker container?


I'm trying to integrating the official TiDB docker image with our appication for local development. I use docker-compose.yaml. When I run the TiDB docker container, it outputs lots of logs. It annoys me. It seems that the default log level is info according to the doc. I want to set a different log level such as error, fatal to decrease log volume. Then, I think I can use config.toml and put it to somewhere in the container by coping the config file from my local pc to the container. But I'm not sure which path should I put the config.

I searched the config file with find command in the tidb container. But I couldn't find the file.


Solution

  • You can use -config to point out the config file that you want to use. For example,

    version: "3"
    services:
      tidb:
        image: pingcap/tidb:v6.1.0
        volumes:
        - "./tidb-config.toml:/tidb-config.toml"
        ports:
          - 4000:4000
        command: /tidb-server -config /tidb-config.toml
    

    FYI: You can refer to these code blocks as examples.