mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2025-08-20 20:35:50 +02:00
Adjust for SUSE containers
Modify container build for use with registry.suse.com/bci/python as $FROM. Signed-off-by: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
This commit is contained in:
70
Dockerfile
70
Dockerfile
@@ -1,32 +1,23 @@
|
|||||||
ARG FROM
|
ARG FROM
|
||||||
FROM ${FROM} AS builder
|
FROM ${FROM} AS builder
|
||||||
|
|
||||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
RUN \
|
||||||
&& apt-get update -qq \
|
zypper -n in \
|
||||||
&& apt-get upgrade \
|
gcc \
|
||||||
--yes -qq --no-install-recommends \
|
openldap2-devel \
|
||||||
&& apt-get install \
|
postgresql-devel \
|
||||||
--yes -qq --no-install-recommends \
|
postgresql-server-devel \
|
||||||
build-essential \
|
cyrus-sasl-devel \
|
||||||
ca-certificates \
|
libopenssl-devel \
|
||||||
libldap-dev \
|
libxml2-devel \
|
||||||
libpq-dev \
|
libxml-security-c-devel \
|
||||||
libsasl2-dev \
|
libxslt-devel \
|
||||||
libssl-dev \
|
|
||||||
libxml2-dev \
|
|
||||||
libxmlsec1 \
|
|
||||||
libxmlsec1-dev \
|
|
||||||
libxmlsec1-openssl \
|
|
||||||
libxslt-dev \
|
|
||||||
pkg-config \
|
|
||||||
python3-dev \
|
|
||||||
python3-pip \
|
|
||||||
python3-venv \
|
|
||||||
&& python3 -m venv /opt/netbox/venv \
|
&& python3 -m venv /opt/netbox/venv \
|
||||||
&& /opt/netbox/venv/bin/python3 -m pip install --upgrade \
|
&& /opt/netbox/venv/bin/python3 -m pip install --upgrade \
|
||||||
pip \
|
pip \
|
||||||
setuptools \
|
setuptools \
|
||||||
wheel
|
wheel \
|
||||||
|
&& zypper -n cc -a && rm -r /var/{cache,log}/*
|
||||||
|
|
||||||
ARG NETBOX_PATH
|
ARG NETBOX_PATH
|
||||||
COPY ${NETBOX_PATH}/requirements.txt requirements-container.txt /
|
COPY ${NETBOX_PATH}/requirements.txt requirements-container.txt /
|
||||||
@@ -48,32 +39,17 @@ RUN \
|
|||||||
ARG FROM
|
ARG FROM
|
||||||
FROM ${FROM} AS main
|
FROM ${FROM} AS main
|
||||||
|
|
||||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
RUN \
|
||||||
&& apt-get update -qq \
|
zypper -n in \
|
||||||
&& apt-get upgrade \
|
|
||||||
--yes -qq --no-install-recommends \
|
|
||||||
&& apt-get install \
|
|
||||||
--yes -qq --no-install-recommends \
|
|
||||||
bzip2 \
|
bzip2 \
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
libldap-common \
|
|
||||||
libpq5 \
|
libpq5 \
|
||||||
libxmlsec1-openssl \
|
libxmlsec1-openssl1 \
|
||||||
openssh-client \
|
openssh-clients \
|
||||||
openssl \
|
catatonit \
|
||||||
python3 \
|
&& zypper -n ar -G -f -p 100 https://packages.nginx.org/unit/fedora/38/x86_64/ nginx-unit \
|
||||||
tini \
|
&& zypper -n in \
|
||||||
&& curl --silent --output /usr/share/keyrings/nginx-keyring.gpg \
|
unit-python311 \
|
||||||
https://unit.nginx.org/keys/nginx-keyring.gpg \
|
&& zypper -n cc -a && rm -r /var/{cache,log}/*
|
||||||
&& echo "deb [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/ubuntu/ noble unit" \
|
|
||||||
> /etc/apt/sources.list.d/unit.list \
|
|
||||||
&& apt-get update -qq \
|
|
||||||
&& apt-get install \
|
|
||||||
--yes -qq --no-install-recommends \
|
|
||||||
unit=1.34.0-1~noble \
|
|
||||||
unit-python3.12=1.34.0-1~noble \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
COPY --from=builder /opt/netbox/venv /opt/netbox/venv
|
COPY --from=builder /opt/netbox/venv /opt/netbox/venv
|
||||||
|
|
||||||
@@ -102,7 +78,7 @@ RUN mkdir -p static /opt/unit/state/ /opt/unit/tmp/ \
|
|||||||
&& SECRET_KEY="dummyKeyWithMinimumLength-------------------------" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
|
&& SECRET_KEY="dummyKeyWithMinimumLength-------------------------" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
|
||||||
|
|
||||||
ENV LANG=C.utf8 PATH=/opt/netbox/venv/bin:$PATH
|
ENV LANG=C.utf8 PATH=/opt/netbox/venv/bin:$PATH
|
||||||
ENTRYPOINT [ "/usr/bin/tini", "--" ]
|
ENTRYPOINT [ "catatonit", "--" ]
|
||||||
|
|
||||||
CMD [ "/opt/netbox/docker-entrypoint.sh", "/opt/netbox/launch-netbox.sh" ]
|
CMD [ "/opt/netbox/docker-entrypoint.sh", "/opt/netbox/launch-netbox.sh" ]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user