Skip to content

Commit 53d807b

Browse files
petercvNyholm
authored andcommitted
Added gmp extension. (#6)
1 parent ed9731e commit 53d807b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

layers/gmp/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
ARG PHP_VERSION
2+
FROM bref/build-php-$PHP_VERSION AS ext
3+
4+
# Fix library path
5+
ENV LD_LIBRARY_PATH=/usr/lib:/usr/lib64:$LD_LIBRARY_PATH
6+
7+
# Install packages
8+
RUN yum install -y gmp-devel
9+
10+
# Build PHP extension
11+
WORKDIR /tmp/build/php/ext/gmp
12+
RUN phpize && \
13+
./configure \
14+
--build=x86_64-pc-linux-gnu \
15+
--prefix=${INSTALL_DIR} \
16+
--enable-option-checking=fatal
17+
18+
RUN make -j $(nproc) install
19+
RUN cp /opt/bref/lib/php/extensions/no-debug-zts-*/gmp.so /tmp/gmp.so
20+
21+
# Build the final image from the lambci image that is close to the production environment
22+
FROM lambci/lambda:provided
23+
24+
# Copy things we installed to the final image
25+
COPY --from=ext /usr/include/gmp-mparam-x86_64.h /opt/bref/include/gmp-mparam-x86_64.h
26+
COPY --from=ext /usr/include/gmp-mparam.h /opt/bref/include/gmp-mparam.h
27+
COPY --from=ext /usr/include/gmp-x86_64.h /opt/bref/include/gmp-x86_64.h
28+
COPY --from=ext /usr/include/gmp.h /opt/bref/include/gmp.h
29+
COPY --from=ext /usr/include/gmpxx.h /opt/bref/include/gmpxx.h
30+
31+
COPY --from=ext /usr/lib64/libgmp.so /opt/bref/lib64/libgmp.so
32+
COPY --from=ext /usr/lib64/libgmpxx.so /opt/bref/lib64/libgmpxx.so
33+
34+
COPY --from=ext /tmp/gmp.so /opt/bref-extra/gmp.so

0 commit comments

Comments
 (0)