pv2b / netbox-plugin-mclag

NetBox Plugin to manage MC-LAG (Multi-Chassis Link Aggregation Groups)
MIT License
12 stars 4 forks source link

Publish to PyPi #6

Open clint-hotaisle opened 3 weeks ago

clint-hotaisle commented 3 weeks ago

Would you consider publishing this package to PyPi to make it easier for users to install in docker?

The supported instructions for installing plugins using netbox-docker can only pull plugins from PyPi.

https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins

clint-hotaisle commented 3 weeks ago

Documenting a workaround for anyone else trying to install this plugin in docker. In the top of your Dockerfile-Plugins you need to install git: RUN apt-get -y update && apt-get -y install git

Then in plugin_requirements.txt you can add git+https://github.com/pv2b/netbox-plugin-mclag.git.

nickper commented 3 weeks ago

I managed to install it with the following Dockerfile-Plugin content and the normal guide from netbox themself.


SHELL ["/bin/bash", "-c"]

COPY ./plugin_requirements.txt /opt/netbox/
RUN apt update && apt install git -y
RUN git clone https://github.com/pv2b/netbox-plugin-mclag.git /opt/netbox/netbox-plugin-mclag
RUN source /opt/netbox/venv/bin/activate
RUN python3 /opt/netbox/netbox-plugin-mclag/setup.py install
RUN /opt/netbox/venv/bin/pip install  --no-warn-script-location -e /opt/netbox/netbox-plugin-mclag
# RUN /opt/netbox/venv/bin/pip install  --no-warn-script-location -r /opt/netbox/plugin_requirements.txt 
RUN python3 /opt/netbox/netbox/generate_secret_key.py # not realy sure if this is necessary

# These lines are only required if your plugin has its own static files.
COPY configuration/configuration.py /etc/netbox/config/configuration.py
COPY configuration/plugins.py /etc/netbox/config/plugins.py```