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

Alpine docker: pHash.h:60:24: fatal error: sys/sysctl.h: No such file or directory #79

Open
dennisvandehoef opened this issue May 24, 2019 · 4 comments

Comments

@dennisvandehoef
Copy link

When installing version 1.2.0 in a Docker container running ruby:2.5.0-alpine I get the error.

As readable on https://dev.alpinelinux.org/irclogs/%23alpine-linux-2015-04.log
the fix might be easy, or alredy be in the latest version of pHash.

2015-04-21 23:50:24 I’m running into issues with https://github.com/gH0StArthour/pHash-0.9.6/blob/master/src/pHash.h#L60
2015-04-21 23:50:38 pHash.h:60:24: fatal error: sys/sysctl.h: No such file or directory
2015-04-21 23:51:34 Sounds like it’s a musl thing
2015-04-22 00:25:15 ericflo - install linux-headers & patch the sources to include linux/sysctl.h
2015-04-22 00:37:13 ok will take a look at that, not too sure what all that entails
2015-04-22 01:04:21 ericflo - find #include <sys/sysctl.h> in the header giving you the error - make a patch to replace it with #include <linux/sysctl.h>

Dockerfile to reproduce this error, that also installs the linux-headers

FROM ruby:2.5.0-alpine

RUN apk --no-cache update && apk add --update alpine-sdk tzdata linux-headers
RUN gem update --system && gem install bundler
RUN gem install phashion -v '1.2.0'
@viniciusalonso
Copy link

It seems for me that is missing some native extensions like imagemagick, libpng-dev, and libjpeg-dev.
Try adding it in your Dockerfile, it could solve this problem.

@dennisvandehoef
Copy link
Author

I tried to provide a minimal docker file, for easy/fast testing.
I have them included in my real docker.

If I add imagemagick-dev libpng-dev libjpeg ist still does not work.
Tried imagemagic 7 and imagemagic 6 ( imagemagick6-dev), libjpeg sadly is not provided in a dev version.

@tiendo1011
Copy link

@dennisvandehoef Have you found the solution for this?

@mtrolle
Copy link

mtrolle commented May 17, 2022

Anybody found a solution to this?

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

4 participants