Skip to content

Commit

Permalink
Add composer images
Browse files Browse the repository at this point in the history
  • Loading branch information
jalendport committed Jul 25, 2024
1 parent c15907f commit 2631293
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/composer-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Composer Images
on:
push:
branches:
- master
paths:
- composer/**
- .github/workflows/composer-images.yml
- .github/workflows/generic.yml
workflow_dispatch:
jobs:
generic:
uses: ./.github/workflows/generic.yml
with:
image-name: "composer"
filters: |
shared: &shared
- composer/README.md
- .github/workflows/composer-images.yml
- .github/workflows/generic.yml
composer-1.10:
- composer/1.10/**
- *shared
composer-2.7:
- composer/2.7/**
- *shared
aliases: |
composer-2.7:
- latest
secrets: inherit
65 changes: 65 additions & 0 deletions composer/1.10/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
FROM php:8.3-cli-alpine

# https://github.com/docker-library/php/issues/105#issuecomment-249716758
RUN apk add --no-cache --virtual .build-deps \
# Build dependencies
$PHPIZE_DEPS \
freetype-dev \
icu-dev \
imagemagick-dev \
libjpeg-turbo-dev \
libpng-dev \
libtool \
libxml2-dev \
libzip-dev \
&& apk add --no-cache \
# Runtime dependencies
freetype \
git \
gnu-libiconv \
icu \
imagemagick \
libgomp \
libjpeg-turbo \
libpng \
libxml2 \
libzip \
mysql-client \
zip \
# Pecl extensions
# && pecl install \
# imagick \
# Imagick is installed from the archive because regular installation fails
# See: https://github.com/Imagick/imagick/issues/643#issuecomment-1834361716
&& curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz \
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
&& phpize \
&& ./configure \
&& make \
&& make install \
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
&& rm -rf /tmp/* \
# Configure extensions
&& docker-php-ext-configure \
gd --with-freetype --with-jpeg \
# Install extensions
&& docker-php-ext-install -j$(nproc) \
bcmath \
gd \
intl \
pdo_mysql \
soap \
zip \
# Enable extensions
&& docker-php-ext-enable \
imagick \
# Remove dependencies
&& apk del .build-deps

COPY --from=composer:1.10 /usr/bin/composer /usr/local/bin/composer

RUN mkdir -p /app

WORKDIR /app

CMD ["composer"]
65 changes: 65 additions & 0 deletions composer/2.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
FROM php:8.3-cli-alpine

# https://github.com/docker-library/php/issues/105#issuecomment-249716758
RUN apk add --no-cache --virtual .build-deps \
# Build dependencies
$PHPIZE_DEPS \
freetype-dev \
icu-dev \
imagemagick-dev \
libjpeg-turbo-dev \
libpng-dev \
libtool \
libxml2-dev \
libzip-dev \
&& apk add --no-cache \
# Runtime dependencies
freetype \
git \
gnu-libiconv \
icu \
imagemagick \
libgomp \
libjpeg-turbo \
libpng \
libxml2 \
libzip \
mysql-client \
zip \
# Pecl extensions
# && pecl install \
# imagick \
# Imagick is installed from the archive because regular installation fails
# See: https://github.com/Imagick/imagick/issues/643#issuecomment-1834361716
&& curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz \
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
&& phpize \
&& ./configure \
&& make \
&& make install \
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
&& rm -rf /tmp/* \
# Configure extensions
&& docker-php-ext-configure \
gd --with-freetype --with-jpeg \
# Install extensions
&& docker-php-ext-install -j$(nproc) \
bcmath \
gd \
intl \
pdo_mysql \
soap \
zip \
# Enable extensions
&& docker-php-ext-enable \
imagick \
# Remove dependencies
&& apk del .build-deps

COPY --from=composer:2.7 /usr/bin/composer /usr/local/bin/composer

RUN mkdir -p /app

WORKDIR /app

CMD ["composer"]
1 change: 1 addition & 0 deletions composer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# jalendport/spark-composer

0 comments on commit 2631293

Please sign in to comment.