Docker: Bookmarks is missing php-gmp

Created on 5 Sep 2019  路  21Comments  路  Source: nextcloud/docker

Bookmarks now requires manually installing a required dependency which isn't optimal for a container (see https://github.com/nextcloud/bookmarks/issues/792). Is it practical to include the php-gmp extension in the docker build?

The error reads:

App "Bookmarks" cannot be installed because the following dependencies are not fulfilled: The library gmp is not available

Most helpful comment

If anyone needs a quick fix, I was able to resolve this by:

  • apt-get install libgmp-dev
  • docker-php-ext-install gmp
  • apachectl restart

All 21 comments

I would recommend to build a derived image on top of nextcloud and install the dependency.

See in the documentation and the examples.

@brettinternet did you managed to resolve it? I tried to install php-gmp via apt install (inside the cointainer) but apt tells me that there are no install candidates.

Thank you

@SnowMB What are the chances of php-gmp being installed in the standard Docker? I'm also unable to apt install php-gmp on nextcloud:16.0-fpm-alpine.

@e-magon @ellis Because containers are ephemeral, it's not practical to install this dependency manually via docker exec. What @SnowMB suggests is extending the Dockerfile, building from Nextcloud's container and adding something like:

RUN docker-php-ext-configure gmp; \
      docker-php-ext-install gmp

You could also consider using someone else's build, like linuxserver/docker-nextcloud.

@SnowMB Is the strategy here not to include any dependencies for Apps? I'd imagine this decision will affect quite a few people. It looks like the gmp package size is about 4.9 kb and installed 12 kb. While gmp isn't a required dep, it looks like it is _recommended_ in the documentation for various apps. Note that exif is also considered "optional" for image rotation, but it's included.

@brettinternet good point about exif. In the beginning we agreed on the intent to keep the official image as small and basic as possible. There are so many variants that it's hard to support them all.

In the past we had many questions/discussions about smb (#19, #22, #60, #105, #474, #557, #578, #648, #754, #777) and imap (#19, #66, #372, #595, #756) which are also optional and not directly "supported". I hoped that documenting in the readme and giving examples would help, but building derived docker images seems a burden that many users don't want to do (Even so it's fairly simple in my opinion).

Recently we also made some contradictory decisions like #785 so it might be time to revisit this standpoint.

However I'm not very active in maintaining the image and even less sure what dependencies are needed for the internals of nextcloud and it's apps so @tilosp and @J0WI are the maintainers to ask. :smile:

There's also a security perspective: https://github.com/nextcloud/docker/issues/594#issuecomment-454008719
I'm fine with gmp, but I have some doubts with ImageMagick and Samba. Especially for IMAP I also think it's easier to just run a container that provides a webmail service than trying to solve that with NextCloud. While PHP extensions are somewhat special, binaries like ImageMagick, Samba or LibreOffice can also be added with docker exec.

@J0WI Dependency installations via docker exec wouldn't persist across upgrades, would they?

I understand this project has some difficult decisions regarding dependencies given the nature of Nextcloud and Apps. Thank you for your efforts in maintaining this repo!

Dependency installations via docker exec wouldn't persist across upgrades, would they?

Indeed you would have to register this as kind of a post run hook.

+1 from my side.

If anyone needs a quick fix, I was able to resolve this by:

  • apt-get install libgmp-dev
  • docker-php-ext-install gmp
  • apachectl restart

Thanks I got it worked by following this link:
https://github.com/laradock/laradock/issues/652#issuecomment-286528587

I would love to see this integrated. Currently the "Bookmark Addon" is "uninstallable" for a regular docker setup without workarounds.

From a security perspective I could imagine some "more" docker images regularly published along the basic one:

docker:14.0.14-apache-full (all dependencies for popular addons included)
docker:14.0.14-apache-graphic (just libs required for image, movie addons)

I could also imagine, that moving addons to separate docker containers/container images would solve the problem of having small basic containers, but also extend those easily. But you may need a "bridge" (container) to docker to install/start/stop addons. This would also open the ecosystem to non-php extensions. I think this would be a big change. I don't know the internal architecture of nextcloud, so I'm not sure if this is possible.

@maxmeyer you are right. it is effecting the Bookmark Android app which is based on Next Cloud Bookmark. Not able to use the latest version docker. Had a extensive discussion with @marcelklehr can some one look into this pull request?

@SnowMB What are the chances of php-gmp being installed in the standard Docker? I'm also unable to apt install php-gmp on nextcloud:16.0-fpm-alpine.

That's why alpine doesn't use apt as package manager. On alpine based image you have to do apk add php7-gmp

On alpine based image you have to do apk add php7-gmp

Docker has it's own way to install PHP extensions, see https://github.com/nextcloud/docker/issues/854#issuecomment-531503822.

Help, is appreaciated. I'm currently stuck with the debian x86 targets, which fail for some reason.

any updates? it looks like the PR that fixes this is hung up

@norweeg Feel free to take a look at the PR and try to make it work, I'm not really a docker wizard.

@marcelklehr I am pretty sure I found the problem. I will add a comment to the PR

  • apachectl restart

If anyone needs a quick fix, I was able to resolve this by:

  • apt-get install libgmp-dev
  • docker-php-ext-install gmp
  • apachectl restart

This shoud be a treated as tempurary fix. @marcelklehr any reason why this has not taken care with the main docker image??

@dasbiswajit According to https://github.com/docker-library/official-images/pull/6867, this issue is fixed in the current docker hub images. The solution you cited works out of the box for debian@x64 but for other platforms some tweaks were necessary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

waldner picture waldner  路  3Comments

Xanarkan picture Xanarkan  路  3Comments

pierreozoux picture pierreozoux  路  3Comments

SQGE picture SQGE  路  3Comments

all-the-good-ones-are-gone picture all-the-good-ones-are-gone  路  3Comments