Skip to content
Permalink
Browse files

Added docker image

  • Loading branch information...
eko committed May 26, 2019
1 parent 69f5ce1 commit c87fd560c5a3a7efdf772d6ec88da3428f8e9faa
Showing with 35 additions and 1 deletion.
  1. +1 −1 .gitignore
  2. +19 −0 Dockerfile
  3. +15 −0 README.md
@@ -1,4 +1,4 @@
search-api
vendor
bin
tmp
.vscode
@@ -0,0 +1,19 @@
FROM golang:alpine as builder

WORKDIR /go/src/github.com/eko/pihole-exporter
COPY . .

RUN apk update && \
apk --no-cache add git alpine-sdk

RUN GO111MODULE=on go mod vendor
RUN GOOS=linux go build -o binary ./

FROM alpine

LABEL name="pihole-exporter"

WORKDIR /root/
COPY --from=builder /go/src/github.com/eko/pihole-exporter/binary pihole-exporter

CMD ["./pihole-exporter"]
@@ -34,6 +34,15 @@ You can download the latest version of the binary built for your architecture he
[Linux](https://github.com/eko/pihole-exporter/releases/latest/download/pihole_exporter-linux-arm)
]

### Using Docker

The exporter is also available as a [Docker image](https://hub.docker.com/r/ekofr/pihole-exporter).
You can run it using the following example and pass configuration environment variables:

```
$ docker run -e 'PIHOLE_HOSTNAME=192.168.1.2' ekofr/pihole-exporter:latest
```

### From sources

Optionally, you can download and build it from the sources. You have to retrieve the project sources by using one of the following way:
@@ -43,6 +52,12 @@ $ go get -u github.com/eko/pihole-exporter
$ git clone https://github.com/eko/pihole-exporter.git
```

Install the needed vendors:

```
$ GO111MODULE=on go mod vendor
```

Then, build the binary (here, an example to run on Raspberry PI ARM architecture):
```bash
$ GOOS=linux GOARCH=arm GOARM=7 go build -o pihole_exporter .

0 comments on commit c87fd56

Please sign in to comment.
You can’t perform that action at this time.