Skip to content

Commit

Permalink
fix docker matrix builds (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
norbybaru authored Jan 20, 2021
1 parent a3488c2 commit 1242717
Show file tree
Hide file tree
Showing 7 changed files with 247 additions and 3 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG VERSION
ARG BASE_IMAGE

FROM php:$VERSION-$BASE_IMAGE

ARG VERSION
ARG DIRECTORY="tags/${VERSION}"
ARG EXECUTABLE="extentions.sh"
ARG TAG_FILE="${DIRECTORY}/${EXECUTABLE}"

LABEL maintainer="Norby Baruani <[email protected]/>"

RUN apk add --no-cache --upgrade bash

COPY tags tags

RUN chmod +x $TAG_FILE
RUN ./${TAG_FILE}

RUN rm -rf tags

# DIR
WORKDIR /var/www/app

CMD ["php-fpm"]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# PHP FPM-Alpine
[![Build Status](https://travis-ci.org/norbybaru/docker-php-alpine.svg?branch=master)](https://travis-ci.org/norbybaru/docker-php-alpine)

# Tags

# Local Build
```bash
REPO_NAME=norby/php-alpine BASE_IMAGE=fpm-alpine VERSION=7.4 ./hooks/build.sh
``
```
4 changes: 2 additions & 2 deletions hooks/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
TAG="${REPO_NAME}:${VERSION}"

set -eux
docker build \
DOCKER_BUILDKIT=1 docker build \
--no-cache \
-t "$TAG" \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg VERSION=$VERSION \
--build-arg BASE_IMAGE=$BASE_IMAGE \
-f "tags/$VERSION/Dockerfile" \
.

image_id=$(docker images $TAG --format "{{.ID}}")
Expand Down
53 changes: 53 additions & 0 deletions tags/7.1/extentions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

set -eux \
&& apk update \
&& apk upgrade \
&& apk add --no-cache --virtual .build_deps \
$PHPIZE_DEPS \
curl-dev \
imagemagick-dev \
libtool \
libxml2-dev \
make \
gcc > /dev/null \
&& apk add --no-cache \
zlib-dev \
libzip-dev \
curl \
imagemagick \
mysql-client \
libintl > /dev/null \
libpng-dev \
icu-dev \
icu \
vim \
unzip \
composer \
nodejs \
bash > /dev/null \
&& docker-php-ext-configure \
zip --with-libzip > /dev/null \
&& docker-php-ext-install \
curl \
iconv \
mbstring \
pdo \
pdo_mysql \
mysqli \
pcntl \
tokenizer \
xml \
zip \
intl \
ctype \
bcmath \
json \
gd > /dev/null \
&& pecl install \
imagick > /dev/null \
&& docker-php-ext-enable \
imagick \
mysqli > /dev/null \
&& apk del --no-cache -f .build_deps \
&& rm -f /var/cache/apk/*
53 changes: 53 additions & 0 deletions tags/7.2/extentions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

set -eux \
&& apk update \
&& apk upgrade \
&& apk add --no-cache --virtual .build_deps \
$PHPIZE_DEPS \
curl-dev \
imagemagick-dev \
libtool \
libxml2-dev \
make \
gcc > /dev/null \
&& apk add --no-cache \
zlib-dev \
libzip-dev \
curl \
imagemagick \
mysql-client \
libintl > /dev/null \
libpng-dev \
icu-dev \
icu \
vim \
unzip \
composer \
nodejs \
bash > /dev/null \
&& docker-php-ext-configure \
zip --with-libzip > /dev/null \
&& docker-php-ext-install \
curl \
iconv \
mbstring \
pdo \
pdo_mysql \
mysqli \
pcntl \
tokenizer \
xml \
zip \
intl \
ctype \
bcmath \
json \
gd > /dev/null \
&& pecl install \
imagick > /dev/null \
&& docker-php-ext-enable \
imagick \
mysqli > /dev/null \
&& apk del --no-cache -f .build_deps \
&& rm -f /var/cache/apk/*
53 changes: 53 additions & 0 deletions tags/7.3/extentions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

set -eux \
&& apk update \
&& apk upgrade \
&& apk add --no-cache --virtual .build_deps \
$PHPIZE_DEPS \
curl-dev \
imagemagick-dev \
libtool \
libxml2-dev \
make \
gcc > /dev/null \
&& apk add --no-cache \
zlib-dev \
libzip-dev \
curl \
imagemagick \
mysql-client \
libintl > /dev/null \
libpng-dev \
icu-dev \
icu \
vim \
unzip \
composer \
nodejs \
bash > /dev/null \
&& docker-php-ext-configure \
zip --with-libzip > /dev/null \
&& docker-php-ext-install \
curl \
iconv \
mbstring \
pdo \
pdo_mysql \
mysqli \
pcntl \
tokenizer \
xml \
zip \
intl \
ctype \
bcmath \
json \
gd > /dev/null \
&& pecl install \
imagick > /dev/null \
&& docker-php-ext-enable \
imagick \
mysqli > /dev/null \
&& apk del --no-cache -f .build_deps \
&& rm -f /var/cache/apk/*
58 changes: 58 additions & 0 deletions tags/7.4/extentions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

set -eux \
&& apk update \
&& apk upgrade \
&& apk add --no-cache --virtual .build_deps \
$PHPIZE_DEPS \
curl-dev \
freetype-dev \
imagemagick-dev \
libtool \
libxml2-dev \
libpng-dev \
libjpeg-turbo-dev \
make \
oniguruma-dev \
gcc > /dev/null \
&& apk add --no-cache \
zlib-dev \
libzip-dev \
curl \
imagemagick \
mysql-client \
libintl \
libpng \
libjpeg-turbo \
icu-dev \
icu \
freetype \
vim \
unzip \
composer \
nodejs \
bash > /dev/null \
&& docker-php-ext-configure \
gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ > /dev/null \
&& docker-php-ext-install \
mbstring \
pdo \
pdo_mysql \
mysqli \
pcntl \
tokenizer \
xml \
zip \
intl \
ctype \
bcmath \
json \
-j$(nproc) gd > /dev/null \
&& pecl install \
imagick > /dev/null \
&& docker-php-ext-enable \
gd \
imagick \
mysqli > /dev/null \
&& apk del --no-cache -f .build_deps \
&& rm -f /var/cache/apk/*

0 comments on commit 1242717

Please sign in to comment.