-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Build into an Dockerimage #160
Comments
Hi @Happyfeet01, I tried to do the same, but in an Alpine container. Dlib builds fine, but pdlib fails to build in my setup. I've opened an issue in pdlib, but no reaction so far: goodspb/pdlib#17 |
Hi both I have very little experience about docker... Also I can't imagine how we can use it here, unless you have the whole instance of Nextcloud right there.. 😕 Well, That said, I will try to compile it using the dockerfile shared by @agboom in the pdlib repository. ..and I will answer if I can do something. Today, I can't help you much more.. 😞 |
Hi @matiasdelellis, thanks for replying and offering to help 😃 I'll try to explain my motivation for building pdlib in Docker. Nextcloud provides a Docker image for their server and I'd like to try this app in a server. Since it requires the pdlib binaries and the Docker image does not include it, I'm trying to build it inside the container (or in this case in a separate container, and copy the binaries to the Nextcloud container). Perhaps I'm overcomplicating things this way. If there is a better or faster way of providing the binaries, please let me know |
I support this endeavor, if it would be possible for someone who has time to compile "easy install" package for the OS which official Nexcloud image for docker is using: |
Hi, Well, The best I can offer you a dockerfile to compile and test the libraries.
This result on:
Then it would work ... |
p.s: Note that I start from the docker that you passed, so you should only compile this one, and run this instead of the previous one, or just copy the libraries compiled here to the instance you want to use. EDIT Edit last docker file to clean packages... Then remove the test when you dont need it. 😉 |
Hello @matiasdelellis testing it out, right now on my instance of Docker and all seems to work well. I have simply included your lines into the original Dockerfile of Nextcloud added php memory adjustment. Removed testing sequence as it's not very wise to do that during the build. So now you have full easy peasy installation procedure with your addon on Docker platform, which is supported almost on any platform. :)
Now create supervisord.conf:
Thanks a lot for constructing the command sequence! |
Wow, @Petahh 👏 😄 🥇 I understand that these files are part of your custom configuration, or these are taken from the Nextcloud Image? I ask to write a small tutorial, with the least amount of change possible about the original Nextcloud image.
At some point we discussed it, and concluded that it was best to focus efforts on a single tool to gain experience, and then evaluate whether to expand it. Without promises, but soon we can discuss again.. 😉 |
Nice, really nice :-) I Would Test it in my Testserver |
You have two choices how to install Nextcloud in Docker. Use their final & download ready image, (which is missing some of the features), or build your own image with Dockerfile, leveraging Dockerfile examples they provide. Second option is choice for many and that is the only way how to introduce your addon in the closest to the official procedure of Nextcloud for Docker installation. I only took their Dockerfile and added in your parts of the code. Only thing which is custom is version at the top, rest is all Nextcloud original apart from your code of course. Building image is just one part of Nextcloud Docker installation procedure. Further steps we don’t elaborate. The procedure which I have written is absolute minimum to make a working image with your addon. Hope it helps to understand it better :) |
Great.. Thanks.. 😃 ...along with this clean dockerfile that I shared (Just because it's simpler) Maybe we can add an example in the official repo ... and I just realized that what you originally shared was an example ... 😅 Sorry.. 😉 |
What you have shared previously worked nice as demonstration for the test of libraries installation, but I believe would not work at all in the real deployment scenario. That’s the whole reason I have reworked it a little :) |
You're right, I forgot about memory and maybe more .. 😉 I don't want to share a big dockerfile, where if something fails you don't know where to run .. 😓 |
I get your point but I don't see a way around this really. Unfortunately, that is the procedure. I don't think people will have many issues building it now, rather you will need to keep it updated with their example cause they might change it in their repo, they tend to update it with new versions. Edit: and I doubt they will allow us to introduce this into their example file. |
you mean nextcloud? |
IMHO the best way to get Nextcloud up and running with Docker is to use Docker Compose. There is a very elaborate manual in the Nextcloud Docker repo. We could for example add a page to the Wiki for Docker installation, that refers to this chapter: https://github.com/nextcloud/docker/#running-this-image-with-docker-compose You can run Nextcloud with Docker in one of three ways:
I would recommend using Alpine as base image, since Alpine containers have a much smaller footprint and soon the installation of dlib and php7-pdlib will be much easier via the Alpine package manager. In all three cases, you'll need a Next edit the # ...
app:
image: nextcloud # or nextcloud:fpm or nextcloud:fpm-alpine
# ... with the following: # ...
app:
build: ./nextcloud
# ... This will allow you to build upon the Nextcloud base image you chose. If you're running Nextcloud with Apache based on the Debian image, to get the FaceRecognition app working you would need to build the dlib and pdlib libraries, since they're not available via Add a FROM debian AS builder
# TODO build dlib and pdlib here
FROM nextcloud
RUN apt install # <-- TODO add runtime dependencies
COPY --from=builder /usr/local /usr/local
COPY --from=builder /usr/lib/php7/modules/pdlib.so /usr/local/lib/php/extensions/no-debug-non-zts-20180731/
RUN echo "extension=pdlib.so" > /usr/local/etc/php/conf.d/pdlib.ini This If you're running Nextcloud with Nginx and PHP FPM, Once alpinelinux/aports#12174 has been merged, you should be able to run the FaceRecognition app with just the following FROM nextcloud:fpm-alpine
RUN apk --update add --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing php7-pdlib The FaceRecognition app can be installed from the app store thanks to the wonderful work done in #1 We might want to add some documentation about how to install a cron job to regularly scan for new faces? |
Hello everyone, This shouldn't affect them as much, but one of the things I hope to do is improve the documentation. For example, here is a first documentation about how to install PDlib on docker. Well, Insist in that I have no more experience with docker, 😅 therefore I want your opinion. 😄 Thanks, |
In case it helps anyone, I built https://hub.docker.com/repository/docker/ohthehugemanatee/nextcloud-dlib . It's nextcloud based on alpine (the LinuxServer version of the container), with the matiasdelellis pdlib included. No guarantees etc etc etc... except that this is the container I use. :) Enjoy! Source at https://github.com/ohthehugemanatee/nextcloud-dlib . |
Hello sorry to bother you, i have a working new nextcloud install, i'm newbie with nextcloud and docker, how can i integrate face recognition? |
Hi @spupuz See. And slowly read the comments from the dockerfile.. 😉 |
there is not any maintainer image with these libs already incorporated?
Il giorno mer 25 nov 2020 alle ore 15:31 matiasdelellis <
notifications@github.com> ha scritto:
… Hi @spupuz <https://github.com/spupuz>
You must build your own nextcloud docker...
See.
https://github.com/matiasdelellis/facerecognition/wiki/Docker
And slowly read the comments from the dockerfile.. 😉
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#160 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANELQBSSU4DLHP4FCMXUODSRUIKXANCNFSM4IMOWWRA>
.
|
Officially nothing!. |
what happen when a new docker image is released and i update it with watchtower? |
can't face recognition deployed as a docker mods? https://github.com/linuxserver/docker-mods something like that? -e DOCKER_MODS=nc-facerecognition/nc-facerecognition:latest \ this is an example |
Hey guys, I've build a docker image and published it on docker hub. I will maintain this image. Everything is build on top of the official nextcloud apache image. Feel free to use it: https://hub.docker.com/r/iamklaus/nextcloud |
Here is an example of Dockerfile based on FROM nextcloud:fpm-alpine
# Add php pdlib which is used for face recognition app
RUN apk --update add --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing php7-pdlib
RUN cp /usr/lib/php7/modules/pdlib.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
RUN cp /etc/php7/conf.d/pdlib.ini /usr/local/etc/php/conf.d/pdlib.ini It doesn't require compilation since it uses existing upstream package. Keep in mind that it won't work for php and php-fpm binary in |
i saw this im trying to figure out how to run the docker compose for this could you please specify what you used for the docker-compose.yml |
Im wondering how hard it would be to also build it for armhf arch (for raspberry pi users).. |
Same as @jjbeto i have build a docker image and publish it on gitlab registry : https://gitlab.com/tclavier/docker-nextcloud-facerecognition/ Everything is build on top of the official nextcloud image. Just pull
I use this image for my personal nextcloud install. Is it possible to publish the docker image directly from this github repository ? without docker hub ... |
Hi, I'm using this docker container to try and setup face recognition.
The container has 8GB memory assigned, and is using less than 300MB. Edit: I fixed it, there is a known issue with the official docker that is discussed in this thread on the official nextcloud project. The commands I used to get this working (This is for my 8GB docker):
Hope this helps someone. Also, I'm running this on Unraid 6.9.2, I can provide a working unraid template if there's interest. |
Hello,
My Nextcloud runs in an docker container. Now i try to build facerecognition in this Container with an Dockerfile.
When i try to compile dlib i get this error.j
`FROM ubuntu:latest
RUN apt-get update && apt-get upgrade && apt-get -y install git-core cmake
RUN git clone https://github.com/davisking/dlib.git && cd dlib/dlib && mkdir build && cd build
RUN cmake -DBUILD_SHARED_LIBS=ON .. && make && sudo make install
`
But i get this error.
Sending build context to Docker daemon 2.048kB Step 1/4 : FROM ubuntu:latest ---> a2a15febcdf3 Step 2/4 : RUN apt-get update && apt-get upgrade && apt-get -y install git-core cmake ---> Using cache ---> 5e58a14b9367 Step 3/4 : RUN git clone https://github.com/davisking/dlib.git && cd dlib/dlib && mkdir build && cd build ---> Using cache ---> ff446b74921d Step 4/4 : RUN cmake -DBUILD_SHARED_LIBS=ON .. && make && sudo make install ---> Running in 12230f7ce1e5 CMake Error: The source directory "/" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. The command '/bin/sh -c cmake -DBUILD_SHARED_LIBS=ON .. && make && sudo make install' returned a non-zero code: 1
What is wrong?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: