diff --git a/.github/workflows/docker-build-publish.yaml b/.github/workflows/docker-build-publish.yaml new file mode 100644 index 0000000..14a0a58 --- /dev/null +++ b/.github/workflows/docker-build-publish.yaml @@ -0,0 +1,11 @@ +name: Docker Build/Publish Release +on: + push: + branches: + - "build" + workflow_dispatch: {} + +jobs: + build: + uses: sfudeus/workflows/.github/workflows/docker-build-publish-branch.yaml@main + secrets: inherit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b850b3f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +ARG GO_VERSION=1.22 +FROM golang:${GO_VERSION} AS builder + +WORKDIR /build +#ADD . /build + +ENV CGO_ENABLED=0 +#RUN go build -o /build/apcupsd_exporter /build/cmd/apcupsd_exporter/main.go +RUN go get -u github.com/mdlayher/apcupsd_exporter +RUN go build -o /build/apcupsd_exporter $GOPATH/src/github.com/mdlayher/apcupsd_exporter/cmd/apcupsd_exporter/main.go + +FROM scratch +COPY --from=builder /build/apcupsd_exporter /apcupsd_exporter +LABEL maintainer="Stephan Fudeus " + +ENTRYPOINT ["/apcupsd_exporter"] +EXPOSE 9162