docker icon indicating copy to clipboard operation
docker copied to clipboard

change to debian trixie breaks example in repository

Open XtraLarge opened this issue 4 months ago • 9 comments

Hi, you've changed the debian system to debian 13 (trixie), but the Dockerfile-examples like ".examples/dockerfiles/full/apache/Dockerfile" reference to debian 12 packages.

I've tried to find the replacment packages, but I've no sure which ones are correct.

I found that

  • libmagickcore-7.q16-10-extra is new
  • libc-client-dev does not exist

But after that I've stucked :(

XtraLarge avatar Aug 15 '25 16:08 XtraLarge

Same problem:

 => ERROR [2/8] RUN set -ex;         apt-get update;     apt-get install -y --no-install-recommends         ffmpeg  ghostscript         libmagickcore-6.q16-6-extra         procps         smbcl  19.8s
------
 > [2/8] RUN set -ex;         apt-get update;     apt-get install -y --no-install-recommends         ffmpeg     ghostscript         libmagickcore-6.q16-6-extra         procps         smbclient         supervisor     ;     rm -rf /var/lib/apt/lists/*;:
1.911 + apt-get update
2.151 Hit:1 http://deb.debian.org/debian trixie InRelease
2.151 Get:2 http://deb.debian.org/debian trixie-updates InRelease [47.1 kB]
2.154 Hit:3 http://deb.debian.org/debian-security trixie-security InRelease
2.839 Get:4 http://deb.debian.org/debian trixie/main amd64 Packages [9668 kB]
2.865 Get:5 http://deb.debian.org/debian trixie-updates/main amd64 Packages [2432 B]
2.878 Get:6 http://deb.debian.org/debian-security trixie-security/main amd64 Packages [8780 B]
3.809 Fetched 9726 kB in 2s (5234 kB/s)
3.809 Reading package lists...
4.520 + apt-get install -y --no-install-recommends ffmpeg ghostscript libmagickcore-6.q16-6-extra procps smbclient supervisor
4.526 Reading package lists...
5.296 Building dependency tree...
5.448 Reading state information...
5.550 E: Unable to locate package libmagickcore-6.q16-6-extra
5.550 E: Couldn't find any package by glob 'libmagickcore-6.q16-6-extra'
5.550 E: Couldn't find any package by regex 'libmagickcore-6.q16-6-extra'

kodukon avatar Aug 16 '25 11:08 kodukon

libmagickcore-6.q16-6-extra has been superseded by libmagickcore-7.q16-10-extra, but libc-client-dev is also missing from trixie.

nick-oconnor avatar Aug 16 '25 22:08 nick-oconnor

The PHP imap extension depends on c-client - https://www.php.net/manual/en/imap.requirements.php. I'm not seeing any debian packages that provide it in trixie.

nick-oconnor avatar Aug 16 '25 22:08 nick-oconnor

Seems libmagickcore-7.q16-10-extra is in the base dockerfile now, and indeed the libc-client-dev is missing from the trixie repos?

I can also see the imap is in the base images aswell, email seems to work?

This is my example fpm config if it helps build for the time being

FROM nextcloud:fpm

RUN set -ex; \
    \
    apt-get update; \
    apt-get install -y --no-install-recommends \
        ffmpeg \
        ghostscript \
#        libmagickcore-7.q16-10-extra \
        procps \
        smbclient \
        supervisor \
#       libreoffice \
    ; \
    rm -rf /var/lib/apt/lists/*

RUN set -ex; \
    \
    savedAptMark="$(apt-mark showmanual)"; \
    \
    apt-get update; \
    apt-get install -y --no-install-recommends \
        libbz2-dev \
        #libc-client-dev \
        libkrb5-dev \
        libsmbclient-dev \
    ; \
    \
#    docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
    docker-php-ext-install \
        bz2 \
#        imap \
    ; \
    pecl install smbclient; \
    docker-php-ext-enable smbclient; \
    \
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
    apt-mark auto '.*' > /dev/null; \
    apt-mark manual $savedAptMark; \
    ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
        | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
        | sort -u \
        | xargs -r dpkg-query --search \
        | cut -d: -f1 \
        | sort -u \
        | xargs -rt apt-mark manual; \
    \
    apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
    rm -rf /var/lib/apt/lists/*

RUN mkdir -p \
    /var/log/supervisord \
    /var/run/supervisord \
;

COPY supervisord.conf /

ENV NEXTCLOUD_UPDATE=1

CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]

db260179 avatar Aug 18 '25 08:08 db260179

Why was it necessary to update to a new Debian major release for NextCloud 30 and 31? Isn't Debian bookworm still maintained for a while, at least longer than the lifetime for NextCloud 30 and 31?

If one has to do a major update on the Debian base image, then why not wait with this until the next new major update of NextCloud?

It would be great to just revert #2454 for now, so we won't have to guess around what changes we need to do to images build on top of it to do a maintenance update of NextCloud 30 and 31.

svigerske avatar Aug 18 '25 08:08 svigerske

I've build it with that Dockerfile, I've tested smb and imap and supervisord. In my scenario it is enough ;-)

To debug it, I've splitted it a little bit ;-)

FROM nextcloud:apache

RUN apt-get update && apt-get install -y procps smbclient && rm -rf /var/lib/apt/lists/*

RUN set -ex; \
    \
    apt-get update; \
    apt-get install -y --no-install-recommends \
        ffmpeg \
        ghostscript \
        libmagickcore-7.q16-10-extra \
        procps \
    ; \
    rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y \
    supervisor \
  && rm -rf /var/lib/apt/lists/* \
  && mkdir /var/log/supervisord /var/run/supervisord

RUN set -ex; \
    \
    savedAptMark="$(apt-mark showmanual)"; \
    \
    apt-get update; \
    apt-get install -y --no-install-recommends \
        libbz2-dev \
        libsmbclient-dev \
    ; 

RUN set -ex; \
    docker-php-ext-install \
        bz2 \
    ;

RUN set -ex; \
    pecl install smbclient; \
    docker-php-ext-enable smbclient; 

RUN set -ex; \
    apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
    rm -rf /var/lib/apt/lists/*;

COPY supervisord.conf /

ENV NEXTCLOUD_UPDATE=1

CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]

XtraLarge avatar Aug 18 '25 09:08 XtraLarge

☝️ This is not an equivalent fix for the Apache example if somebody wants to have Libreoffice, too.

Here is my diff for the Apache full example file. Could somebody maybe fix it in the repo as well, please?

 RUN set -ex; \
     \
@@ -6,11 +8,11 @@ RUN set -ex; \
     apt-get install -y --no-install-recommends \
         ffmpeg \
         ghostscript \
-        libmagickcore-6.q16-6-extra \
+#        libmagickcore-6.q16-6-extra \
         procps \
         smbclient \
         supervisor \
-#       libreoffice \
+        libreoffice \
     ; \
     rm -rf /var/lib/apt/lists/*
 
@@ -21,15 +23,15 @@ RUN set -ex; \
     apt-get update; \
     apt-get install -y --no-install-recommends \
         libbz2-dev \
-        libc-client-dev \
+#        libc-client-dev \
         libkrb5-dev \
         libsmbclient-dev \
     ; \
     \
-    docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
+#    docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
     docker-php-ext-install \
         bz2 \
-        imap \
+#        imap \
     ; \
     pecl install smbclient; \
     docker-php-ext-enable smbclient; \

immanuelfodor avatar Oct 05 '25 17:10 immanuelfodor

Not sure if this is the best way to fix the issue, but I found another solution by using the sury repo to install libc-client2007e-dev (https://www.reddit.com/r/debian/comments/1mu271u/php_84_desperately_need_imap_support/). The repo details state that this package provides & replaces libc-client-dev.

I wasn't sure how to make ensure IMAP worked so I tried the "External user authentication" app with Gmail and an app password. I was surprised to see the login worked.

@@ -6,7 +6,7 @@
     apt-get install -y --no-install-recommends \
         ffmpeg \
         ghostscript \
-        libmagickcore-6.q16-6-extra \
+        libmagickcore-7.q16-10-extra \
         procps \
         smbclient \
         supervisor \
@@ -21,11 +21,14 @@
     apt-get update; \
     apt-get install -y --no-install-recommends \
         libbz2-dev \
-        libc-client-dev \
         libkrb5-dev \
         libsmbclient-dev \
     ; \
     \
+    curl -s https://packages.sury.org/php/README.txt | bash -x; \
+    apt-get install -y --no-install-recommends \
+        libc-client2007e-dev \
+    ; \
     docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
     docker-php-ext-install \
         bz2 \

agizmo avatar Oct 21 '25 03:10 agizmo

☝️ This is not an equivalent fix for the Apache example if somebody wants to have Libreoffice, too.

Here is my diff for the Apache full example file. Could somebody maybe fix it in the repo as well, please?

RUN set -ex;

@@ -6,11 +8,11 @@ RUN set -ex;
apt-get install -y --no-install-recommends
ffmpeg
ghostscript \

  •    libmagickcore-6.q16-6-extra \
    

+# libmagickcore-6.q16-6-extra
procps
smbclient
supervisor
-# libreoffice \

  •    libreoffice \
    
    ;
    rm -rf /var/lib/apt/lists/*

@@ -21,15 +23,15 @@ RUN set -ex;
apt-get update;
apt-get install -y --no-install-recommends
libbz2-dev \

  •    libc-client-dev \
    

+# libc-client-dev
libkrb5-dev
libsmbclient-dev
;
\

  • docker-php-ext-configure imap --with-kerberos --with-imap-ssl;
    +# docker-php-ext-configure imap --with-kerberos --with-imap-ssl;
    docker-php-ext-install
    bz2 \
  •    imap \
    

+# imap
;
pecl install smbclient;
docker-php-ext-enable smbclient; \

Wouldn't that remove IMAP support completely? Or am I missing something? Also since libmagickcore is now supposedly in the base image, what is the point of having it still in the dockerfile?

Luk164 avatar Oct 31 '25 00:10 Luk164