make upstream repo configurable
This commit is contained in:
parent
6db0a7e992
commit
cf605f3d29
@ -1,2 +1,3 @@
|
|||||||
PROMETHEUS_CONFIG_FILE_PATH=/path/to/prometheus/config/prometheus.yaml
|
PROMETHEUS_CONFIG_FILE_PATH=/path/to/prometheus/config/prometheus.yaml
|
||||||
PROMETHEUS_DATA_PATH=/path/to/prometheus/data
|
PROMETHEUS_DATA_PATH=/path/to/prometheus/data
|
||||||
|
PROMETHEUS_REPO='https://github.com/prometheus/prometheus.git'
|
||||||
|
@ -3,7 +3,7 @@ ARG GO_VERSION=alpine
|
|||||||
FROM golang:${GO_VERSION} as build
|
FROM golang:${GO_VERSION} as build
|
||||||
|
|
||||||
ARG PROMETHEUS_VERSION=
|
ARG PROMETHEUS_VERSION=
|
||||||
ARG PROMETHEUS_REPO="https://github.com/prometheus/prometheus.git"
|
ARG PROMETHEUS_REPO
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apk update --no-cache &&\
|
apk update --no-cache &&\
|
||||||
@ -15,6 +15,7 @@ RUN \
|
|||||||
yarn && \
|
yarn && \
|
||||||
git config --global advice.detachedHead false
|
git config --global advice.detachedHead false
|
||||||
RUN \
|
RUN \
|
||||||
|
echo "selected repo: ${PROMETHEUS_REPO}" && \
|
||||||
if [ -z "${PROMETHEUS_VERSION}" ]; then \
|
if [ -z "${PROMETHEUS_VERSION}" ]; then \
|
||||||
PROMETHEUS_VERSION=$( \
|
PROMETHEUS_VERSION=$( \
|
||||||
git ls-remote "${PROMETHEUS_REPO}" | \
|
git ls-remote "${PROMETHEUS_REPO}" | \
|
||||||
@ -26,7 +27,8 @@ RUN \
|
|||||||
git clone \
|
git clone \
|
||||||
--branch="${PROMETHEUS_VERSION}" \
|
--branch="${PROMETHEUS_VERSION}" \
|
||||||
--depth=1 \
|
--depth=1 \
|
||||||
"${PROMETHEUS_REPO}" && \
|
"${PROMETHEUS_REPO}" \
|
||||||
|
prometheus && \
|
||||||
cd prometheus && \
|
cd prometheus && \
|
||||||
CGO_ENABLED=0 make build
|
CGO_ENABLED=0 make build
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@ services:
|
|||||||
prometheus:
|
prometheus:
|
||||||
build:
|
build:
|
||||||
context: ./
|
context: ./
|
||||||
|
args:
|
||||||
|
- PROMETHEUS_REPO=${PROMETHEUS_REPO}
|
||||||
container_name: prometheus
|
container_name: prometheus
|
||||||
image: prometheus:local
|
image: prometheus:local
|
||||||
logging:
|
logging:
|
||||||
|
Loading…
Reference in New Issue
Block a user