Create Dockerfile for python application to read InfluxDB

The query in your code example pretty much looks like a InfluxQL query, which is the old query langage for InfluxDB up to version 1.8.x. Within your Dockerfile, you install the latest InfluxDB version, which is a 2.0+ version that requires Flux queries instead.

If you update your local InfluxDB instance (pip update influxdb), you should experience the same problem. Either make sure to install an older version of InfluxDB within your Dockerfile, or preferably migrate your code to the latest InfluxDB version.

1 Like