You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.2 KiB
32 lines
1.2 KiB
########
|
|
FROM golang:1.14.4-buster as backendbuild
|
|
|
|
WORKDIR /go/src/github.com/analogj/scrutiny
|
|
|
|
COPY . /go/src/github.com/analogj/scrutiny
|
|
|
|
RUN go mod vendor && \
|
|
go build -ldflags '-w -extldflags "-static"' -o scrutiny-collector-selftest collector/cmd/collector-selftest/collector-selftest.go && \
|
|
go build -ldflags '-w -extldflags "-static"' -o scrutiny-collector-metrics collector/cmd/collector-metrics/collector-metrics.go
|
|
|
|
########
|
|
FROM ubuntu:bionic as runtime
|
|
EXPOSE 8080
|
|
WORKDIR /scrutiny
|
|
ENV PATH="/scrutiny/bin:${PATH}"
|
|
|
|
ADD https://github.com/dshearer/jobber/releases/download/v1.4.4/jobber_1.4.4-1_amd64.deb /tmp/
|
|
RUN apt install /tmp/jobber_1.4.4-1_amd64.deb
|
|
|
|
RUN apt-get update && apt-get install -y smartmontools=7.0-0ubuntu1~ubuntu18.04.1
|
|
|
|
COPY /rootfs/scrutiny /scrutiny
|
|
|
|
|
|
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-selftest /scrutiny/bin/
|
|
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-metrics /scrutiny/bin/
|
|
RUN chmod +x /scrutiny/bin/scrutiny-collector-selftest && \
|
|
chmod +x /scrutiny/bin/scrutiny-collector-metrics
|
|
|
|
CMD ["/usr/lib/x86_64-linux-gnu/jobberrunner", "/scrutiny/jobber/jobber.yaml"]
|