forked from factorysh/docker-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.7.x-cli
44 lines (39 loc) · 1.5 KB
/
Dockerfile.7.x-cli
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
FROM bearstech/debian:stretch
ARG PHP_MINOR_VERSION
ARG uid=1000
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
lsb-release \
msmtp \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /usr/bin/msmtp /usr/local/bin/sendmail \
&& ln -sf /proc/1/fd/2 /var/log/msmtp.log \
&& touch /etc/msmtprc \
&& chmod 640 /etc/msmtprc \
&& curl https://packages.sury.org/php/apt.gpg -o /etc/apt/trusted.gpg.d/php-sury.gpg \
&& echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee -a /etc/apt/sources.list.d/php-sury.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
php7.${PHP_MINOR_VERSION}-cli \
php7.${PHP_MINOR_VERSION}-curl \
php7.${PHP_MINOR_VERSION}-gd \
php7.${PHP_MINOR_VERSION}-mbstring \
php7.${PHP_MINOR_VERSION}-mysql \
php7.${PHP_MINOR_VERSION}-xml \
php7.${PHP_MINOR_VERSION}-zip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd php --uid ${uid} --shell /bin/bash \
&& chown php /etc/msmtprc
COPY config_msmtp.sh /usr/local/bin/
COPY entrypoint_cli.sh /usr/local/bin
USER php
WORKDIR /home/php
ENTRYPOINT ["entrypoint_cli.sh"]
CMD ["php"]