Fix whitespace and remove DEBIAN_FRONTEND env var

This commit is contained in:
Daniel Nelson 2019-10-15 12:10:45 -07:00
parent c8d727a047
commit 4a710d2b2c
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 6 additions and 3 deletions

View File

@ -210,23 +210,25 @@ Refer to the docker [plugin documentation](https://github.com/influxdata/telegra
### Install Additional Packages ### Install Additional Packages
Some plugins require additional packages to be installed. For example, the `ntpq` plugin requires `ntpq` command. It is recommended to create a custom derivative image to install any needed commands. Some plugins require additional packages to be installed. For example, the `ntpq` plugin requires `ntpq` command. It is recommended to create a custom derivative image to install any needed commands.
As an example this Dockerfile add the `mtr-tiny` image to the stock image and save it as `telegraf-mtr.docker`: As an example this Dockerfile add the `mtr-tiny` image to the stock image and save it as `telegraf-mtr.docker`:
```dockerfile ```dockerfile
FROM telegraf:1.12.3 FROM telegraf:1.12.3
RUN DEBIAN_FRONTEND=noninteractive \ RUN apt-get update && apt-get install -y --no-install-recommends mtr-tiny && \
apt-get update && apt-get install -y --no-install-recommends mtr-tiny && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
``` ```
Build the derivative image: Build the derivative image:
```console ```console
$ docker build -t telegraf-mtr:1.12.3 - < telegraf-mtr.docker $ docker build -t telegraf-mtr:1.12.3 - < telegraf-mtr.docker
``` ```
Create a `telegraf.conf` configuration file: Create a `telegraf.conf` configuration file:
```toml ```toml
[[inputs.exec]] [[inputs.exec]]
interval = "60s" interval = "60s"
@ -243,6 +245,7 @@ Create a `telegraf.conf` configuration file:
``` ```
Run your derivative image: Run your derivative image:
```console ```console
$ docker run --name telegraf --rm -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf telegraf-mtr:1.12.3 $ docker run --name telegraf --rm -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf telegraf-mtr:1.12.3
``` ```