Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to get the Plugins Custom image to work #178

Open
viperbmw opened this issue Mar 21, 2024 · 1 comment
Open

Not able to get the Plugins Custom image to work #178

viperbmw opened this issue Mar 21, 2024 · 1 comment

Comments

@viperbmw
Copy link

          > @manusys64 One way how you can install the plugins is to create custom Netbox Docker image.

Example of Dockerfile config :

FROM netboxcommunity/netbox:v3.5.1

RUN 
    echo "netbox-plugin-dns" >> requirements.txt && \
    echo "netbox-plugin-dns" >> local_requirements.txt 

RUN . /opt/netbox/venv/bin/activate && \
    pip install netbox-plugin-dns 

RUN echo "PLUGINS = [ 'netbox_dns'']" >> /opt/netbox/netbox/netbox/configuration.py

Add reference to the custom Dockerfile in Helm chart :

netbox:
  commonValue:
  image:
    repository: YOUR_REPOSITORY
    tag: "IMAGE_TAG"

Do not add 'netbox_dns' into plugins section of Helm chart, keep it empty, do it in Dockerfile

I have tried to use this Dockerfile to build a custom image.

FROM netboxcommunity/netbox:latest
RUN echo "netbox-secrets" >> requirements.txt && \
    echo "netbox-secrets" >> local_requirements.txt \
    echo "netbox-topology-views" >> requirements.txt && \
    echo "netbox-topology-views" >> local_requirements.txt \
    echo "netbox-bgp" >> requirements.txt && \
    echo "netbox-bgp" >> local_requirements.txt
RUN . /opt/netbox/venv/bin/activate && pip install netbox-secrets netbox-topology-views netbox-bgp
RUN mkdir -p /opt/netbox/netbox/static/netbox_topology_views/img
SHELL ["/bin/bash", "-c"]
RUN echo $'\n\
PLUGINS = ["netbox_secrets", "netbox_bgp","netbox_topology_views"]\n\
PLUGINS_CONFIG = {\n\
    \'netbox_topology_views\': {\n\
        \'static_image_directory\': \'netbox_topology_views/img\',\n\
        \'allow_coordinates_saving\': True,\n\
        \'always_save_coordinates\': True\n\
    }\n\
}' >> /opt/netbox/netbox/netbox/configuration.py
RUN SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input

When I try to use the custom image in the Helm Chart I get

/opt/netbox/docker-entrypoint.sh: line 20: ./manage.py: No such file or directory
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (18s / 30s)

What am I doing wrong?

When using the image in docker compose it works.........

Originally posted by @viperbmw in #173 (comment)

@viperbmw viperbmw changed the title > @manusys64 One way how you can install the plugins is to create custom Netbox Docker image. Not able to get the Plugins Custom image to work Mar 21, 2024
@elmazzun
Copy link

In the next weeks I'll start developing a custom image: if I can make it work, I am going to share here what I found :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants