forked from my127/workspace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (42 loc) · 1.41 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
ARG PHP_VERSION
FROM php:${PHP_VERSION}
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -s dist-upgrade | grep "^Inst" | \
grep -i securi | awk -F " " '{print $2}' | \
xargs apt-get -qq -y --no-install-recommends install \
\
# Install base packages \
&& DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \
git \
libzip-dev \
libzip4 \
wget \
zlib1g-dev \
\
# Install php extension deps \
&& docker-php-ext-install zip \
\
# Clean the image \
&& apt-get remove -qq -y zlib1g-dev libzip-dev \
&& apt-get auto-remove -qq -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
\
# Create the build user \
&& useradd --create-home --system build \
# Update PHP ini values
&& cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini \
&& sed -i 's/;phar.readonly = On/phar.readonly = Off/g' /usr/local/etc/php/php.ini \
\
# Install composer for PHP dependencies \
&& wget https://getcomposer.org/installer -O /tmp/composer-setup.php -q \
&& [ "$(wget https://composer.github.io/installer.sig -O - -q)" = "$(sha384sum /tmp/composer-setup.php | awk '{ print $1 }')" ] \
&& php /tmp/composer-setup.php --install-dir='/usr/local/bin/' --filename='composer' --quiet \
&& rm /tmp/composer-setup.php \
\
# Create app dir \
&& mkdir /app
WORKDIR /app
COPY ./tools/builder/root/ /
ENTRYPOINT ["/entrypoint.sh"]
CMD ["sleep", "infinity"]