Document using volume mounts with Docker image (#2205)
Document using volume mounts with Docker image Work toward #1947. Re-order phone home and docker shell content. Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>pull/2214/head
parent
28a183f247
commit
5c95d77489
|
@ -315,6 +315,33 @@ docker run --name influxdb -p 8086:8086 quay.io/influxdb/influxdb:v2.0.4
|
|||
```
|
||||
_To run InfluxDB in [detached mode](https://docs.docker.com/engine/reference/run/#detached-vs-foreground), include the `-d` flag in the `docker run` command._
|
||||
|
||||
### Persist data outside the InfluxDB container
|
||||
|
||||
1. Create a new directory to store your data in and navigate into the directory.
|
||||
|
||||
```sh
|
||||
mkdir path/to/influxdb-docker-data-volume && cd $_
|
||||
```
|
||||
2. From within your new directory, run the InfluxDB Docker container with the `--volume` flag to
|
||||
persist data from `/root/.influxdb2/` _inside_ the container to the current working directory in
|
||||
the host file system.
|
||||
|
||||
```sh
|
||||
docker run \
|
||||
--name influxdb \
|
||||
-p 8086:8086 \
|
||||
--volume $PWD:/root/.influxdbv2 \
|
||||
quay.io/influxdb/influxdb:v2.0.4
|
||||
```
|
||||
|
||||
### Console into the InfluxDB container
|
||||
|
||||
To use the `influx` command line interface, console into the `influxdb` Docker container:
|
||||
|
||||
```bash
|
||||
docker exec -it influxdb /bin/bash
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
#### InfluxDB "phone home"
|
||||
|
||||
|
@ -330,14 +357,6 @@ docker run -p 8086:8086 quay.io/influxdb/influxdb:v2.0.4 --reporting-disabled
|
|||
```
|
||||
{{% /note %}}
|
||||
|
||||
### Console into the InfluxDB Container (Optional)
|
||||
|
||||
To use the `influx` command line interface, console into the `influxdb` Docker container:
|
||||
|
||||
```bash
|
||||
docker exec -it influxdb /bin/bash
|
||||
```
|
||||
|
||||
{{% /tab-content %}}
|
||||
<!--------------------------------- END Docker -------------------------------->
|
||||
|
||||
|
@ -453,7 +472,7 @@ If you set up InfluxDB through the UI and want to use the [`influx` CLI](/influx
|
|||
-o example-org \
|
||||
-t mySuP3rS3cr3tT0keN \
|
||||
-a
|
||||
```
|
||||
```
|
||||
This configures a new profile named `default` and makes the profile active so your `influx` CLI commands run against this instance. For more detail, see [influx config](/influxdb/v2.0/reference/cli/influx/config/).
|
||||
|
||||
2. Learn `influx` CLI commands. To see all available `influx` commands, type `influx -h` or check out [influx - InfluxDB command line interface](/influxdb/v2.0/reference/cli/influx/).
|
||||
|
|
Loading…
Reference in New Issue