diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 564c050..a1a7b61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - run-ci: + build_latest: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -25,3 +25,27 @@ jobs: with: push: true tags: carlosalgms/composer-and-node-ci:latest + + build_71: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Login to Docker Hub + id: docker_login + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Build 7.1 and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + build-args: | + FROM_IMAGE=php:7.1 + PECL_EXT=imagick-3.5.1 + ENABLE_EXT=imagick + PHP_EXT=gd mysqli pdo_mysql opcache pspell mcrypt bcmath exif zip + tags: carlosalgms/composer-and-node-ci:php7.1 diff --git a/Dockerfile b/Dockerfile index 0e8447f..ea1369a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,23 @@ -FROM php:7 +ARG FROM_IMAGE=php:7 +FROM $FROM_IMAGE MAINTAINER Carlos A. Gomes RUN apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ gnupg2 \ apt-transport-https \ - && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ - && curl -sL https://deb.nodesource.com/setup_14.x | bash - \ - && apt-get install --no-install-recommends --no-install-suggests -y \ - nodejs \ unzip \ build-essential \ openssh-client \ rsync \ git \ - yarn \ default-mysql-client \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ + && curl -sL https://deb.nodesource.com/setup_14.x | bash - \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + nodejs \ + yarn \ # Slim down image && apt-get clean \ && rm -rf \ @@ -28,10 +29,20 @@ RUN apt-get update \ # Install composer && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ # Install Deployer - https://deployer.org/docs/getting-started.html - && curl -LO https://deployer.org/deployer.phar \ + && curl -LO https://deployer.org/releases/v6.8.0/deployer.phar \ && mv deployer.phar /usr/local/bin/dep \ && chmod +x /usr/local/bin/dep \ # Show versions && php -v \ && echo "node: `node -v` " \ && echo "npm: `npm -v`" + +ARG PECL_EXT="mcrypt-1.0.4 imagick-3.5.1" +RUN pecl install $PECL_EXT + +ARG PHP_EXT="gd mysqli pdo_mysql opcache pspell bcmath exif zip" +RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr; \ + docker-php-ext-install -j "$(nproc)" $PHP_EXT + +ARG ENABLE_EXT="mcrypt imagick" +RUN docker-php-ext-enable $ENABLE_EXT