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

**URL:** <https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628>\
**Category:** 📦 Appliances (Docker, Snappy, VM, NCP, AIO)\
**Tags:** docker, nc31\
**Created:** [August 20, 2025, 7:26am UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628 "2025-08-20T07:26:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![majherek](https://help.nextcloud.com/letter_avatar/majherek/32/5_5575768a8748004e209b776fc1b2916d.png) [@majherek](https://help.nextcloud.com/u/majherek)\
**Post date:** [August 20, 2025, 7:26am UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628/1 "2025-08-20T07:26:18Z")

</div>

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_.

```auto
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:

```auto
+ 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](https://packages.debian.org/search?searchon=names&keywords=libc-client-dev)

---

<div class="post-metadata">

**Author:** ![MarslMarcello](https://help.nextcloud.com/user_avatar/help.nextcloud.com/marslmarcello/32/5382_2.png) [@MarslMarcello](https://help.nextcloud.com/u/MarslMarcello)\
**Post date:** [August 23, 2025, 7:29am UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628/2 "2025-08-23T07:29:22Z")

</div>

> [@majherek](#):
>
> `libmagickcore-6.q16-6-extra`

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

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/5_5575768a8748004e209b776fc1b2916d.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [August 25, 2025, 5:05pm UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628/3 "2025-08-25T17:05:28Z")

</div>

> [@majherek](#):
>
> ```auto
> E: Unable to locate package libmagickcore-6.q16-6-extra
> E: Couldn't find any package by glob 'libmagickcore-6.q16-6-extra'
> 
> ```

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):

- [https://packages.debian.org/bookworm/libmagickcore-6.q16-6-extra](https://packages.debian.org/bookworm/libmagickcore-6.q16-6-extra)
- [https://packages.debian.org/trixie/libmagickcore-7.q16-10-extra](https://packages.debian.org/trixie/libmagickcore-7.q16-10-extra)

---

<div class="post-metadata">

**Author:** ![CptDayDreamer](https://help.nextcloud.com/user_avatar/help.nextcloud.com/cptdaydreamer/32/17910_2.png) [@CptDayDreamer](https://help.nextcloud.com/u/CptDayDreamer)\
**Post date:** [September 1, 2025, 9:34am UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628/4 "2025-09-01T09:34:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tor\_forsale](https://help.nextcloud.com/letter_avatar/tor_forsale/32/5_5575768a8748004e209b776fc1b2916d.png) [@tor\_forsale](https://help.nextcloud.com/u/tor_forsale)\
**Post date:** [September 3, 2025, 2:06pm UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628/5 "2025-09-03T14:06:37Z")

</div>

The same problem here! Could someone share an example of working Dockerfile or fix [docker/.examples/dockerfiles/full/apache](https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/full/apache/Dockerfile) ?

---

<div class="post-metadata">

**Author:** ![Eschguy](https://help.nextcloud.com/user_avatar/help.nextcloud.com/eschguy/32/74149_2.png) [@Eschguy](https://help.nextcloud.com/u/Eschguy)\
**Post date:** [September 4, 2025, 1:20am UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628/6 "2025-09-04T01:20:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Eschguy](https://help.nextcloud.com/user_avatar/help.nextcloud.com/eschguy/32/74149_2.png) [@Eschguy](https://help.nextcloud.com/u/Eschguy)\
**Post date:** [September 8, 2025, 9:05pm UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628/7 "2025-09-08T21:05:42Z")

</div>

My working Dockerfile for now based on [this comment](https://github.com/nextcloud/docker/issues/2467#issuecomment-3248687738):

> ```auto
> 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"]
> 
> ```

---

<div class="post-metadata">

**Author:** ![norsemangrey](https://help.nextcloud.com/user_avatar/help.nextcloud.com/norsemangrey/32/35914_2.png) [@norsemangrey](https://help.nextcloud.com/u/norsemangrey)\
**Post date:** [September 19, 2025, 11:15pm UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628/8 "2025-09-19T23:15:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/5_5575768a8748004e209b776fc1b2916d.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [September 24, 2025, 2:39pm UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628/9 "2025-09-24T14:39:26Z")

</div>

> [@norsemangrey](#):
>
> 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?

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.

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [October 29, 2025, 10:17am UTC](https://help.nextcloud.com/t/problem-with-building-full-docker-image-from-example-nextcloud-31-0-8-apache/230628/10 "2025-10-29T10:17:24Z")

</div>

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.
