mirror of
https://github.com/linuxserver/docker-ldap-auth.git
synced 2026-02-20 01:01:02 +08:00
commit
ad8faaa7ff
22
Dockerfile
22
Dockerfile
@ -1,4 +1,6 @@
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.15
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.17
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
@ -19,24 +21,24 @@ RUN \
|
||||
apk add --no-cache \
|
||||
libffi \
|
||||
libldap \
|
||||
py3-pip \
|
||||
python3 && \
|
||||
if [ -z ${LDAP_VERSION+x} ]; then \
|
||||
LDAP_INSTALL="python-ldap"; \
|
||||
else \
|
||||
LDAP_INSTALL="python-ldap==${LDAP_VERSION}"; \
|
||||
LDAP_VERSION=$(curl -sL https://pypi.python.org/pypi/python-ldap/json |jq -r '. | .info.version'); \
|
||||
fi && \
|
||||
pip3 install -U --no-cache-dir pip setuptools wheel && \
|
||||
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.15/ \
|
||||
python3 -m ensurepip && \
|
||||
pip3 install -U --no-cache-dir \
|
||||
pip \
|
||||
wheel && \
|
||||
pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ \
|
||||
cryptography \
|
||||
${LDAP_INSTALL} && \
|
||||
python-ldap=="${LDAP_VERSION}" && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/root/.cache \
|
||||
/root/.cargo
|
||||
$HOME/.cache \
|
||||
$HOME/.cargo
|
||||
|
||||
# copy local files
|
||||
COPY root/ /
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.15
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.17
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
@ -19,24 +21,24 @@ RUN \
|
||||
apk add --no-cache \
|
||||
libffi \
|
||||
libldap \
|
||||
py3-pip \
|
||||
python3 && \
|
||||
if [ -z ${LDAP_VERSION+x} ]; then \
|
||||
LDAP_INSTALL="python-ldap"; \
|
||||
else \
|
||||
LDAP_INSTALL="python-ldap==${LDAP_VERSION}"; \
|
||||
LDAP_VERSION=$(curl -sL https://pypi.python.org/pypi/python-ldap/json |jq -r '. | .info.version'); \
|
||||
fi && \
|
||||
pip3 install -U --no-cache-dir pip setuptools wheel && \
|
||||
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.15/ \
|
||||
python3 -m ensurepip && \
|
||||
pip3 install -U --no-cache-dir \
|
||||
pip \
|
||||
wheel && \
|
||||
pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ \
|
||||
cryptography \
|
||||
${LDAP_INSTALL} && \
|
||||
python-ldap=="${LDAP_VERSION}" && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/root/.cache \
|
||||
/root/.cargo
|
||||
$HOME/.cache \
|
||||
$HOME/.cargo
|
||||
|
||||
# copy local files
|
||||
COPY root/ /
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.15
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.17
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
@ -19,24 +21,24 @@ RUN \
|
||||
apk add --no-cache \
|
||||
libffi \
|
||||
libldap \
|
||||
py3-pip \
|
||||
python3 && \
|
||||
if [ -z ${LDAP_VERSION+x} ]; then \
|
||||
LDAP_INSTALL="python-ldap"; \
|
||||
else \
|
||||
LDAP_INSTALL="python-ldap==${LDAP_VERSION}"; \
|
||||
LDAP_VERSION=$(curl -sL https://pypi.python.org/pypi/python-ldap/json |jq -r '. | .info.version'); \
|
||||
fi && \
|
||||
pip3 install -U --no-cache-dir pip setuptools wheel && \
|
||||
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.15/ \
|
||||
python3 -m ensurepip && \
|
||||
pip3 install -U --no-cache-dir \
|
||||
pip \
|
||||
wheel && \
|
||||
pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ \
|
||||
cryptography \
|
||||
${LDAP_INSTALL} && \
|
||||
python-ldap=="${LDAP_VERSION}" && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/root/.cache \
|
||||
/root/.cargo
|
||||
$HOME/.cache \
|
||||
$HOME/.cargo
|
||||
|
||||
# copy local files
|
||||
COPY root/ /
|
||||
|
||||
@ -43,6 +43,7 @@ app_setup_block: |
|
||||
|
||||
# changelog
|
||||
changelogs:
|
||||
- { date: "19.09.22:", desc: "Rebase to alpine 3.17." }
|
||||
- { date: "19.09.22:", desc: "Rebase to alpine 3.15." }
|
||||
- { date: "14.05.21:", desc: "Add linuxserver wheel index." }
|
||||
- { date: "12.02.21:", desc: "Clean up cargo/rust cache." }
|
||||
|
||||
5
root/etc/cont-init.d/30-config → root/etc/s6-overlay/s6-rc.d/init-ldap-config/run
Normal file → Executable file
5
root/etc/cont-init.d/30-config → root/etc/s6-overlay/s6-rc.d/init-ldap-config/run
Normal file → Executable file
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
# generate fernet key for ldap if it doesn't exist
|
||||
if grep -q 'REPLACEWITHFERNETKEY' /app/ldap-backend-app.py; then
|
||||
@ -13,7 +14,7 @@ if grep -q 'REPLACEWITHFERNETKEY' /app/ldap-backend-app.py; then
|
||||
KEY="b'${FERNETKEY}'"
|
||||
echo "using FERNETKEY from env variable"
|
||||
fi
|
||||
|
||||
|
||||
sed -i "s/REPLACEWITHFERNETKEY/${KEY}/" /app/ldap-backend-app.py
|
||||
sed -i "s/REPLACEWITHFERNETKEY/${KEY}/" /app/nginx-ldap-auth-daemon.py
|
||||
sed -i "s/REPLACEWITHFERNETKEY/${KEY}/" /app/nginx-ldap-auth-daemon.py
|
||||
fi
|
||||
1
root/etc/s6-overlay/s6-rc.d/init-ldap-config/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/init-ldap-config/type
Normal file
@ -0,0 +1 @@
|
||||
oneshot
|
||||
1
root/etc/s6-overlay/s6-rc.d/init-ldap-config/up
Normal file
1
root/etc/s6-overlay/s6-rc.d/init-ldap-config/up
Normal file
@ -0,0 +1 @@
|
||||
/etc/s6-overlay/s6-rc.d/init-ldap-config/run
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-ldap-app/notification-fd
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-ldap-app/notification-fd
Normal file
@ -0,0 +1 @@
|
||||
3
|
||||
7
root/etc/s6-overlay/s6-rc.d/svc-ldap-app/run
Executable file
7
root/etc/s6-overlay/s6-rc.d/svc-ldap-app/run
Executable file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec \
|
||||
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 9000" \
|
||||
s6-setuidgid abc python3 /app/ldap-backend-app.py \
|
||||
--host 0.0.0.0 --port 9000
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-ldap-app/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-ldap-app/type
Normal file
@ -0,0 +1 @@
|
||||
longrun
|
||||
@ -0,0 +1 @@
|
||||
4
|
||||
7
root/etc/s6-overlay/s6-rc.d/svc-ldap-daemon/run
Executable file
7
root/etc/s6-overlay/s6-rc.d/svc-ldap-daemon/run
Executable file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec \
|
||||
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8888" \
|
||||
s6-setuidgid abc python3 /app/nginx-ldap-auth-daemon.py \
|
||||
--host 0.0.0.0 --port 8888
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-ldap-daemon/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-ldap-daemon/type
Normal file
@ -0,0 +1 @@
|
||||
longrun
|
||||
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
exec \
|
||||
s6-setuidgid abc python3 /app/ldap-backend-app.py \
|
||||
--host 0.0.0.0 --port 9000
|
||||
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
exec \
|
||||
s6-setuidgid abc python3 /app/nginx-ldap-auth-daemon.py \
|
||||
--host 0.0.0.0 --port 8888
|
||||
Loading…
x
Reference in New Issue
Block a user