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

Error during the build when using php:fpm-alpine as the base image #25

Closed
EvgenyOrekhov opened this issue Dec 9, 2016 · 2 comments
Closed

Comments

@EvgenyOrekhov
Copy link

If I replace FROM alpine:latest with FROM php:fpm-alpine in alpine/Dockerfile, I get the following error during the build:

DYNLINK   libluajit.so
/usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: lj_err_dyn.o: relocation R_X86_64_TPOFF32 against `static_uex' can not be used when making a shared object; recompile with -fPIC
lj_err_dyn.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:702: recipe for target 'libluajit.so' failed
make[1]: Leaving directory '/tmp/openresty-1.11.2.2/build/LuaJIT-2.1-20161104/src'
make[1]: *** [libluajit.so] Error 1
make: *** [default] Error 2
Makefile:111: recipe for target 'default' failed
ERROR: failed to run command: make -j1 TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/openresty/luajit

Could you help me figure out how to fix it, please?

P. S. I understand that this issue should not be in this repo, because there is nothing wrong with your Dockerfile, I just wanted to get help from the experts.

@neomantra
Copy link
Member

neomantra commented Dec 9, 2016

It looks like php:fpm-alpine is using ENV instead of ARG in their Dockerfile. Thus they are polluting CFLAGS, CPPFLAGS, and LDFLAGS. The openresty build is picking those up and is not happy about it (notably wants fPIC instead of fPIE) . They should switch to ARG -- perhaps submit an issue with them.

You can modify the docker-openresty Dockerfile and put this right above the RUN command:

ENV CFLAGS ""
ENV CPPFLAGS ""
ENV LDFLAGS ""

I just tested it and it builds alpine.

@EvgenyOrekhov
Copy link
Author

@neomantra Thank you! You saved my day! I will submit an issue to the PHP guys.

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