From cc39e12c8bb2f113d03cb233afc88e81b53db61a Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Thu, 11 Jan 2018 17:13:20 +0000 Subject: [PATCH 1/2] Remove composer cache --- Dockerfile | 1 + Dockerfile-alpine | 1 + 2 files changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1a12f7e1..9fe41988 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends $TOOL_DEPS $BUI && echo "memory_limit=-1" >> $PHP_INI_DIR/php.ini \ && echo "phar.readonly=0" >> $PHP_INI_DIR/php.ini \ && php /usr/local/bin/tools.php install \ + && rm -rf ~/.composer/cache \ && apt-get purge -y --auto-remove $BUILD_DEPS CMD php /usr/local/bin/tools.php list diff --git a/Dockerfile-alpine b/Dockerfile-alpine index 388d9ece..44556d18 100644 --- a/Dockerfile-alpine +++ b/Dockerfile-alpine @@ -21,6 +21,7 @@ RUN apk add --no-cache --virtual .tool-deps $TOOL_DEPS $LIB_DEPS \ && echo "memory_limit=-1" >> $PHP_INI_DIR/php.ini \ && echo "phar.readonly=0" >> $PHP_INI_DIR/php.ini \ && php /usr/local/bin/tools.php install \ + && rm -rf ~/.composer/cache \ && apk del .build-deps CMD php /usr/local/bin/tools.php list From ad4ac64db609531f7d59933c0ad078e48bc965e6 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Thu, 11 Jan 2018 17:13:43 +0000 Subject: [PATCH 2/2] Build both images on "make build" --- .travis.yml | 2 +- Makefile | 7 +++++-- README.md | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ea48a4b..c18defdf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: fast_finish: true script: - - if [ "$flavour" = "latest" ]; then make build; else make build-alpine; fi + - if [ "$flavour" = "latest" ]; then make build-latest; else make build-alpine; fi - docker run -it --rm jakzal/phpqa:$flavour php /usr/local/bin/tools.php test - docker run -it --rm jakzal/phpqa:$flavour diff --git a/Makefile b/Makefile index 66ce471e..2ece4ae6 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,12 @@ default: build -build: - docker build -t jakzal/phpqa:latest . +build: build-latest build-alpine .PHONY: build +build-latest: + docker build -t jakzal/phpqa:latest . +.PHONY: build-latest + build-alpine: docker build -f Dockerfile-alpine -t jakzal/phpqa:alpine . .PHONY: build-alpine diff --git a/README.md b/README.md index 14f82bcb..8645ec05 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ phpqa phpstan analyse src ```bash git clone https://github.com/jakzal/phpqa.git cd phpqa -make build +make build-latest ``` To build the alpine version: