25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Dockerfile: Detect runtime dependencies automatically

Only libcap2 and tini can't be auto-detected. libcap2 has been renamed in Alpine version 3.17, hence the Dockerfile is not compatible with Alpine versions <3.17
This commit is contained in:
sando38 2023-04-07 20:42:04 +02:00 committed by badlop
parent 99e51a2123
commit 401bdedae8

View File

@ -117,7 +117,10 @@ RUN home_root_dir=$(echo $HOME | sed 's|\(.*\)/.*|\1 |') \
\nexport SPOOL_DIR=/$HOME/database \ \nexport SPOOL_DIR=/$HOME/database \
\nexec /$(find $home_root_dir -name ejabberdctl) \"\$@\"" \ \nexec /$(find $home_root_dir -name ejabberdctl) \"\$@\"" \
> usr/local/bin/ejabberdctl \ > usr/local/bin/ejabberdctl \
&& chmod +x usr/local/bin/* && chmod +x usr/local/bin/* \
&& scanelf --needed --nobanner --format '%n#p' --recursive $home_root_dir \
| tr ',' '\n' | sort -u | awk 'system("[ -e $home_root_dir" $1 " ]") == 0 { next } \
{ print "so:" $1 }' > /tmp/runDeps
ARG UID ARG UID
RUN chown -R $UID:$UID $HOME RUN chown -R $UID:$UID $HOME
@ -133,23 +136,9 @@ RUN apk -U upgrade --available --no-cache \
################################################################################ ################################################################################
#' METHOD='direct' - install runtime dependencies #' METHOD='direct' - install runtime dependencies
FROM runtime-package AS runtime-direct FROM runtime-package AS runtime-direct
COPY --from=ejabberd /tmp/runDeps /tmp/runDeps
RUN apk add --no-cache \ RUN apk add --no-cache \
expat \ $(cat /tmp/runDeps)
freetds \
gd \
jpeg \
libgd \
libpng \
libstdc++ \
libwebp \
linux-pam \
ncurses-libs \
sqlite \
sqlite-libs \
unixodbc \
yaml \
zlib \
&& ln -fs /usr/lib/libtdsodbc.so.0 /usr/lib/libtdsodbc.so
################################################################################ ################################################################################
#' Finalize runtime environment #' Finalize runtime environment