Add dockerfile and a github action to publish docker image
This commit is contained in:
parent
adbca53201
commit
272ff8da17
|
@ -0,0 +1,19 @@
|
||||||
|
name: Publish Docker image
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
jobs:
|
||||||
|
push_to_registry:
|
||||||
|
name: Push Docker image to GitHub Packages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out the repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Push to GitHub Packages
|
||||||
|
uses: docker/build-push-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
registry: ghcr.io
|
||||||
|
repository: camptocamp/cups_exporter
|
||||||
|
tag_with_ref: true
|
|
@ -0,0 +1,17 @@
|
||||||
|
FROM golang:1.13 as builder
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
ADD . /build
|
||||||
|
RUN go build -o cups_exporter main.go
|
||||||
|
|
||||||
|
FROM golang:1.13
|
||||||
|
|
||||||
|
LABEL maintainer="lenny.consuegra@camptocamp.com"
|
||||||
|
|
||||||
|
ENV CUPS_URI "https://localhost:631"
|
||||||
|
|
||||||
|
COPY --from=builder /build/cups_exporter /bin/cups_exporter
|
||||||
|
|
||||||
|
EXPOSE 9329
|
||||||
|
|
||||||
|
CMD [ "/bin/sh", "-c", "/bin/cups_exporter -cups.uri ${CUPS_URI}" ]
|
Loading…
Reference in New Issue