-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
105 lines (96 loc) · 3.07 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
FROM centos:centos7
MAINTAINER penggang
ENV SRC_DIR /usr/local
ENV PHP_VERSION 7.2.24
ENV SWOOLE_VERSION 4.4.9
ENV PHP_DIR /usr/local/php/${PHP_VERSION}
ENV PHP_INI_DIR /etc/php/${PHP_VERSION}/cli
ENV INIT_INSTALL ${PHP_INI_DIR}/conf.d
ENV PHPREDIS_VERSION 3.1.6
ENV PHPDS_VERSION 1.2.4
ENV PHPINOTIFY_VERSION 2.0.0
#set ldconf
RUN echo "include /etc/ld.so.conf.d/*.conf" > /etc/ld.so.conf \
&& cd /etc/ld.so.conf.d \
&& echo "/usr/local/lib" > /etc/ld.so.conf.d/libc.conf
# tools
RUN yum -y install file \
wget \
gcc \
make \
autoconf \
libxml2 \
libxml2-devel \
openssl \
openssl-devel \
curl \
curl-devel \
pcre \
pcre-devel \
libxslt \
libxslt-devel \
bzip2-devel \
libedit \
libedit-devel \
glibc-headers \
gcc-c++ \
&& rm -rf /var/cache/{yum,ldconfig}/* \
&& rm -rf /etc/ld.so.cache \
&& yum clean all
# php
ADD file/php-${PHP_VERSION}.tar.gz ${SRC_DIR}/
RUN cd ${SRC_DIR}/php-${PHP_VERSION} \
&& ln -s /usr/lib64/libssl.so /usr/lib \
&& ./configure --prefix=${PHP_DIR} \
--with-config-file-path=${PHP_INI_DIR} \
--with-config-file-scan-dir="${PHP_INI_DIR}/conf.d" \
--disable-cgi \
--enable-bcmath \
--enable-mbstring \
--enable-mysqlnd \
--enable-opcache \
--enable-pcntl \
--enable-xml \
--enable-zip \
--with-curl \
--with-libedit \
--with-openssl \
--with-zlib \
--with-curl \
--with-mysqli \
--with-pear \
&& make clean > /dev/null \
&& make \
&& make install \
&& ln -s ${PHP_DIR}/bin/php /usr/local/bin/ \
&& ln -s ${PHP_DIR}/bin/phpize /usr/local/bin/ \
&& ln -s ${PHP_DIR}/bin/pecl /usr/local/bin/ \
&& ln -s ${PHP_DIR}/bin/php-config /usr/local/bin/ \
&& mkdir -p ${PHP_INI_DIR}/conf.d \
&& cp ${SRC_DIR}/php-${PHP_VERSION}/php.ini-production ${PHP_INI_DIR}/php.ini \
&& echo -e "opcache.enable=1\nopcache.enable_cli=1\nzend_extension=opcache.so" > ${PHP_INI_DIR}/conf.d/10-opcache.ini \
&& rm -f ${SRC_DIR}/php-${PHP_VERSION}.tar.gz \
&& rm -rf ${SRC_DIR}/php-${PHP_VERSION}
# swoole
ADD file/swoole-${SWOOLE_VERSION}.tar.gz ${SRC_DIR}/
RUN cd ${SRC_DIR}/swoole-${SWOOLE_VERSION} \
&& phpize \
&& ./configure --enable-async-redis --enable-openssl --enable-coroutine \
&& make clean > /dev/null \
&& make \
&& make install \
&& echo "extension=swoole.so" > ${INIT_INSTALL}/swoole.ini \
&& rm -f ${SRC_DIR}/swoole-${SWOOLE_VERSION}.tar.gz \
&& rm -rf ${SRC_DIR}/swoole-${SWOOLE_VERSION}
# inotify
ADD file/inotify-${PHPINOTIFY_VERSION}.tar.gz ${SRC_DIR}/
RUN cd ${SRC_DIR}/php-inotify-${PHPINOTIFY_VERSION} \
&& phpize \
&& ./configure \
&& make clean > /dev/null \
&& make \
&& make install \
&& echo "extension=inotify.so" > ${INIT_INSTALL}/inotify.ini \
&& rm -f ${SRC_DIR}/inotify-${PHPINOTIFY_VERSION}.tar.gz \
&& rm -rf ${SRC_DIR}/php-inotify-${PHPINOTIFY_VERSION}
COPY ./config/* ${INIT_INSTALL}/