-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (59 loc) · 2.46 KB
/
Dockerfile
File metadata and controls
61 lines (59 loc) · 2.46 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:7.4-fpm
MAINTAINER pizepei "pizepei@pizepei.com"
ENV COMPOSER_HOME /root/composer
#设置时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
#更新安装依赖包和PHP核心拓展
&& apt-get update \
#重新安装 libzip
#删除重新安装 libzip
#RUN apt-get remove libzip
#重新安装 libzip 编译需要 make
&& apt-get -y install gcc automake autoconf libtool cmake git \
libfreetype6-dev libjpeg62-turbo-dev \
openssl libpng-dev libssl-dev \
#编译 libzip
&& cd /home/ && curl https://libzip.org/download/libzip-1.5.1.tar.gz >>libzip-1.5.1.tar.gz \
&& tar -zxvf libzip-1.5.1.tar.gz \
&& cd libzip-1.5.1 \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make && make install \
#更新安装依赖包和PHP核心拓展
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install opcache \
&& docker-php-ext-install zip \
#&& docker-php-ext-install mysqli \
#将预先下载好的拓展包从宿主机拷贝进去
#COPY ./pkg/redis.tgz /home/redis.tgz
#COPY ./pkg/ssh2.tgz /home/ssh2.tgz
#COPY ./pkg/libssh2.tar.gz /home/libssh2.tar.gz
#安装 libssh2 curl -sS https://www.libssh2.org/download/libssh2-1.9.0.tar.gz && tar -zxvf libssh2-1.9.0.tar.gz && cd libssh2-1.9.0/
&& cd /home/ \
&& curl https://www.libssh2.org/download/libssh2-1.9.0.tar.gz >>libssh2-1.9.0.tar.gz \
&& tar -zxvf libssh2-1.9.0.tar.gz && cd libssh2-1.9.0/ \
&& ./configure && make && make install \
#安装 PECL 拓展,这里我们安装的是Redis ssh2 http://pecl.php.net/get/ssh2-1.2.tgz
&& pecl install igbinary && printf "yes\nyes\n" | pecl install redis-5.3.1 \
&& pecl install ssh2-1.2 \
&& printf "y\y\y" | pecl install swoole \
&& docker-php-ext-enable ssh2 redis swoole igbinary \
#安装第三方拓展,这里是 Phalcon 拓展
#安装 Composer
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
# 清除不需要的数据
&& printf "y" | apt-get remove --purge cmake automake autoconf libtool \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /home/* \
&& apt-get clean \
&& printf "y" | apt-get autoclean \
&& printf "y" | apt-get autoremove \
&& dpkg -l |grep ^rc|awk '{print $2}' | xargs dpkg -P
ENV PATH $COMPOSER_HOME/vendor/bin:$PATH
WORKDIR /data
# Write Permission
RUN usermod -u 1000 www-data