prometheus icon indicating copy to clipboard operation
prometheus copied to clipboard

Publish x-Prometheus Docker images

Open sandersaares opened this issue 7 years ago • 3 comments

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).

sandersaares avatar Dec 04 '18 22:12 sandersaares

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 ;)

sylr avatar May 10 '19 13:05 sylr

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 avatar Dec 02 '19 14:12 bmerry

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).

bmerry avatar Dec 03 '19 07:12 bmerry