# Netbox Plugin customize image

**URL:** <https://forums.docker.com/t/netbox-plugin-customize-image/151708>\
**Category:** General\
**Tags:** docker, docker-compose\
**Created:** [May 17, 2026, 8:52am UTC](https://forums.docker.com/t/netbox-plugin-customize-image/151708 "2026-05-17T08:52:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![berndlehnert](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/berndlehnert/32/64568_2.png) [@berndlehnert](https://forums.docker.com/u/berndlehnert)\
**Post date:** [May 17, 2026, 8:52am UTC](https://forums.docker.com/t/netbox-plugin-customize-image/151708/1 "2026-05-17T08:52:49Z")

</div>

Hello all,

I am trying to create a customize docker image with plugins for Metbox. There are several documentations. At least I am following  
[Using Netbox Plugins · netbox-community/netbox-docker Wiki](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins)

What I get typing “docker compose build --no-cache” is:

```auto
root@net-netboxtest:/opt/netbox/netbox-docker# docker compose build --no-cache
[+] Building 0.5s (8/12)
=> [internal] load local bake definitions 0.0s
=> => reading from stdin 547B 0.0s
=> [internal] load build definition from Dockerfile-Plugins 0.0s
=> => transferring dockerfile: 1.18kB 0.0s
=> [internal] load metadata for docker.io/netboxcommunity/netbox:latest 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 234B 0.0s
=> CACHED [1/7] FROM docker.io/netboxcommunity/netbox:latest 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 172B 0.0s
=> [2/7] COPY ./plugin_requirements.txt /opt/netbox/ 0.1s
=> ERROR [3/7] RUN /root/.local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt 0.3s
------
> [3/7] RUN /root/.local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt:
0.243 /bin/sh: 1: /root/.local/bin/uv: not found
------
[+] build 0/1
⠙ Image netbox:latest-plugins Building 0.6s
Dockerfile-Plugins:11

--------------------

  9 | #COPY /opt/netbox/netbox-docker/plugin_requirements.txt /opt/netbox/

 10 |

 11 | >>> RUN /root/.local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt

 12 |

 13 |

--------------------

failed to solve: process "/bin/sh -c /root/.local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt" did not complete successfully: exit code: 127

root@muesrv01-nbtest:/opt/netbox/netbox-docker# ls /opt/netbox/
devicetype-library netbox-docker
root@muesrv01-nbtest:/opt/netbox/netbox-docker# => CACHED [1/7] FROM docker.io/netboxcommunity/netbox:latest 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 172B 0.0s
=> [2/7] COPY ./plugin_requirements.txt /opt/netbox/ 0.1s
=> ERROR [3/7] RUN /root/.local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt 0.3s
------
> [3/7] RUN /root/.local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt:
0.243 /bin/sh: 1: /root/.local/bin/uv: not found
------
[+] build 0/1
⠙ Image netbox:latest-plugins Building 0.6s
Dockerfile-Plugins:11

--------------------

9 | #COPY /opt/netbox/netbox-docker/plugin_requirements.txt /opt/netbox/

10 |

11 | >>> RUN /root/.local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt

12 |

13 |

--------------------

failed to solve: process "/bin/sh -c /root/.local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt" did not complete successfully: exit code: 127

```

What I see is that the line

```auto
[2/7] COPY ./plugin_requirements.txt /opt/netbox/

```

does not copy the .txt file to its locatin. Coping the file on the console with cp works. So the syyntax should be fine. Also the command producing the following error is fine

```auto
=> ERROR [3/7] RUN /root/.local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt

```

uv can be found in that directory. Also copying the .txt file to that location before running docker compose does not change something.

Any hint to solve would be cool  
Thanks

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [May 17, 2026, 11:16am UTC](https://forums.docker.com/t/netbox-plugin-customize-image/151708/2 "2026-05-17T11:16:47Z")

</div>

Without seeing your Dockerfile, we can only assume how `/root/.local/bin/uv` is made available in the image. Either it must exist in the base image you use, or you install it within your Dockerfile, or you copy it from a file within you build context into a container (which is not recommended!).

Note: A build can not access files outside the build context.

---

<div class="post-metadata">

**Author:** ![berndlehnert](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/berndlehnert/32/64568_2.png) [@berndlehnert](https://forums.docker.com/u/berndlehnert)\
**Post date:** [May 17, 2026, 3:03pm UTC](https://forums.docker.com/t/netbox-plugin-customize-image/151708/3 "2026-05-17T15:03:16Z")

</div>

I think that is the answer. The docker file looks like

```auto
FROM netboxcommunity/netbox:latest

# Switch to root to install packages and create directories 
USER root

COPY ./plugin_requirements.txt /opt/netbox/
RUN /usr/local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt

# Create required directory for Topology Views images 
RUN mkdir -p /opt/netbox/netbox/static/netbox_topology_views/img && 
 chown -R unit:root /opt/netbox/netbox/static/netbox_topology_views 

# 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

# RUN DEBUG="true" SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
# Collect static files 
# SECRET_KEY must be 50+ characters! 
RUN SECRET_KEY="dummyKeyWithMinimumLength-------------------------" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input

# Switch back to unit user 
USER unittype or paste code here

```

I didn’t made uv available. That wasn’t mentioned in the documentation…

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [May 17, 2026, 5:41pm UTC](https://forums.docker.com/t/netbox-plugin-customize-image/151708/4 "2026-05-17T17:41:53Z")

</div>

I am glad it’s sorted out now.

Some observations:

> [@berndlehnert](#):
>
> ```auto
> > [3/7] RUN /root/.local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt:
> 0.243 /bin/sh: 1: /root/.local/bin/uv: not found
> 
> ```

The Dockerfile you shared is not the same that created the output you shared in your first post.

It uses a different path for the `uv` binary. The shared Dockerfile uses the correct path, which btw. matches the path shown in the example in the wiki.

> [@berndlehnert](#):
>
> ```auto
> USER root
> 
> ```

The first USER instruction is not required, as the base image already uses the root user. Though, the explicit USER instruction might prevent breakage in the future, in case it should change in the base image at one point.

> [@berndlehnert](#):
>
> ```auto
> chown -R unit:root /opt/netbox/netbox/static/netbox_topology_views 
> 
> ```

The user `unit` does not exist in the image .

> [@berndlehnert](#):
>
> ```auto
> RUN SECRET_KEY="dummyKeyWithMinimumLength-------------------------" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
> 
> ```

Looks like something that doesn’t belong into the image, but should be rather configured when creating a container based on the image.

> [@berndlehnert](#):
>
> ```auto
> USER unittype or paste code here
> 
> ```

Again: no unit or unittype user available in the image.

---

<div class="post-metadata">

**Author:** ![berndlehnert](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/berndlehnert/32/64568_2.png) [@berndlehnert](https://forums.docker.com/u/berndlehnert)\
**Post date:** [May 21, 2026, 8:22am UTC](https://forums.docker.com/t/netbox-plugin-customize-image/151708/5 "2026-05-21T08:22:50Z")

</div>

There was an old image bound to docker. After removing it I don’t see this error anymore. The image was more than a year ago. Ihad forgotten that it exists.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/docker/original/3X/d/4/d4fbccd46c81bfcffe9822e20e17736d946fa821.png) [@system](https://forums.docker.com/u/system)\
**Post date:** [June 20, 2026, 8:23am UTC](https://forums.docker.com/t/netbox-plugin-customize-image/151708/6 "2026-06-20T08:23:46Z")

</div>

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