Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
name: PHP ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
steps:
- uses: actions/checkout@v6

- name: Set up QEMU
uses: docker/setup-qemu-action@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Build
run: make build-${{ matrix.version }} platform=--platform=linux/amd64

- name: Tag
run: make tag-${{ matrix.version }}

- name: Test
run: make test-${{ matrix.version }}
Comment thread
rick-lam marked this conversation as resolved.
Outdated

- name: Login to Docker Hub
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Deploy
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: make deploy-${{ matrix.version }}
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions 8.3/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bats
79 changes: 79 additions & 0 deletions 8.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
FROM alpine:3.19

LABEL maintainer="developers@graze.com" \
license="MIT" \
org.label-schema.schema-version="1.0" \
org.label-schema.vendor="graze" \
org.label-schema.name="php-alpine" \
org.label-schema.description="small php image based on alpine" \
org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine"

# Fix for iconv: https://github.com/docker-library/php/issues/240
RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted

Comment thread
rick-lam marked this conversation as resolved.
Outdated
RUN set -xe \
&& echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.19/community" >> /etc/apk/repositories \
&& apk add --update --no-cache \
ca-certificates \
curl \
gnu-libiconv \
openssh-client \
libmemcached-libs \
libevent \
libssl3 \
musl \
yaml \
php83 \
php83-pecl-apcu \
php83-pecl-event \
php83-pecl-memcached \
php83-pecl-yaml \
php83-bcmath \
php83-common \
php83-ctype \
php83-curl \
php83-dom \
php83-fileinfo \
php83-iconv \
php83-intl \
php83-openssl \
php83-opcache \
php83-mbstring \
php83-mysqlnd \
php83-mysqli \
php83-pcntl \
php83-pgsql \
php83-pdo_mysql \
php83-pdo_pgsql \
php83-pdo_sqlite \
php83-phar \
php83-posix \
php83-simplexml \
php83-session \
php83-soap \
php83-sockets \
php83-sodium \
php83-tokenizer \
php83-xml \
php83-xmlreader \
php83-xmlwriter \
php83-zip \
php83-zlib

ENV PHP_INI_DIR /etc/php83

RUN ln -s /usr/bin/php83 /usr/bin/php
RUN ln -s /usr/bin/pecl83 /usr/bin/pecl

COPY php/conf.d/*.ini $PHP_INI_DIR/conf.d/

WORKDIR /srv

ARG BUILD_DATE
ARG VCS_REF

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.build-date=$BUILD_DATE

# Fix for iconv: https://github.com/docker-library/php/issues/240
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
10 changes: 10 additions & 0 deletions 8.3/debug.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM graze/php-alpine:8.3

RUN apk add --update --no-cache \
php83-phpdbg

ARG BUILD_DATE
ARG VCS_REF

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.build-date=$BUILD_DATE
64 changes: 64 additions & 0 deletions 8.3/php.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env bats

@test "php version is correct" {
run docker run --rm ${container} php -v
echo 'status:' $status
echo 'output:' $output
version="$(echo $output | sed 's/.*PHP \([0-9].[0-9]\).*/\1/')"
echo 'version:' $version
[ "$status" -eq 0 ]
[[ "$version" == "8.3" ]]
}

@test "the image has the correct php modules installed" {
run docker run --rm ${container} php -m
echo 'status:' $status
echo 'output:' $output
[ "$status" -eq 0 ]
[[ "${output}" == *"apcu"* ]]
[[ "${output}" == *"bcmath"* ]]
[[ "${output}" == *"Core"* ]]
[[ "${output}" == *"ctype"* ]]
[[ "${output}" == *"curl"* ]]
[[ "${output}" == *"date"* ]]
[[ "${output}" == *"dom"* ]]
[[ "${output}" == *"event"* ]]
[[ "${output}" == *"fileinfo"* ]]
[[ "${output}" == *"filter"* ]]
[[ "${output}" == *"hash"* ]]
[[ "${output}" == *"iconv"* ]]
[[ "${output}" == *"intl"* ]]
[[ "${output}" == *"json"* ]]
[[ "${output}" == *"libxml"* ]]
[[ "${output}" == *"mbstring"* ]]
[[ "${output}" == *"memcached"* ]]
[[ "${output}" == *"mysqli"* ]]
[[ "${output}" == *"mysqlnd"* ]]
[[ "${output}" == *"openssl"* ]]
[[ "${output}" == *"pcre"* ]]
[[ "${output}" == *"pcntl"* ]]
[[ "${output}" == *"PDO"* ]]
[[ "${output}" == *"pdo_mysql"* ]]
[[ "${output}" == *"pdo_pgsql"* ]]
[[ "${output}" == *"pdo_sqlite"* ]]
[[ "${output}" == *"pgsql"* ]]
[[ "${output}" == *"Phar"* ]]
[[ "${output}" == *"posix"* ]]
[[ "${output}" == *"readline"* ]]
[[ "${output}" == *"Reflection"* ]]
[[ "${output}" == *"session"* ]]
[[ "${output}" == *"SimpleXML"* ]]
[[ "${output}" == *"soap"* ]]
[[ "${output}" == *"sodium"* ]]
[[ "${output}" == *"sockets"* ]]
[[ "${output}" == *"SPL"* ]]
[[ "${output}" == *"standard"* ]]
[[ "${output}" == *"tokenizer"* ]]
[[ "${output}" == *"xml"* ]]
[[ "${output}" == *"xmlreader"* ]]
[[ "${output}" == *"xmlwriter"* ]]
[[ "${output}" == *"yaml"* ]]
[[ "${output}" == *"Zend OPcache"* ]]
[[ "${output}" == *"zip"* ]]
[[ "${output}" == *"zlib"* ]]
}
3 changes: 3 additions & 0 deletions 8.3/php/conf.d/00_memlimit.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 1024M
13 changes: 13 additions & 0 deletions 8.3/php/conf.d/00_short_open_tag.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It's been
; recommended for several years that you not use the short tag "short cut" and
; instead to use the full <?php and ?> tag combination. With the wide spread use
; of XML and use of these tags by other languages, the server can become easily
; confused and end up parsing the wrong code in the wrong context. But because
; this short cut has been a feature for such a long time, it's currently still
; supported for backwards compatibility, but we recommend you don't use them.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = On
9 changes: 9 additions & 0 deletions 8.3/php_debug.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bats

@test "the image has phpdbg" {
run docker run ${container} which phpdbg83
echo 'status:' $status
echo 'output:' $output
[ "$status" -eq 0 ]
[[ "${output}" == *"phpdbg83"* ]]
}
13 changes: 13 additions & 0 deletions 8.3/tags.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bats

@test "the main tags are created" {
run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.3 --format '{{.ID}}')""
echo 'output:' $output
[[ "$output" == *"(8.3)"* ]]
}

@test "the test tags are created" {
run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.3-test --format '{{.ID}}')""
echo 'output:' $output
[[ "$output" == *"(8.3-test)"* ]]
}
1 change: 1 addition & 0 deletions 8.4/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bats
79 changes: 79 additions & 0 deletions 8.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
FROM alpine:3.21

LABEL maintainer="developers@graze.com" \
license="MIT" \
org.label-schema.schema-version="1.0" \
org.label-schema.vendor="graze" \
org.label-schema.name="php-alpine" \
org.label-schema.description="small php image based on alpine" \
org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine"

# Fix for iconv: https://github.com/docker-library/php/issues/240
RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted

Comment thread
rick-lam marked this conversation as resolved.
Outdated
RUN set -xe \
&& echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.21/community" >> /etc/apk/repositories \
&& apk add --update --no-cache \
ca-certificates \
curl \
gnu-libiconv \
openssh-client \
libmemcached-libs \
libevent \
libssl3 \
musl \
yaml \
php84 \
php84-pecl-apcu \
php84-pecl-event \
php84-pecl-memcached \
php84-pecl-yaml \
php84-bcmath \
php84-common \
php84-ctype \
php84-curl \
php84-dom \
php84-fileinfo \
php84-iconv \
php84-intl \
php84-openssl \
php84-opcache \
php84-mbstring \
php84-mysqlnd \
php84-mysqli \
php84-pcntl \
php84-pgsql \
php84-pdo_mysql \
php84-pdo_pgsql \
php84-pdo_sqlite \
php84-phar \
php84-posix \
php84-simplexml \
php84-session \
php84-soap \
php84-sockets \
php84-sodium \
php84-tokenizer \
php84-xml \
php84-xmlreader \
php84-xmlwriter \
php84-zip \
php84-zlib

ENV PHP_INI_DIR /etc/php84

RUN ln -s /usr/bin/php84 /usr/bin/php
RUN ln -s /usr/bin/pecl84 /usr/bin/pecl

COPY php/conf.d/*.ini $PHP_INI_DIR/conf.d/

WORKDIR /srv

ARG BUILD_DATE
ARG VCS_REF

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.build-date=$BUILD_DATE

# Fix for iconv: https://github.com/docker-library/php/issues/240
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
10 changes: 10 additions & 0 deletions 8.4/debug.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM graze/php-alpine:8.4

RUN apk add --update --no-cache \
php84-phpdbg

ARG BUILD_DATE
ARG VCS_REF

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.build-date=$BUILD_DATE
Loading
Loading