Where is the docker data stored?

The InfluxDB2 docs have a “Getting started” for docker - great. However there is ZERO documentation (Even on the other ‘getting started’ editions) as to where data is stored. What volumes do I mount if I want the data to last though a restart?

I’ve guessed that some is in /root/.influxdbv2/ and… beyond that no idea.

Through trial and error I figured out that the docker image does not persist data to disk by default.

I’m using this docker-compose file that persists changes to disk. Check the CLI reference for details.

version: "3.1"
services:
  influxdb:
    container_name: influxdb
    ports:
      - '9999:9999'
    image: 'quay.io/influxdb/influxdb:2.0.0-alpha'
    volumes:
      - influxdb:/var/lib/influxdb2
    command: influxd run --bolt-path /var/lib/influxdb2/influxd.bolt --engine-path /var/lib/influxdb2/engine --store bolt

volumes:
  influxdb: