-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
49 lines (41 loc) · 1.42 KB
/
Dockerfile
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
FROM php:8.4-cli
# enable ffi and install librdkafka
ARG LIBRDKAFKA_VERSION=v2.8.0
ENV LIBRDKAFKA_VERSION=$LIBRDKAFKA_VERSION
RUN set -e; \
apt-get update; \
apt-get install -y --no-install-recommends git zip unzip gdb libffi-dev libc6-dev; \
docker-php-ext-configure ffi; \
docker-php-ext-install -j$(nproc) ffi pcntl; \
git clone --branch "${LIBRDKAFKA_VERSION}" --depth 1 https://github.com/confluentinc/librdkafka.git /tmp/librdkafka; \
cd /tmp/librdkafka; \
./configure; \
make; \
make install; \
ldconfig; \
apt-get autoremove -y; \
rm -rf /var/lib/apt/lists/*; \
rm -rf /tmp/*;
# install xdebug
ARG XDEBUG_VERSION=stable
RUN pecl install xdebug-${XDEBUG_VERSION}; \
docker-php-ext-enable xdebug;
# install rdkafka ext - this is just required to run the compatibility tests
ARG RDKAFKA_EXT_VERSION=6.x
RUN git clone --branch "$RDKAFKA_EXT_VERSION" --depth 1 https://github.com/arnaud-lb/php-rdkafka.git /tmp/php-rdkafka; \
cd /tmp/php-rdkafka; \
phpize; \
./configure; \
make; \
make install; \
rm -rf /tmp/*;
RUN apt-get install -y --no-install-recommends git zip unzip gdb libffi-dev libc6-dev;
ENV COMPOSER_HOME /tmp
ENV COMPOSER_ALLOW_SUPERUSER 1
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN useradd -Ms /bin/bash --user-group --uid 2000 phpdev; \
mkdir /app; \
chown phpdev -R /app; \
chown phpdev -R /tmp;
USER phpdev
WORKDIR /app