From 9f28098d04a87b0db232e2c4dec3aeb2c76b6da9 Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 26 Dec 2024 18:26:24 +0100 Subject: [PATCH] Container: Copy files to stable path, add ecs backwards compatibility Copy captcha scripts to stable path for referencing in compose files: /usr/local/bin/ which is included in $PATH For backwards compatibility with ecs, link: /opt/ -> /home/ /usr/local/bin/ -> /opt/ejabberd/bin/ Copy sql files to stable path for referencing: /opt/ejabberd/sql/ For backwards compatibility with ecs, copy also to /opt/ejabberd/database/ ecs image implemented this in ejabberdctl since 2019: edb0373fd0ae0b24807a41ba2c3bf04b5b514844 Keep SQL init scripts in container (#42) --- .github/container/Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/container/Dockerfile b/.github/container/Dockerfile index 2a44b9035..840ac2944 100644 --- a/.github/container/Dockerfile +++ b/.github/container/Dockerfile @@ -137,6 +137,11 @@ RUN home_root_dir=$(echo $HOME | sed 's|\(.*\)/.*|\1 |') \ ARG UID RUN chown -R $UID:$UID $HOME +ARG VERSION +RUN cp /rootfs/$HOME-$VERSION/lib/captcha*.sh usr/local/bin/ +RUN mkdir $HOME/sql \ + && find /rootfs/$HOME-$VERSION/lib/ -name *.sql -exec cp {} $HOME/sql \; -exec cp {} $HOME/database \; + ################################################################################ #' METHOD='direct' - Remove erlang/OTP & rebar3 FROM docker.io/erlang:${OTP_VSN}-alpine AS runtime-direct @@ -167,6 +172,10 @@ ARG HOME RUN addgroup $USER -g $UID \ && adduser -s /sbin/nologin -D -u $UID -h /$HOME -G $USER $USER +RUN ln -fs /usr/local/bin/ /opt/ejabberd/bin +RUN rm -rf /home \ + && ln -fs /opt /home + ################################################################################ #' Build together production image FROM scratch AS prod