Added Dockerfile (#5)
This commit is contained in:
parent
14cdb8f33e
commit
bca1dc5c86
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
# build stage
|
||||
FROM golang:1.12.6-stretch AS build-env
|
||||
ADD . /src
|
||||
ENV CGO_ENABLED=0
|
||||
WORKDIR /src
|
||||
RUN go build -o dnsmasq_exporter
|
||||
|
||||
# final stage
|
||||
FROM scratch
|
||||
WORKDIR /app
|
||||
COPY --from=build-env /src/dnsmasq_exporter /app/
|
||||
ENTRYPOINT ["/app/dnsmasq_exporter"]
|
@ -31,6 +31,12 @@ systemctl daemon-reload
|
||||
systemctl enable --now dnsmasq_exporter
|
||||
```
|
||||
|
||||
### Alternative usage
|
||||
```shell
|
||||
docker build -t dnsmasq_exporter .
|
||||
docker run --restart=unless-stopped --net=host dnsmasq_exporter
|
||||
```
|
||||
|
||||
Then, add the endpoint to your Prometheus configuration file:
|
||||
|
||||
```yaml
|
||||
|
Loading…
x
Reference in New Issue
Block a user