Install local plugin in dockerfile

Hey everyone. I have developed a plugin for grafana that works great when I build it locally using yarn install/yarn build. However, what I want to do is make changes to the plugin then have the plugin build when I run the dockerfile. Currently my dockerfile looks like this.

FROM grafana/grafana:8.5.0-ubuntu
USER root
RUN apt-get update -y
RUN apt-get install -y vim ca-certificates openssl
COPY ./grafana/configs/grafana.ini /etc/grafana/
COPY ./grafana/provisioning/datasources/datasource.yml /etc/grafana/provisioning/datasources/
COPY ./grafana/provisioning/ /etc/grafana/provisioning
COPY ./grafana/plugins /var/lib/grafana/plugins
ENV GF_SECURITY_ADMIN_PASSWORD=foobar
ENV GF_SECURITY_ALLOW_EMBEDDING=true
ENV GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS="my_custum_plugin"
ENV GF_INSTALL_PLUGINS="my_custum_plugin"
ENV GF_AUTH_ANONYMOUS_ENABLED=true
ENV GF_AUTH_ANONYMOUS_ORG_NAME="Main Org."
ENV GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
ENV GF_USERS_ALLOW_SIGN_UP=false
ENV GF_AUTH_PROXY_ENABLED=true
ENV GF_AUTH_PROXY_HEADER_NAME=X-WEBAUTH-USER
ENV GF_AUTH_PROXY_HEADER_PROPERTY=username
ENV GF_AUTH_PROXY_AUTO_SIGN_UP=true
ENV GF_AUTH_PROXY_LDAP_SYNC_TTL=60
ENV GF_SECURITY_SAMESITE=none
RENDERER_RENDERING_IGNORE_HTTPS_ERRORS=true
EXPOSE 3000

Using either the alpine or ubuntu grafana image does not seem to allow me to build the plugin in the dockerfile. When I run the above dockerfile I get a…

Error: ✗ Get "https://grafana.com/api/plugins/repo/my_custom_plugin": x509: certificate signed by unknown authority

I shouldn’t need to reach out to grafana for the plugin, it have it in my code and copy it in in the dockerfile. Has anyone been able to build and install the plugin using the official grafana image?

Thanks!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.