iamklaus / nextcloud

Nextcloud docker file including cron via supervisor and all dependencies to install the face recognition app.
17 stars 9 forks source link

Cannot build apache image for latest version: COPY failed: stat usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdlib.so: file does not exist #7

Closed E4est closed 2 years ago

E4est commented 3 years ago

When I am trying to build the Dockerfile, I get COPY failed: stat usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdlib.so: file does not exist

Looking further into the output, it looks like in STEP 7 another Zend Module Api Version is used than expected.

Step 7/29 : RUN cd;     wget -c -q https://github.com/matiasdelellis/pdlib/archive/$PDLIB_BRANCH.zip     && unzip $PDLIB_BRANCH     && mv pdlib-* pdlib     && cd pdlib     && phpize     && ./configure     && make     && make install
 ---> Running in b3ca30deb1f4
Archive:  master.zip
1153e3e2eb28db09ed207a904096d8d6deb693a1
[...]
Configuring for:
PHP Api Version:         20200930
Zend Module Api No:      20200930
Zend Extension Api No:   420200930
[...]

Changing line 58 COPY --from=builder /usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdlib.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/ to COPY --from=builder /usr/local/lib/php/extensions/no-debug-non-zts-20200930/pdlib.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ seems to resolve the issue for now.

The only problem I see is that it might break again in the future. Any ideas on how to permanently fix this for future versions?

iamklaus commented 3 years ago

Hi, please pull the files again. I've fixed it for the moment. I will work on a solution so that it is dynamic. Regards, Klaus

iamklaus commented 3 years ago

A dynamic configuration of the path seems to be tricky. Docker seems not to allow that because it could be security problem. Anybody who has an idea?

guystreeter commented 3 years ago

There might be a better way (I'm not that great with sed), but

php -i | grep ^extension_dir | sed -E 's/^[^ ]* => [^ ]* => (.*)$/\1/'

will give you the full directory path.

iamklaus commented 2 years ago

Closed, I will have to update the build file every time Dlib gets updated. By design dynamic paths are not allowed (docker security rule).