extract duplicate command

This commit is contained in:
Shao Yu-Lung (Allen) 2021-04-07 21:27:03 +08:00
parent 360dfbe6ec
commit 07cd057cec
2 changed files with 10 additions and 8 deletions

View File

@ -41,10 +41,11 @@ RUN pecl channel-update pecl.php.net; \
docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl
RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install memcached-2.2.0 mcrypt-1.0.1 && docker-php-ext-enable memcached \ pecl install memcached-2.2.0 mcrypt-1.0.1; \
;else \ else \
pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached \ pecl install memcached mcrypt-1.0.1; \
;fi fi; \
docker-php-ext-enable memcached
# Add a non-root user to help install ffmpeg: # Add a non-root user to help install ffmpeg:
ARG PUID=1000 ARG PUID=1000

View File

@ -40,10 +40,11 @@ RUN pecl channel-update pecl.php.net; \
docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl
RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install memcached-2.2.0 mcrypt-1.0.1 && docker-php-ext-enable memcached \ pecl install memcached-2.2.0 mcrypt-1.0.1; \
;else \ else \
pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached \ pecl install memcached mcrypt-1.0.1; \
;fi fi; \
docker-php-ext-enable memcached
# Add a non-root user: # Add a non-root user:
ARG PUID=1000 ARG PUID=1000