zmq4: Can't compile on Alpine Linux
I have a Golang application that utilizes pebbe/zmq4 and I’d love to be able to run it in Alpine Linux due to the much smaller container size. However, I get the following error:
apk update
apk install gcc pkgconfig zeromq-dev
go run main.go
# github.com/pebbe/zmq4
In file included from /go/src/github.com/pebbe/zmq4/ctxoptions_unix.go:6:0:
/usr/include/zmq.h:46:19: fatal error: errno.h: No such file or directory
compilation terminated.
I’m using the golang:1.5-alpine container available on Docker Hub.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (6 by maintainers)
In case someone has this issue in the future, here’s the needed commands:
This works:
Result:
@manveru Thank you very much For static link, I also need to add
libzmq-static libsodium-staticThank you @manveru I had the error:
ImportError: Error loading shared library libzmq.so.5: No such file or directory (needed by /usr/local/lib/python3.6/site-packages/zmq/backend/cython/error.cpython-36m-x86_64-linux-gnu.so)while trying to install zeromq-dev (and also libzmq) with the RUN command in a Dockerfile with alpine3.6. Adding only the first RUN command that you suggested already fixed the problem. Thanks!