Skip to content

Commit b03e61d

Browse files
Rakshitha-KamathRakshitha-Kamath
authored andcommitted
grafana-7.1: Add a separate dockerfile for SPS
Signed-off-by: Rakshitha-Kamath <[email protected]>
1 parent 9b74c65 commit b03e61d

File tree

2 files changed

+83
-1
lines changed

2 files changed

+83
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ENTRYPOINT [ "/run.sh" ]
6868
# Build specific labels
6969
LABEL maintainer="Nizamudeen A <[email protected]>"
7070
LABEL com.redhat.component="grafana-container"
71-
LABEL version=11.5.2
71+
LABEL version=11.6.2
7272
LABEL name="grafana"
7373
LABEL description="Red Hat Ceph Storage Grafana container"
7474
LABEL summary="Grafana container on RHEL 9 for Red Hat Ceph Storage"

Dockerfile_IBM

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Build stage 1
2+
ARG BASE_IMAGE=registry.redhat.io/ubi9/go-toolset:latest
3+
4+
FROM --platform=$BUILDPLATFORM ${BASE_IMAGE} AS builder
5+
ARG REMOTE_SOURCE_DIR
6+
7+
# Grafana tends to use the fodlers from the root directory.
8+
USER root
9+
10+
COPY grafana $REMOTE_SOURCE_DIR/grafana
11+
12+
WORKDIR $REMOTE_SOURCE_DIR/grafana
13+
14+
ENV GOFLAGS="-mod=vendor"
15+
16+
RUN go run -mod vendor build.go -dev build
17+
18+
# Build stage 2
19+
FROM --platform=$BUILDPLATFORM registry.redhat.io/ubi9-minimal:latest
20+
ARG REMOTE_SOURCE_DIR
21+
22+
# Update the image to get the latest CVE updates
23+
RUN microdnf update -y
24+
25+
ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
26+
GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \
27+
GF_PATHS_DATA="/var/lib/grafana" \
28+
GF_PATHS_HOME="/usr/share/grafana" \
29+
GF_PATHS_LOGS="/var/log/grafana" \
30+
GF_PATHS_PLUGINS="/usr/share/grafana/plugins" \
31+
GF_PATHS_PROVISIONING="/etc/grafana/provisioning"
32+
33+
RUN rm -rf $GF_PATHS_HOME && mkdir -p $GF_PATHS_HOME
34+
COPY --from=builder $REMOTE_SOURCE_DIR/grafana/pkg/cmd/grafana /usr/bin/grafana
35+
COPY --from=builder $REMOTE_SOURCE_DIR/grafana/pkg/cmd/grafana-server /usr/bin/grafana-server
36+
COPY --from=builder $REMOTE_SOURCE_DIR/grafana/pkg/cmd/grafana-cli /usr/bin/grafana-cli
37+
COPY --from=builder $REMOTE_SOURCE_DIR/grafana/conf $GF_PATHS_HOME/conf/
38+
COPY --from=builder $REMOTE_SOURCE_DIR/grafana/docs $GF_PATHS_HOME/docs/
39+
COPY --from=builder $REMOTE_SOURCE_DIR/grafana/public $GF_PATHS_HOME/public/
40+
COPY --from=builder $REMOTE_SOURCE_DIR/grafana/scripts $GF_PATHS_HOME/scripts/
41+
42+
RUN rm -rf /etc/grafana && mkdir -p /etc/grafana
43+
COPY --from=builder $REMOTE_SOURCE_DIR/grafana/conf/sample.ini $GF_PATHS_CONFIG
44+
COPY --from=builder $REMOTE_SOURCE_DIR/grafana/conf/ldap.toml /etc/grafana/ldap.toml
45+
COPY ./run.sh /run.sh
46+
47+
# Create grafana user/group
48+
RUN groupadd -r -g 472 grafana
49+
RUN useradd -r -u 472 -g grafana -d /etc/grafana -s /sbin/nologin -c "Grafana Dashboard" grafana
50+
51+
# Unpack plugins and update permissions
52+
RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
53+
mkdir -p "$GF_PATHS_PROVISIONING/datasources" \
54+
"$GF_PATHS_PROVISIONING/dashboards" \
55+
"$GF_PATHS_PROVISIONING/notifiers" \
56+
"$GF_PATHS_PROVISIONING/plugins" \
57+
"$GF_PATHS_PROVISIONING/access-control" \
58+
"$GF_PATHS_PROVISIONING/alerting" \
59+
"$GF_PATHS_LOGS" \
60+
"$GF_PATHS_PLUGINS" \
61+
"$GF_PATHS_DATA" && \
62+
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
63+
chmod -R 775 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" /run.sh
64+
65+
EXPOSE 3000
66+
67+
USER grafana
68+
WORKDIR /
69+
ENTRYPOINT [ "/run.sh" ]
70+
71+
# Build specific labels
72+
LABEL maintainer="Nizamudeen A <[email protected]>"
73+
LABEL com.redhat.component="grafana-container"
74+
LABEL version=11.6.2
75+
LABEL name="grafana"
76+
LABEL description="Red Hat Ceph Storage Grafana container"
77+
LABEL summary="Grafana container on RHEL 9 for Red Hat Ceph Storage"
78+
LABEL io.k8s.display-name="Grafana on RHEL 9"
79+
LABEL io.k8s.description="grafana-container"
80+
LABEL io.openshift.tags="rhceph ceph dashboard grafana"
81+
LABEL cpe=cpe:/a:redhat:ceph_storage:9::el9
82+
LABEL org.opencontainers.image.created="${BUILD_DATE}"

0 commit comments

Comments
 (0)