[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docker] failed to solve: process "/bin/sh -c docker-php-ext-install pdlib-master" #698

Open
mbnoimi opened this issue Sep 27, 2023 · 1 comment

Comments

@mbnoimi
Copy link
mbnoimi commented Sep 27, 2023

I failed to create a new container deepening on the instructions mentioned in the wiki page!

I always get this error message (tested on two different machines):

.
.
.
Step 6/9 : RUN docker-php-ext-install pdlib-master
.
.
.

 g++ -I. -I/usr/src/php/ext/pdlib-master -I/usr/src/php/ext/pdlib-master/include -I/usr/src/php/ext/pdlib-master/main -I/usr/src/php/ext/pdlib-master -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++14 -DZEND_COMPILE_DL_EXT=1 -c /usr/src/php/ext/pdlib-master/src/chinese_whispers.cc -MMD -MF src/chinese_whispers.dep -MT src/chinese_whispers.lo  -fPIC -DPIC -o src/.libs/chinese_whispers.o
/bin/bash /usr/src/php/ext/pdlib-master/libtool --mode=compile g++ -I. -I/usr/src/php/ext/pdlib-master -I/usr/src/php/ext/pdlib-master/include -I/usr/src/php/ext/pdlib-master/main -I/usr/src/php/ext/pdlib-master -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -g -O2   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++14 -DZEND_COMPILE_DL_EXT=1 -c /usr/src/php/ext/pdlib-master/src/face_detection.cc -o src/face_detection.lo  -MMD -MF src/face_detection.dep -MT src/face_detection.lo
 g++ -I. -I/usr/src/php/ext/pdlib-master -I/usr/src/php/ext/pdlib-master/include -I/usr/src/php/ext/pdlib-master/main -I/usr/src/php/ext/pdlib-master -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++14 -DZEND_COMPILE_DL_EXT=1 -c /usr/src/php/ext/pdlib-master/src/face_detection.cc -MMD -MF src/face_detection.dep -MT src/face_detection.lo  -fPIC -DPIC -o src/.libs/face_detection.o
In file included from /usr/include/dlib/gui_core/xlib.h:4,
                 from /usr/include/dlib/gui_core.h:14,
                 from /usr/include/dlib/gui_widgets/drawable.h:10,
                 from /usr/include/dlib/gui_widgets/widgets.h:16,
                 from /usr/include/dlib/gui_widgets.h:13,
                 from /usr/src/php/ext/pdlib-master/src/face_detection.cc:7:
/usr/include/dlib/gui_core/gui_core_kernel_2.h:11:2: error: #error "DLIB_NO_GUI_SUPPORT is defined so you can't use the GUI code.  Turn DLIB_NO_GUI_SUPPORT off if you want to use it."
   11 | #error "DLIB_NO_GUI_SUPPORT is defined so you can't use the GUI code.  Turn DLIB_NO_GUI_SUPPORT off if you want to use it."
      |  ^~~~~
/usr/include/dlib/gui_core/gui_core_kernel_2.h:12:2: error: #error "Also make sure you have libx11-dev installed on your system"
   12 | #error "Also make sure you have libx11-dev installed on your system"
      |  ^~~~~
make: *** [Makefile:216: src/face_detection.lo] Error 1
The command '/bin/sh -c docker-php-ext-install pdlib-master' returned a non-zero code: 2
ERROR: Service 'nextcloud' failed to build : Build failed

May you please help me to find out what's wrong?

docker-compose.yml

version: '3'

services:
    postgresql:
        container_name: "test-postgresql"
        image: postgres:latest
        volumes:
            - /home/server/Storage/Congig_tmp/Postgresql/data:/var/lib/postgresql/data
        ports:
            - "5432:5432"
        restart: always
        environment:
            - POSTGRES_PASSWORD=346sdfddfg5SSD
            - POSTGRES_USER=root
            - POSTGRES_DB=postgres          
    nextcloud:
        container_name: "test-nextcloud"
        environment:
          - POSTGRES_PASSWORD=346sdfddfg5SSD
          - POSTGRES_DB=nextcloud
          - POSTGRES_USER=root
          - POSTGRES_HOST=postgresql
        # image: nextcloud:latest
        build: https://gist.githubusercontent.com/mbnoimi/6eda9e973959bb907007d09c23e84b43/raw/2808c90e049e6f0f232807721dd0a82176be36d3/nc.Dockerfile
        ports:
          - "80:80"
        restart: always
        volumes:
          - /home/server/Storage/Congig_tmp/Nextcloud/app:/var/www/html
        depends_on:
            - postgresql
@stuckj
Copy link
stuckj commented Aug 10, 2024

I think when the instructions were written the author was hosting a dlib build with DLIB_NO_GUI_SUPPORT not defined so there was GUI support. That repo doesn't appear to have libdlib-dev anymore (at least, not for bullseye that I can see). So, the apt command is falling back to the version from debian directly.

In ubuntu, It looks like DLIB_NO_GUI_SUPPORT is defined by default (davisking/dlib#1998) so there's no GUI support. That issue references ubuntu, but I think it's coming upstream from debian so affects you as well. The workaround is to build dlib from source code. You can see how from the pdlib repo instructions: https://github.com/goodspb/pdlib/

Instead of the code below from here:

# Enable repo and install dlib
RUN echo "deb https://repo.delellis.com.ar bullseye bullseye" > /etc/apt/sources.list.d/20-pdlib.list \
  && wget -qO - https://repo.delellis.com.ar/repo.gpg.key | apt-key add -
RUN apt update \
  && apt install -y libdlib-dev

do this to install dlib from source:

cd
sudo apt update \
  && apt install -y git cmake libavdevice-dev libavfilter-dev libavformat-dev libavcodec-dev libswresample-dev libswscale-dev libavutil-dev libjxl-dev libopenblas-dev liblapack-dev
git clone https://github.com/davisking/dlib.git
cd dlib/dlib
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON ..
make
make install
cd
rm -rf dlib

The rest of the instructions work fine as long as you already have libx11-dev installed (it was for nextcloud for me already). To be on the safe side, you could add libx11-dev to the end of that first apt install command to make sure it's installed before building dlib (else you'll also have GUI stuff disabled...).

@matiasdelellis, not sure if you want to update the instructions here or check your repo to see if it still has a libdlib-dev package to override the stock one from debian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants