Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions src/grafana/build/grafana.common.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,36 @@
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FROM node:20 AS build

ARG TARGETOS
ARG TARGETARCH

ENV GOVERSION=1.25.7
ENV PLUGINVERSION=v3.7.0

ENV GOPATH=/usr/local/go
ENV GOBIN=$GOPATH/bin
ENV PATH=$GOBIN:$PATH

RUN wget https://go.dev/dl/go${GOVERSION}.linux-${TARGETARCH}.tar.gz && \
tar -C /usr/local -xzf go${GOVERSION}.linux-${TARGETARCH}.tar.gz

WORKDIR /usr/src/plugin

RUN git clone --branch ${PLUGINVERSION} --depth 1 https://github.com/grafana/grafana-infinity-datasource.git /usr/src/plugin

RUN go install github.com/magefile/mage@latest

RUN yarn && yarn build

RUN if [ "$TARGETARCH" = "amd64" ]; then \
mage build:linux; \
elif [ "$TARGETARCH" = "arm64" ]; then \
mage build:linuxARM64; \
else \
echo "Unsupported architecture: $TARGETARCH" && exit 1; \
fi

FROM ubuntu:22.04

Expand All @@ -40,9 +69,7 @@ RUN \

RUN apt-get update && apt-get upgrade -y

RUN grafana-cli plugins install yesoreyeram-infinity-datasource && ls /var/lib/grafana/plugins
RUN mkdir ${GF_PLUGIN_DIR}
RUN mv /var/lib/grafana/plugins/yesoreyeram-infinity-datasource /grafana-plugins
COPY --from=build /usr/src/plugin/dist ${GF_PLUGIN_DIR}/yesoreyeram-infinity-datasource

COPY src/run-grafana.sh /usr/local/bin

Expand Down