Skip to content

Commit

Permalink
build(container): rebase to centos9-stream (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Jan 8, 2025
1 parent e0fce3e commit bbdba5e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 18 deletions.
65 changes: 47 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,55 @@
FROM docker.io/grafana/grafana:10.4.3

EXPOSE 3000

RUN grafana cli plugins install yesoreyeram-infinity-datasource

COPY --chown=grafana:root \
dashboards.yaml \
dashboards/*.dashboard.json \
/etc/grafana/provisioning/dashboards/

COPY --chown=grafana:root \
FROM quay.io/centos/centos:stream9-minimal
ARG UID=101
ARG PORT=3000

WORKDIR /usr/share/grafana
ENV VERSION=10
ENV GF_PATHS_HOME=/usr/share/grafana
ENV HOME=/usr/share/grafana
ENV GF_PATHS_PROVISIONING=/etc/grafana/provisioning
ENV GF_PATHS_DATA=/var/lib/grafana
ENV GF_PATHS_LOGS=/var/log/grafana
ENV GF_PATHS_PLUGINS=/var/lib/grafana/plugins
ENV GF_PATHS_CONFIG=/etc/grafana/grafana.ini

LABEL name="cryostat/cryostat-grafana-dashboard" \
version="${VERSION}" \
usage="podman run -d --name grafana -p ${PORT}:${PORT} -v grafana-data:${GF_PATHS_DATA} quay.io/cryostat/cryostat-grafana-dashboard" \
maintainer="Cryostat Maintainers <[email protected]>" \
io.k8s.display-name="Grafana" \
io.openshift.expose-services="3000:grafana" \
io.openshift.tags="grafana,monitoring,dashboard"

RUN useradd -u ${UID} -g 0 -r -d $GF_PATHS_HOME -s /sbin/nologin grafana && \
microdnf upgrade -y && \
microdnf install -y --setopt=tsflags=nodocs grafana && \
microdnf clean all && \
chgrp -R 0 /etc/grafana /var/lib/grafana /var/log/grafana && \
chmod -R g=u /var/lib/grafana /var/log/grafana && \
/usr/sbin/grafana cli plugins install yesoreyeram-infinity-datasource

COPY --chown=grafana:grafana \
dashboards.yaml \
dashboards/*.dashboard.json \
${GF_PATHS_PROVISIONING}/dashboards/

COPY --chown=grafana:grafana \
datasource.yaml \
/etc/grafana/provisioning/datasources/
${GF_PATHS_PROVISIONING}/datasources/

COPY --chown=grafana:root \
COPY --chown=grafana:grafana \
grafana.ini \
/etc/grafana/grafana.ini
${GF_PATHS_CONFIG}

COPY --chown=grafana:grafana \
entrypoint.bash \
/usr/bin/run-grafana

# Listen address of jfr-datasource
ENV JFR_DATASOURCE_URL "http://0.0.0.0:8080"

# User grafana
USER 472
USER ${UID}

EXPOSE ${PORT}

ENTRYPOINT [ "/run.sh" ]
ENTRYPOINT [ "/usr/bin/run-grafana" ]
12 changes: 12 additions & 0 deletions entrypoint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

exec /usr/sbin/grafana-server \
--homepath="$GF_PATHS_HOME" \
--config="$GF_PATHS_CONFIG" \
--packaging=docker \
"$@" \
cfg:default.log.mode="console" \
cfg:default.paths.data="$GF_PATHS_DATA" \
cfg:default.paths.logs="$GF_PATHS_LOGS" \
cfg:default.paths.plugins="$GF_PATHS_PLUGINS" \
cfg:default.paths.provisioning="$GF_PATHS_PROVISIONING"

0 comments on commit bbdba5e

Please sign in to comment.