Commit 6acf8125 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Split extension compile script

parent c7a99a83
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -15,7 +15,9 @@ FROM php:${php_version:+$php_version-}fpm-alpine as deps
RUN --mount=type=bind,source=scripts/install-deps.sh,target=/stage /stage

FROM deps as compile
RUN --mount=type=bind,source=scripts/compile.sh,target=/stage /stage
RUN --mount=type=bind,source=scripts/install-build-deps.sh,target=/stage /stage
RUN --mount=type=bind,source=scripts/compile-dist-ext.sh,target=/stage /stage
RUN --mount=type=bind,source=scripts/compile-imagick.sh,target=/stage /stage

FROM deps as fastcgi

+0 −25
Original line number Diff line number Diff line
#!/bin/bash
set -eux

# Packaged build dependencies
BUILD_DEPS=(
	autoconf
	build-base
	git
	gmp-dev
	imagemagick-dev
	jpeg-dev
	libpng-dev
	libwebp-dev
	libzip-dev
)

# Distributed extensions
PHP_EXT=(
	bcmath
@@ -31,10 +18,6 @@ php_version() {
		return 1
}

# Install packaged dependencies
apk update
apk add "${BUILD_DEPS[@]}"

# Build & install distributed extensions
if php_version -gt 7.4; then
	GD_ARGS=( --with-jpeg=/usr --with-webp=/usr )
@@ -43,11 +26,3 @@ else
fi
docker-php-ext-configure gd "${GD_ARGS[@]}"
docker-php-ext-install -j$(nproc) "${PHP_EXT[@]}"

# Download, build & install the Image Magick extension
cd $(mktemp -d)
git clone --depth 1 https://github.com/imagick/imagick.git .
phpize
./configure
make install
echo "extension=imagick.so" > /usr/local/etc/php/conf.d/imagick.ini
+11 −0
Original line number Diff line number Diff line
#!/bin/bash
set -eux

cd $(mktemp -d)

git clone --depth 1 https://github.com/imagick/imagick.git .
phpize
./configure
make install

echo "extension=imagick.so" > /usr/local/etc/php/conf.d/imagick.ini
+15 −0
Original line number Diff line number Diff line
#!/bin/sh
set -eux

# Install packaged dependencies
apk update
apk add \
	autoconf \
	build-base \
	git \
	gmp-dev \
	imagemagick-dev \
	jpeg-dev \
	libpng-dev \
	libwebp-dev \
	libzip-dev \