free / prometheus

The Prometheus monitoring system and time series database.
https://prometheus.io/
Apache License 2.0
48 stars 5 forks source link

Publish x-Prometheus Docker images #6

Open sandersaares opened 5 years ago

sandersaares commented 5 years ago

My workflow uses Prometheus as Docker images. It seems to me that the fork does not currently have published images. I request them to be published (or readme updated to point to existing ones that exist).

sylr commented 5 years ago

I have generated one for myself:

quay.io/sylr/prometheus:v2.9.2_sylr.2 based on https://github.com/sylr/prometheus/releases/tag/v2.9.2%2Bsylr.2

Use it at your own risks ;)

bmerry commented 4 years ago

I would also love to have published Docker images. It seems that upstream Prometheus makes this more difficult than it should be though, because the Dockerfile doesn't actually build Prometheus: it just constructs a image from a build done on the host (and hence won't work out of the box with the automated builders provided by quay.io or Docker hub).

I've put the following Dockerfile together which builds an xrate image by starting from the upstream Docker image and injecting the published xrate prometheus binary (it doesn't bother with promtool - I don't know if xrate affects it). Use at your own risk:

# For some reason ARGs need to be repeated multiple times (maybe
# global and image scope?)
ARG VERSION=2.12.0

FROM alpine:3.10 as build
WORKDIR /
RUN apk add tar wget
ARG VERSION=2.12.0
ARG OS=linux
ARG ARCH=amd64
RUN wget --dot=mega https://github.com/free/prometheus/releases/download/${VERSION}-xrate/prometheus-${VERSION}.${OS}-${ARCH}.tar.gz
RUN tar -zxf prometheus-${VERSION}.${OS}-${ARCH}.tar.gz

FROM prom/prometheus:v${VERSION}
ARG VERSION=2.12.0
ARG OS=linux
ARG ARCH=amd64
COPY --from=build /prometheus-${VERSION}.${OS}-${ARCH}/prometheus /bin/prometheus
bmerry commented 4 years ago

I've published this as quay.io/ska-sa/xrate (and updated it to also copy the xrate version of promtool, in case that matters).