forked from composer/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.template
33 lines (24 loc) · 1.09 KB
/
Dockerfile.template
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
FROM php:7-alpine
RUN apk --no-cache add curl git subversion openssh openssl mercurial tini bash zlib-dev
RUN echo "memory_limit=-1" > "$PHP_INI_DIR/conf.d/memory-limit.ini" \
&& echo "date.timezone=${PHP_TIMEZONE:-UTC}" > "$PHP_INI_DIR/conf.d/date_timezone.ini"
RUN docker-php-ext-install zip
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp
ENV COMPOSER_VERSION %COMPOSER_VERSION%
RUN curl -s -f -L -o /tmp/installer.php %COMPOSER_INSTALLER_URL% \
&& php -r " \
\$signature = '%COMPOSER_INSTALLER_HASH%'; \
\$hash = hash('SHA384', file_get_contents('/tmp/installer.php')); \
if (!hash_equals(\$signature, \$hash)) { \
unlink('/tmp/installer.php'); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit(1); \
}" \
&& php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer --version=${COMPOSER_VERSION} \
&& composer --ansi --version --no-interaction \
&& rm -rf /tmp/* /tmp/.htaccess
COPY docker-entrypoint.sh /docker-entrypoint.sh
WORKDIR /app
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["composer"]