1
1
ARG FROM
2
2
FROM ${FROM} as builder
3
3
4
- RUN apk add --no-cache \
5
- bash \
6
- build-base \
7
- cargo \
4
+ RUN export DEBIAN_FRONTEND=noninteractive \
5
+ && apt-get update -qq \
6
+ && apt-get install --yes -qq \
7
+ build-essential \
8
8
ca-certificates \
9
- cmake \
10
- cyrus-sasl-dev \
11
- git \
12
- graphviz \
13
- jpeg-dev \
14
- libevent-dev \
15
- libffi-dev \
16
- libxslt-dev \
17
- make \
18
- musl-dev \
19
- openldap-dev \
20
- postgresql-dev \
21
- py3-pip \
9
+ libldap-dev \
10
+ libsasl2-dev \
22
11
python3-dev \
23
- && python3 -m venv /opt/netbox/venv \
24
- && /opt/netbox/venv/bin/python3 -m pip install --upgrade \
12
+ python3-pip \
13
+ python3-venv \
14
+ && python3 -m venv /opt/netbox/venv \
15
+ && /opt/netbox/venv/bin/python3 -m pip install --upgrade \
25
16
pip \
26
17
setuptools \
27
18
wheel
28
19
29
- # Build libcrc32c for google-crc32c python module
30
- RUN git clone https://github.com/google/crc32c \
31
- && cd crc32c \
32
- && git submodule update --init --recursive \
33
- && mkdir build \
34
- && cd build \
35
- && cmake \
36
- -DCMAKE_BUILD_TYPE=Release \
37
- -DCRC32C_BUILD_TESTS=no \
38
- -DCRC32C_BUILD_BENCHMARKS=no \
39
- -DBUILD_SHARED_LIBS=yes \
40
- .. \
41
- && make all install
42
-
43
20
ARG NETBOX_PATH
44
21
COPY ${NETBOX_PATH}/requirements.txt requirements-container.txt /
45
22
RUN /opt/netbox/venv/bin/pip install \
@@ -53,35 +30,36 @@ RUN /opt/netbox/venv/bin/pip install \
53
30
ARG FROM
54
31
FROM ${FROM} as main
55
32
56
- RUN apk add --no-cache \
57
- bash \
33
+ RUN export DEBIAN_FRONTEND=noninteractive \
34
+ && apt-get update -qq \
35
+ && apt-get upgrade \
36
+ --yes -qq --no-install-recommends \
37
+ && apt-get install \
38
+ --yes -qq --no-install-recommends \
58
39
ca-certificates \
59
40
curl \
60
- graphviz \
61
- libevent \
62
- libffi \
63
- libjpeg-turbo \
64
- libxslt \
65
41
openssl \
66
- postgresql-client \
67
- postgresql-libs \
68
- py3-pip \
69
42
python3 \
43
+ python3-distutils \
70
44
tini \
71
- unit \
72
- unit-python3
73
-
74
- WORKDIR /opt
45
+ && curl -sL https://nginx.org/keys/nginx_signing.key \
46
+ > /etc/apt/trusted.gpg.d/nginx.asc && \
47
+ echo "deb https://packages.nginx.org/unit/debian/ bullseye unit" \
48
+ > /etc/apt/sources.list.d/unit.list \
49
+ && apt-get update -qq \
50
+ && apt-get install \
51
+ --yes -qq --no-install-recommends \
52
+ unit=1.27.0-1~bullseye \
53
+ unit-python3.9=1.27.0-1~bullseye \
54
+ && rm -rf /var/lib/apt/lists/*
75
55
76
- COPY --from=builder /usr/local/lib/libcrc32c.* /usr/local/lib/
77
- COPY --from=builder /usr/local/include/crc32c /usr/local/include
78
- COPY --from=builder /usr/local/lib/cmake/Crc32c /usr/local/lib/cmake/
79
56
COPY --from=builder /opt/netbox/venv /opt/netbox/venv
80
57
81
58
ARG NETBOX_PATH
82
59
COPY ${NETBOX_PATH} /opt/netbox
83
60
84
61
COPY docker/configuration.docker.py /opt/netbox/netbox/netbox/configuration.py
62
+ COPY docker/ldap_config.docker.py /opt/netbox/netbox/netbox/ldap_config.py
85
63
COPY docker/docker-entrypoint.sh /opt/netbox/docker-entrypoint.sh
86
64
COPY docker/housekeeping.sh /opt/netbox/housekeeping.sh
87
65
COPY docker/launch-netbox.sh /opt/netbox/launch-netbox.sh
@@ -101,14 +79,15 @@ RUN mkdir -p static /opt/unit/state/ /opt/unit/tmp/ \
101
79
--config-file /opt/netbox/mkdocs.yml --site-dir /opt/netbox/netbox/project-static/docs/ \
102
80
&& SECRET_KEY="dummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
103
81
104
- ENTRYPOINT [ "/sbin/tini" , "--" ]
82
+ ENV LANG=C.UTF-8
83
+ ENTRYPOINT [ "/usr/bin/tini" , "--" ]
105
84
106
85
CMD [ "/opt/netbox/docker-entrypoint.sh" , "/opt/netbox/launch-netbox.sh" ]
107
86
108
- LABEL ORIGINAL_TAG ="" \
109
- NETBOX_GIT_BRANCH ="" \
110
- NETBOX_GIT_REF ="" \
111
- NETBOX_GIT_URL ="" \
87
+ LABEL netbox.original-tag ="" \
88
+ netbox.git-branch ="" \
89
+ netbox.git-ref ="" \
90
+ netbox.git-url ="" \
112
91
# See http://label-schema.org/rc1/#build-time-labels
113
92
# Also https://microbadger.com/labels
114
93
org.label-schema.schema-version="1.0" \
@@ -133,16 +112,3 @@ LABEL ORIGINAL_TAG="" \
133
112
org.opencontainers.image.source="https://github.com/netbox-community/netbox-docker.git" \
134
113
org.opencontainers.image.revision="" \
135
114
org.opencontainers.image.version="snapshot"
136
-
137
- # ####
138
- # # LDAP specific configuration
139
- # ####
140
-
141
- FROM main as ldap
142
-
143
- RUN apk add --no-cache \
144
- libsasl \
145
- libldap \
146
- util-linux
147
-
148
- COPY docker/ldap_config.docker.py /opt/netbox/netbox/netbox/ldap_config.py
0 commit comments