Skip to content

Commit

Permalink
Merge pull request #82 from blar/alpine
Browse files Browse the repository at this point in the history
Use alpine linux to reduce image size
  • Loading branch information
overtrue authored Sep 24, 2020
2 parents a3be12b + 2800b5e commit 36f3726
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
ARG VERSION=7.3
FROM php:${VERSION}-cli

RUN set -xe \
&& apt-get update \
&& apt-get install -y git unzip \
&& rm -rf /var/lib/apt/lists/* \
# Install composer
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php composer-setup.php --install-dir /usr/local/bin --filename composer \
&& php -r "unlink('composer-setup.php');" \
# Copy default php.ini
&& cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini \
&& composer global require overtrue/phplint
FROM composer:1.10 AS build
RUN composer global require overtrue/phplint

FROM php:${VERSION}-cli-alpine
COPY --from=build /tmp/vendor /root/.composer/vendor
COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh
RUN cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini

ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit 36f3726

Please sign in to comment.