netbox/Dockerfile

72 lines
1.9 KiB
Docker
Raw Normal View History

2022-01-14 16:07:44 +00:00
FROM harbor.dragse.it/base/alpine:3.15
LABEL maintainer="Lennard Brinkhaus <lennard.brinkhaus@dragse.de>"
RUN echo $'http://nexus.dragse.it/repository/apk-main/\nhttp://nexus.dragse.it/repository/apk-community/' > /etc/apk/repositories
RUN apk --no-cache upgrade \
&& apk --no-cache add ca-certificates wget openssl \
&& update-ca-certificates
# set version label
ARG NETBOX_RELEASE="v3.1.5"
RUN echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
postgresql-client \
py3-pillow \
py3-setuptools \
python3 \
uwsgi \
uwsgi-python
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --upgrade --virtual=build-dependencies \
curl \
cargo \
gcc \
git \
jpeg-dev \
libffi-dev \
libxslt-dev \
libxml2-dev \
musl-dev \
openssl-dev \
postgresql-dev \
python3-dev \
zlib-dev && \
echo "**** install netbox ****" && \
mkdir -p /app/netbox && \
if [ -z ${NETBOX_RELEASE+x} ]; then \
NETBOX_RELEASE=$(curl -sX GET "https://api.github.com/repos/netbox-community/netbox/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/netbox.tar.gz -L \
"https://github.com/netbox-community/netbox/archive/${NETBOX_RELEASE}.tar.gz" && \
tar xf \
/tmp/netbox.tar.gz -C \
/app/netbox/ --strip-components=1 && \
echo "**** install pip packages ****" && \
python3 -m ensurepip && \
rm -rf /usr/lib/python*/ensurepip && \
cd /app/netbox && \
pip3 install --no-cache-dir -U pip wheel && \
pip3 install --no-cache-dir --ignore-installed --find-links https://wheel-index.linuxserver.io/alpine/ -r requirements.txt && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/* \
${HOME}/.cargo \
${HOME}/.cache
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 8000
VOLUME /config