mirror of
https://github.com/linuxserver/docker-netbox.git
synced 2026-02-12 22:50:01 +08:00
Merge pull request #44 from linuxserver/s6v3-netbox
This commit is contained in:
commit
4fc2c99a8f
@ -1,4 +1,4 @@
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.15
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.16
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
@ -10,7 +10,6 @@ LABEL maintainer="alex-phillips"
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --upgrade --virtual=build-dependencies \
|
||||
curl \
|
||||
cargo \
|
||||
gcc \
|
||||
git \
|
||||
@ -48,7 +47,7 @@ RUN \
|
||||
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-3.15/ -r requirements.txt && \
|
||||
pip3 install --no-cache-dir --ignore-installed --find-links https://wheel-index.linuxserver.io/alpine-3.16/ -r requirements.txt && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.15
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.16
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
@ -10,7 +10,6 @@ LABEL maintainer="alex-phillips"
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --upgrade --virtual=build-dependencies \
|
||||
curl \
|
||||
cargo \
|
||||
gcc \
|
||||
git \
|
||||
@ -48,7 +47,7 @@ RUN \
|
||||
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-3.15/ -r requirements.txt && \
|
||||
pip3 install --no-cache-dir --ignore-installed --find-links https://wheel-index.linuxserver.io/alpine-3.16/ -r requirements.txt && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.15
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.16
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
@ -10,7 +10,6 @@ LABEL maintainer="alex-phillips"
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --upgrade --virtual=build-dependencies \
|
||||
curl \
|
||||
cargo \
|
||||
gcc \
|
||||
git \
|
||||
@ -48,7 +47,7 @@ RUN \
|
||||
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-3.15/ -r requirements.txt && \
|
||||
pip3 install --no-cache-dir --ignore-installed --find-links https://wheel-index.linuxserver.io/alpine-3.16/ -r requirements.txt && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
|
||||
@ -283,6 +283,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
|
||||
|
||||
## Versions
|
||||
|
||||
* **02.11.22:** - Rebase to Alpine 3.16, migrate to s6v3.
|
||||
* **01.08.22:** - Remove py3-pillow, add tiff to fix deps.
|
||||
* **26.07.22:** - Add py3-pillow package back on arm to fix build issue.
|
||||
* **10.12.21:** - Remove py3-pillow package to fix dependency issue with 3.2.0.
|
||||
|
||||
@ -59,6 +59,7 @@ app_setup_block: |
|
||||
|
||||
# changelog
|
||||
changelogs:
|
||||
- { date: "02.11.22:", desc: "Rebase to Alpine 3.16, migrate to s6v3." }
|
||||
- { date: "01.08.22:", desc: "Remove py3-pillow, add tiff to fix deps." }
|
||||
- { date: "26.07.22:", desc: "Add py3-pillow package back on arm to fix build issue." }
|
||||
- { date: "10.12.21:", desc: "Remove py3-pillow package to fix dependency issue with 3.2.0." }
|
||||
|
||||
26
root/etc/cont-init.d/50-config → root/etc/s6-overlay/s6-rc.d/init-netbox-config/run
Normal file → Executable file
26
root/etc/cont-init.d/50-config → root/etc/s6-overlay/s6-rc.d/init-netbox-config/run
Normal file → Executable file
@ -22,20 +22,22 @@ NETBOX_CONF[REMOTE_AUTH_AUTO_CREATE_USER]=${REMOTE_AUTH_AUTO_CREATE_USER:-False}
|
||||
NETBOX_CONF[REMOTE_AUTH_DEFAULT_GROUPS]=${REMOTE_AUTH_DEFAULT_GROUPS:-[]}
|
||||
NETBOX_CONF[REMOTE_AUTH_DEFAULT_PERMISSIONS]=${REMOTE_AUTH_DEFAULT_PERMISSIONS:-{}}
|
||||
|
||||
cd /app/netbox/netbox/netbox
|
||||
cd /app/netbox/netbox/netbox || exit 1
|
||||
|
||||
NETBOX_CONF[SECRET_KEY]=${SECRET_KEY:-$(python3 ../generate_secret_key.py)}
|
||||
|
||||
if [ ! -f "/config/configuration.py" ]; then
|
||||
cp /defaults/configuration.py /config/configuration.py
|
||||
if [[ ! -f "/config/configuration.py" ]]; then
|
||||
cp /defaults/configuration.py /config/configuration.py
|
||||
|
||||
# sed in values or skip if value not set
|
||||
for KEY in "${!NETBOX_CONF[@]}"; do \
|
||||
sed -i 's|{{'$KEY'}}|'${NETBOX_CONF[$KEY]}'|g' /config/configuration.py
|
||||
done
|
||||
# sed in values or skip if value not set
|
||||
for KEY in "${!NETBOX_CONF[@]}"; do \
|
||||
sed -i 's|{{'$KEY'}}|'${NETBOX_CONF[$KEY]}'|g' /config/configuration.py
|
||||
done
|
||||
fi
|
||||
|
||||
[[ ! -e "/config/media" ]] && \
|
||||
mv /app/netbox/netbox/media /config/media
|
||||
if [[ ! -e "/config/media" ]]; then
|
||||
mv /app/netbox/netbox/media /config/media
|
||||
fi
|
||||
|
||||
rm -rf /app/netbox/netbox/media
|
||||
ln -sf /config/media /app/netbox/netbox/media
|
||||
@ -46,14 +48,14 @@ mv /defaults/uwsgi.ini /app/netbox/netbox/uwsgi.ini > /dev/null 2>&1
|
||||
|
||||
# permissions
|
||||
chown -R abc:abc \
|
||||
/app/netbox \
|
||||
/config
|
||||
/app/netbox \
|
||||
/config
|
||||
|
||||
cd /app/netbox || exit
|
||||
|
||||
s6-setuidgid abc /usr/bin/python3 netbox/manage.py migrate
|
||||
|
||||
if [ -n "$SUPERUSER_EMAIL" ] && [ -n "$SUPERUSER_PASSWORD" ];
|
||||
if [[ -n "$SUPERUSER_EMAIL" ]] && [[ -n "$SUPERUSER_PASSWORD" ]];
|
||||
then
|
||||
cat << EOF | s6-setuidgid abc python3 /app/netbox/netbox/manage.py shell
|
||||
from django.contrib.auth.models import User;
|
||||
1
root/etc/s6-overlay/s6-rc.d/init-netbox-config/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/init-netbox-config/type
Normal file
@ -0,0 +1 @@
|
||||
oneshot
|
||||
1
root/etc/s6-overlay/s6-rc.d/init-netbox-config/up
Normal file
1
root/etc/s6-overlay/s6-rc.d/init-netbox-config/up
Normal file
@ -0,0 +1 @@
|
||||
/etc/s6-overlay/s6-rc.d/init-netbox-config/run
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-netbox/notification-fd
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-netbox/notification-fd
Normal file
@ -0,0 +1 @@
|
||||
3
|
||||
5
root/etc/s6-overlay/s6-rc.d/svc-netbox/run
Executable file
5
root/etc/s6-overlay/s6-rc.d/svc-netbox/run
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
exec \
|
||||
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8000" \
|
||||
cd /app/netbox/netbox s6-setuidgid abc /usr/sbin/uwsgi uwsgi.ini
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-netbox/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-netbox/type
Normal file
@ -0,0 +1 @@
|
||||
longrun
|
||||
@ -1,6 +0,0 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
cd /app/netbox/netbox || exit
|
||||
|
||||
exec \
|
||||
s6-setuidgid abc /usr/sbin/uwsgi uwsgi.ini
|
||||
Loading…
x
Reference in New Issue
Block a user