forked from datastax/php-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (48 loc) · 2.05 KB
/
Dockerfile
File metadata and controls
61 lines (48 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM php:8.4
WORKDIR /tmp/cassandra-php-driver
RUN apt update -y \
&& apt install python3 pip cmake unzip plocate build-essential git libuv1-dev libssl-dev libgmp-dev openssl zlib1g-dev libpcre2-dev -y \
&& pip install --break-system-packages setuptools git+https://github.com/apache/cassandra-ccm \
&& apt-get install -y wget gnupg ca-certificates \
&& mkdir -p /etc/apt/keyrings \
&& wget -O /etc/apt/keyrings/adoptium.gpg https://packages.adoptium.net/artifactory/api/gpg/key/public \
&& echo "deb [signed-by=/etc/apt/keyrings/adoptium.gpg] https://packages.adoptium.net/artifactory/deb bookworm main" > /etc/apt/sources.list.d/adoptium.list \
&& apt-get update \
&& apt-get install -y temurin-11-jdk \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p ~/.ccm && echo '[repositories]\ncassandra = https://dlcdn.apache.org/cassandra' > ~/.ccm/config
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin
RUN docker-php-source extract \
&& install-php-extensions @composer intl zip pcntl gmp ast xdebug yaml
COPY lib lib
RUN cmake -DCMAKE_CXX_FLAGS="-fPIC" -DCASS_BUILD_STATIC=OFF -DCASS_BUILD_SHARED=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCASS_USE_ZLIB=ON lib/cpp-driver \
&& make -j$(nproc) \
&& make install
RUN docker-php-source extract
COPY ext ext
ENV NO_INTERACTION=true
RUN cd ext \
&& phpize \
&& LDFLAGS="-L/usr/local/lib" LIBS="-lssl -lz -luv -lm -lgmp -lstdc++" ./configure --with-cassandra=/usr/local \
&& make -j$(nproc) \
&& make test \
&& make install \
&& mv cassandra.ini /usr/local/etc/php/conf.d/docker-php-ext-cassandra.ini \
&& cd ..
RUN ext/doc/generate_doc.sh
COPY composer.json .
RUN composer install -n
ARG CI
ENV CI=$CI
COPY support support
COPY tests tests
COPY phpunit.xml .
ENV JAVA_HOME=/usr
RUN bin/phpunit --stop-on-error --stop-on-failure --testsuite unit
RUN bin/phpunit --stop-on-error --stop-on-failure --testsuite integration
COPY features features
COPY behat.yml .
RUN bin/behat --stop-on-failure --tags="~@skip-ci"
RUN make clean \
&& make clean -C ext
CMD ["bash"]