Problem with building full docker image from example nextcloud:31.0.8-apache

Hi,

I’m having trouble creating my own Docker image. Every time a new version of Nextcloud comes out, I create my own Docker image.

I use the Docker file from the examples directory.

docker/.examples/dockerfiles/full/apache

I only change the FROM line to the latest one: nextcloud:31.0.8-apache

Something has changed, because in previous versions I had no problems creating a Docker image.

When I try to build it I got an error regarding libmagickcore.

docker build -t majherek/nextcloud:31.0.8 --network host .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon   7.68kB
Step 1/7 : FROM nextcloud:31.0.8-apache
 ---> b5fcb9799d0d
Step 2/7 : RUN set -ex;         apt-get update;     apt-get install -y --no-install-recommends         ffmpeg         ghostscript         libmagickcore-6.q16-6-extra         procps         smbclient         supervisor        libreoffice     ;     rm -rf /var/lib/apt/lists/*
 ---> Running in e9e44a34d4db
+ apt-get update
Hit:1 http://deb.debian.org/debian trixie InRelease
Get:2 http://deb.debian.org/debian trixie-updates InRelease [47.1 kB]
Get:3 http://deb.debian.org/debian-security trixie-security InRelease [43.4 kB]
Get:4 http://deb.debian.org/debian trixie/main amd64 Packages [9668 kB]
Get:5 http://deb.debian.org/debian trixie-updates/main amd64 Packages [2432 B]
Get:6 http://deb.debian.org/debian-security trixie-security/main amd64 Packages [11.6 kB]
Fetched 9772 kB in 2s (5940 kB/s)
Reading package lists...
+ apt-get install -y --no-install-recommends ffmpeg ghostscript libmagickcore-6.q16-6-extra procps smbclient supervisor libreoffice
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libmagickcore-6.q16-6-extra
E: Couldn't find any package by glob 'libmagickcore-6.q16-6-extra'
E: Couldn't find any package by regex 'libmagickcore-6.q16-6-extra'
The command '/bin/sh -c set -ex;         apt-get update;     apt-get install -y --no-install-recommends         ffmpeg         ghostscript         libmagickcore-6.q16-6-extra         procps         smbclient         supervisor        libreoffice     ;     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

I change libmagickcore-6.q16-6-extra to libmagickcore-7.q16-10-extra.

Then I got an error regarding libc-client-dev:

+ apt-get install -y --no-install-recommends libbz2-dev libc-client-dev libkrb5-dev libsmbclient-dev
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libc-client-dev
The command '/bin/sh -c 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;         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/*' returned a non-zero code: 100

Is it about the linux-libc-dev package?

I can’t find it anywhere: Debian -- Package Search Results -- libc-client-dev

1 Like

I got the same error and issue. With just removing it from the Dockerfile, my version was built successfully, and I haven’t got any error shown in the admin overview. Not sure if It’s still needed for NC 31.0.8

The image was recently bumped from Debian Bookworm to Debian Trixie.

I believe it’s because the package was bumped in Debian and has a hardcoded version (it’s a bit of an oddball):

1 Like

I thought it was only me. I’m using nextcloud:fpm, but it’s the exact same behavior with the same errors.

Even after commenting libmagickcore-6.q16-6-extra and also libc-client-dev it leads to other errors.

The same problem here! Could someone share an example of working Dockerfile or fix docker/.examples/dockerfiles/full/apache ?

Even updating to the new package it still fails with exit code 100. Damn.

My working Dockerfile for now based on this comment:

FROM nextcloud:apache

RUN set -ex; \
    \
    apt-get update; \
    apt-get install -y --no-install-recommends \
        ffmpeg \
        ghostscript \
        libmagickcore-7.q16-10-extra \
        imagemagick \
        procps \
        smbclient \
        supervisor \
    ; \
    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 \ # Throws error with Trixie
        libkrb5-dev \
        libsmbclient-dev \
    ;

# # # Workaround: libc-client-dev is installed from buster image
# Add Buster repository for libc-client-dev only
RUN echo "deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://archive.debian.org/debian/ buster main" > /etc/apt/sources.list.d/buster.list

# Install libc-client-dev package from Buster repository
RUN apt-get update && apt-get install -y libc-client-dev

# Clean up the added repository and pin file
RUN rm /etc/apt/sources.list.d/buster.list && apt-get update;

RUN set -ex; \
    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"]

What is the reason the libmagickcore package is needed in the first place again? I have it in my build, but I forgot why. Is it needed any more at all?

Edit: It seems like libmagickcore-6.q16-10-extra (and now 7) has been included in the base image at least since v30.

SVG support (mostly icon generation).

Edit: It seems like libmagickcore-6.q16-10-extra (and now 7) has been included in the base image at least since v30.

Different versions of it have been in the image for several years.