nshttpd / mikrotik-exporter

prometheus mikrotik device(s) exporter
BSD 3-Clause "New" or "Revised" License
558 stars 153 forks source link

Without main file system useless. No possible to assemble docker image #149

Open AntexMv opened 2 years ago

AntexMv commented 2 years ago

Somebody forget to add most important file COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder413771057/dist/mikrotik-exporter_linux_amd64: no such file or directory mikrotik-exporter_linux_amd64 Without it system useless. No possible to assemble docker image

aaron2198 commented 2 years ago

You could modify the dockerfile like this in order to build the app in a container.

FROM golang:1.13 AS builder

WORKDIR /usr/src/app

COPY go.mod go.sum ./

RUN go mod download && go mod verify
COPY . .

RUN go build -v -o /usr/local/bin/mikrotik-exporter

FROM debian:9.9-slim

EXPOSE 9436

COPY scripts/start.sh /app/
COPY --from=builder /usr/local/bin/mikrotik-exporter /app/mikrotik-exporter

RUN chmod 755 /app/*

ENTRYPOINT ["/app/start.sh"]