mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Docker: Support pre-installing plugins from other sources in custom Dockerfiles (#31234)
Update custom Dockerfiles to support pre-installing plugins from other sources. Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
@@ -37,9 +37,15 @@ ARG GF_INSTALL_PLUGINS=""
|
||||
|
||||
RUN if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then \
|
||||
OLDIFS=$IFS; \
|
||||
IFS=','; \
|
||||
IFS=','; \
|
||||
for plugin in ${GF_INSTALL_PLUGINS}; do \
|
||||
IFS=$OLDIFS; \
|
||||
grafana-cli --pluginsDir "$GF_PATHS_PLUGINS" plugins install ${plugin}; \
|
||||
done; \
|
||||
if expr match "$plugin" '.*\;.*'; then \
|
||||
pluginUrl=$(echo "$plugin" | cut -d';' -f 1); \
|
||||
pluginWithoutUrl=$(echo "$plugin" | cut -d';' -f 2); \
|
||||
grafana-cli --pluginUrl "${pluginUrl}" --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${pluginWithoutUrl}; \
|
||||
else \
|
||||
grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
@@ -41,9 +41,15 @@ ARG GF_INSTALL_PLUGINS=""
|
||||
|
||||
RUN if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then \
|
||||
OLDIFS=$IFS; \
|
||||
IFS=','; \
|
||||
IFS=','; \
|
||||
for plugin in ${GF_INSTALL_PLUGINS}; do \
|
||||
IFS=$OLDIFS; \
|
||||
grafana-cli --pluginsDir "$GF_PATHS_PLUGINS" plugins install ${plugin}; \
|
||||
done; \
|
||||
if expr match "$plugin" '.*\;.*'; then \
|
||||
pluginUrl=$(echo "$plugin" | cut -d';' -f 1); \
|
||||
pluginWithoutUrl=$(echo "$plugin" | cut -d';' -f 2); \
|
||||
grafana-cli --pluginUrl "${pluginUrl}" --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${pluginWithoutUrl}; \
|
||||
else \
|
||||
grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user