<p>I have installed influxdb in docker container (Kubernetes) and I have mounted a persistent volume to that container. But influxdb is not writing data to that volume. 
Can anyone please tell me steps, so that influxdb will write data in particular volume. 
Thanks</p>

<p><strong>Short Answer:</strong> </p>

<pre><code>   $ docker run -p 8083:8083 -p 8086:8086 \
          -v $PWD:/var/lib/influxdb \
          influxdb
</code></pre>

<p>Modify $PWD with the path to external volume.</p>

<p><strong>Long answer:</strong></p>

<pre><code>docker run -p 8083:8083 -p 8086:8086 influxdb
</code></pre>

<p>By default this will store the data in /var/lib/influxdb. All InfluxDB data lives in there. To make that a persistent volume (recommended):</p>

<pre><code>$ docker run -p 8083:8083 -p 8086:8086 \
      -v $PWD:/var/lib/influxdb \
      influxdb
</code></pre>

<p>Modify $PWD to the directory where you want to store data associated with the InfluxDB container.</p>

<p>For example,</p>

<pre><code> $ docker run -p 8083:8083 -p 8086:8086 \
              -v /your/home:/var/lib/influxdb \
              influxdb
</code></pre>

<p>This will store the influx data in /your/home on the host.</p>
