Skip to content

Commit

Permalink
[fixed] mongodb build version
Browse files Browse the repository at this point in the history
  • Loading branch information
telanflow committed Jun 7, 2023
1 parent 04b4e30 commit d68575c
Show file tree
Hide file tree
Showing 7 changed files with 358 additions and 201 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">
<br>DNMP 1.5.0<br>
<br>DNMP 1.5<br>
</h1>

DNMP 可以构建出基于 Docker 的 PHP 开发环境,其优势有在短时间内随意构建不同版本的相关服务、环境统一分布在不同服务器等,使开发者能够更专注于开发业务本身。
Expand Down
42 changes: 18 additions & 24 deletions build/php56/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN \
fi; \
\
# ⬇ 更新、安装基础组件
apt-get update && apt-get install -y --no-install-recommends --allow-unauthenticated \
apt-get update --allow-unauthenticated && apt-get install -y --no-install-recommends --allow-unauthenticated \
wget \
zip \
gzip \
Expand All @@ -40,37 +40,34 @@ RUN \
telnet \
openssl \
libssl-dev \
apt-transport-https \
ca-certificates \
net-tools ; \
\
# gd
apt-get install -y --allow-unauthenticated \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libwebp-dev \
libxpm-dev ; \
\
# imagick
apt-get install -y --allow-unauthenticated libmagickwand-dev ; \
# intl
apt-get install -y --allow-unauthenticated icu-devtools libicu-dev zlib1g-dev ; \
\
apt-get install -y --allow-unauthenticated icu-devtools libicu-dev ; \
# soap xsl xmlrpc wddx readline
apt-get install -y --allow-unauthenticated libxml2-dev libxslt-dev libreadline-dev libedit-dev ; \
\
# bz2 mcrypt zip
apt-get install -y --allow-unauthenticated libbz2-dev libmcrypt-dev libzip-dev; \
\
# readline snmp
apt-get install -y --allow-unauthenticated libreadline-dev libsnmp-dev snmp ; \
\
# zstd
apt-get install -y --allow-unauthenticated libzstd-dev ; \
# ldap
apt-get install -y --allow-unauthenticated libldb-dev libldap2-dev ; \
\
apt-get install -y --allow-unauthenticated libldb-dev libldap2-dev libldap-common ; \
# mongodb
apt-get install -y --allow-unauthenticated libsasl2-dev libsnappy-dev zlib1g-dev ; \
# other
# graphicsmagick \
# libgraphicsmagick1-dev \
# imagemagick \
# libmagickwand-dev \
apt-get install -y --allow-unauthenticated \
libssl-dev \
libmhash-dev \
procps \
libtinfo5 \
Expand All @@ -82,27 +79,24 @@ RUN \
####################################################################################
# --with-freetype-dir=/usr/include/freetype2/ \

RUN docker-php-ext-configure gd --with-xpm-dir=/usr/include/ --with-jpeg-dir=/usr/include/ ; \
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-xpm-dir=/usr/include/ --with-jpeg-dir=/usr/include/ ; \
docker-php-ext-install -j$(nproc) gd ; \
\
# readline
docker-php-ext-configure readline --with-readline CPPFLAGS="-I/usr/include/readline" ; \
docker-php-ext-install readline ; \
\
# 常用扩展
docker-php-ext-install bcmath mcrypt exif ; \
\
# 其他
docker-php-ext-install mysqli \
pdo_mysql \
pgsql \
pdo_pgsql \
bcmath \
bz2 \
calendar \
exif \
gettext \
pcntl \
readline \
pgsql \
pdo_pgsql \
mcrypt \
shmop \
sockets \
wddx \
Expand All @@ -115,9 +109,9 @@ RUN docker-php-ext-configure gd --with-xpm-dir=/usr/include/ --with-jpeg-dir=/us
sysvmsg \
sysvsem \
sysvshm \
exif \
ldap ; \
# intl
docker-php-ext-configure intl --with-icu-dir=DEFAULT ; \
docker-php-ext-install intl ; \
# \
# ⬇ XDebug
Expand Down
75 changes: 46 additions & 29 deletions build/php72/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY resource /home/resource
ARG CHANGE_SOURCE=true
ARG TIME_ZONE=UTC

ARG MongoDB=mongodb-1.12.1.tgz
ARG MongoDB=mongodb-1.15.3.tgz
ARG OPEN_SWOOLE=openswoole-4.10.0.tgz
ARG SWOOLE=swoole-4.8.13.tgz
ARG REDIS=redis-5.3.7.tgz
Expand Down Expand Up @@ -33,9 +33,9 @@ RUN set -eux; \
\
# ⬇ 更新、安装基础组件
apt-get update; \
apt-get upgrade -y; \
apt-get install -y --allow-remove-essential --no-install-recommends \
# tools
apt-get upgrade -y --allow-unauthenticated ; \
# 基础
apt-get install -y --allow-remove-essential --no-install-recommends --allow-unauthenticated \
wget \
zip \
unzip \
Expand All @@ -44,44 +44,61 @@ RUN set -eux; \
vim \
iputils-ping \
telnet \
net-tools \
\
libmagickwand-dev \
libz-dev \
openssl \
libssl-dev \
apt-transport-https \
ca-certificates \
net-tools ; \
# gd
apt-get install -y --allow-unauthenticated libfreetype6-dev \
libjpeg62-turbo-dev \
libwebp-dev \
libpng-dev \
libjpeg-dev \
libvpx-dev \
libxpm-dev ; \
# imagick
apt-get install -y --allow-unauthenticated libmagickwand-dev libgraphicsmagick1-dev ; \
# intl
libicu-dev \
# bz2
libbz2-dev \
# zip
libzip-dev \
apt-get install -y --allow-unauthenticated libicu-dev libz-dev ; \
# bz2 zip
apt-get install -y --allow-unauthenticated libbz2-dev libzip-dev zlib1g-dev ; \
# imap
apt-get install -y --allow-unauthenticated libkrb5-dev ; \
# ldap
libldb-dev \
libldap2-dev \
apt-get install -y --allow-unauthenticated libldb-dev libldap2-dev ; \
# lz4
apt-get install -y --allow-unauthenticated liblz4-dev ; \
# snappy
apt-get install -y --allow-unauthenticated libsnappy-dev; \
# readline snmp
apt-get install -y --allow-unauthenticated libreadline-dev libsnmp-dev snmp ; \
# mcrypt
libmcrypt-dev \
apt-get install -y --allow-unauthenticated libmcrypt-dev ; \
# mongodb
apt-get install -y --allow-unauthenticated libicu-dev libsasl2-dev libsnappy-dev zlib1g-dev libsasl2-dev ; \
# redis
apt-get install -y --allow-unauthenticated libzstd-dev ; \
# swoole
apt-get install -y --allow-unauthenticated libcurl4-gnutls-dev libpq-dev ; \
# xmlrpc xsl yaml
apt-get install -y --allow-unauthenticated libxml2-dev libxslt-dev libyaml-dev ; \
# other
libtinfo5 \
libpq-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
libssl-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
zlib1g-dev \
libpng-dev \
apt-get install -y --allow-unauthenticated libtinfo5 \
procps \
libmhash-dev \
librabbitmq-dev \
uuid-dev \
libssh2-1-dev \
libzookeeper-mt-dev \
libpcre3-dev \
ntpdate ;

####################################################################################
# 安装 PHP 扩展
####################################################################################

RUN docker-php-ext-configure gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ ; \
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ ; \
docker-php-ext-install -j$(nproc) gd intl pdo_mysql ldap mysqli bz2 zip sockets pgsql pdo_pgsql bcmath soap pcntl; \
# \
# ⬇ XDebug
Expand Down
104 changes: 70 additions & 34 deletions build/php74/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY resource /home/resource
ARG CHANGE_SOURCE=true
ARG TIME_ZONE=UTC

ARG MongoDB=mongodb-1.12.1.tgz
ARG MongoDB=mongodb-1.15.3.tgz
ARG OPEN_SWOOLE=openswoole-4.10.0.tgz
ARG SWOOLE=swoole-4.8.13.tgz
ARG REDIS=redis-5.3.7.tgz
Expand Down Expand Up @@ -33,9 +33,9 @@ RUN set -eux; \
\
# ⬇ 更新、安装基础组件
apt-get update; \
apt-get upgrade -y; \
apt-get install -y --allow-remove-essential --no-install-recommends \
# tools
apt-get upgrade -y --allow-unauthenticated ; \
# 基础
apt-get install -y --allow-remove-essential --no-install-recommends --allow-unauthenticated \
wget \
zip \
unzip \
Expand All @@ -44,56 +44,88 @@ RUN set -eux; \
vim \
iputils-ping \
telnet \
net-tools \
\
libmagickwand-dev \
libz-dev \
openssl \
libssl-dev \
apt-transport-https \
ca-certificates \
net-tools ; \
# gd
apt-get install -y --allow-unauthenticated libfreetype6-dev \
libjpeg62-turbo-dev \
libwebp-dev \
libpng-dev \
libjpeg-dev \
libvpx-dev \
libxpm-dev ; \
# imagick
apt-get install -y --allow-unauthenticated libmagickwand-dev libgraphicsmagick1-dev ; \
# intl
libicu-dev \
# bz2
libbz2-dev \
# zip
libzip-dev \
apt-get install -y --allow-unauthenticated libicu-dev libz-dev ; \
# bz2 zip
apt-get install -y --allow-unauthenticated libbz2-dev libzip-dev zlib1g-dev ; \
# imap
apt-get install -y --allow-unauthenticated libkrb5-dev ; \
# ldap
libldb-dev \
libldap2-dev \
apt-get install -y --allow-unauthenticated libldb-dev libldap2-dev ; \
# lz4
apt-get install -y --allow-unauthenticated liblz4-dev ; \
# snappy
apt-get install -y --allow-unauthenticated libsnappy-dev; \
# readline snmp
apt-get install -y --allow-unauthenticated libreadline-dev libsnmp-dev snmp ; \
# mcrypt
libmcrypt-dev \
apt-get install -y --allow-unauthenticated libmcrypt-dev ; \
# mongodb
apt-get install -y --allow-unauthenticated libicu-dev libsasl2-dev libsnappy-dev zlib1g-dev libsasl2-dev ; \
# redis
apt-get install -y --allow-unauthenticated libzstd-dev ; \
# swoole
apt-get install -y --allow-unauthenticated libcurl4-gnutls-dev libpq-dev ; \
# xmlrpc xsl yaml
apt-get install -y --allow-unauthenticated libxml2-dev libxslt-dev libyaml-dev ; \
# other
libtinfo5 \
libpq-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
libssl-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
zlib1g-dev \
libpng-dev \
apt-get install -y --allow-unauthenticated libtinfo5 \
procps \
libmhash-dev \
librabbitmq-dev \
uuid-dev \
libssh2-1-dev \
libzookeeper-mt-dev \
libpcre3-dev \
ntpdate ;

####################################################################################
# 安装 PHP 扩展
####################################################################################

RUN docker-php-ext-configure gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ ; \
docker-php-ext-install -j$(nproc) gd intl pdo_mysql ldap mysqli bz2 zip sockets pgsql pdo_pgsql bcmath soap pcntl; \
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ ; \
docker-php-ext-install -j$(nproc) gd ; \
# 常用
docker-php-ext-install pdo_mysql \
mysqli \
pgsql \
pdo_pgsql \
bcmath \
pcntl \
bz2 \
zip \
sockets \
mbstring \
gettext \
calendar \
exif \
soap \
readline \
ldap; \
# intl
docker-php-ext-install intl ; \
# \
# ⬇ XDebug
# pecl install /home/resource/$XDEBUG ; \
\
# ⬇ Imagick
pecl install imagick && docker-php-ext-enable imagick; \
\
# ⬇ MongoDB
pecl install /home/resource/$MongoDB ; \
echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb.ini ; \
\
# ⬇ Redis
pecl install /home/resource/$REDIS ; \
echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini ; \
Expand All @@ -110,6 +142,10 @@ RUN docker-php-ext-configure gd \
pecl install /home/resource/$MCRYPT ; \
echo "extension=mcrypt.so" > /usr/local/etc/php/conf.d/mcrypt.ini ; \
\
# ⬇ MongoDB
pecl install /home/resource/$MongoDB ; \
echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb.ini ; \
\
# ⬇ 清理
rm -rf /var/lib/apt/lists/* ; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \
Expand Down
Loading

0 comments on commit d68575c

Please sign in to comment.