-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (28 loc) · 1.43 KB
/
Dockerfile
File metadata and controls
30 lines (28 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# syntax = docker/dockerfile:1@sha256:4a43a54dd1fedceb30ba47e76cfcf2b47304f4161c0caeac2db1c61804ea3c91
# requires DOCKER_BUILDKIT=1 set when running docker build
# checkov:skip=CKV_DOCKER_2: no healthcheck (yet)
# checkov:skip=CKV_DOCKER_3: we don't want to drift away from upstream. so we keep it as it is
# checkov:skip=CKV_DOCKER_7: yes, latest is okay here
# hadolint ignore=DL3007
FROM netboxcommunity/netbox:v4.4.10@sha256:14c2de3f179d8ed5b5722a76b6d7389c8c95bb8be46c600f3d7fe1f7698b4574
COPY ./plugin_requirements.txt /opt/netbox/
# Update base image
RUN apt-get -q update; apt-get -qy upgrade && \
# Install needed packages
apt-get install \
--yes -qq --no-install-recommends \
git=* && \
# Cleanup
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
# Install plugins
/usr/local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt && \
# Activate plugins
cat /etc/netbox/config/plugins.py && \
echo 'PLUGINS = ["netbox_qrcode","netbox_topology_views","netbox_inventory","netbox_floorplan","netbox_documents","netbox_lifecycle","netbox_otp_plugin","netbox_change2log"]' >> /etc/netbox/config/plugins.py && \
# Install static files from our plugins
DEBUG="true" SECRET_KEY="dummyKeyWithMinimumLength-------------------------" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input && \
# Cleanup
apt-get purge \
--yes -qq \
git && \
apt-get -y -qq autoremove