Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.3 #42

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions 8.1/tags.bats
Original file line number Diff line number Diff line change
@@ -1,13 +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.0 --format '{{.ID}}')""
run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.1 --format '{{.ID}}')""
echo 'output:' $output
[[ "$output" == *"(8.1)"* ]]
}

@test "the test tags are created" {
run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.0-test --format '{{.ID}}')""
run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.1-test --format '{{.ID}}')""
echo 'output:' $output
[[ "$output" == *"(8.1-test)"* ]]
}
4 changes: 2 additions & 2 deletions 8.2/tags.bats
Original file line number Diff line number Diff line change
@@ -1,13 +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.0 --format '{{.ID}}')""
run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.2 --format '{{.ID}}')""
echo 'output:' $output
[[ "$output" == *"(8.2)"* ]]
}

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

LABEL maintainer="[email protected]" \
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

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 \
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)"* ]]
}
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ build_args := --build-arg BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \

latest_5 := 5.6
latest_7 := 7.4
latest_8 := 8.2
latest := 8.2
latest_8 := 8.3
latest := 8.3

.PHONY: build build-quick
.PHONY: tag
Expand All @@ -30,25 +30,25 @@ latest := 8.2
.PHONY: prod-build prod-build-quick

.DEFAULT: build
build: build-5.6 build-7.0 build-7.1 build-7.2 build-7.3 build-7.4 build-8.0 build-8.1 build-8.2
build: build-5.6 build-7.0 build-7.1 build-7.2 build-7.3 build-7.4 build-8.0 build-8.1 build-8.2 build-8.3
build-quick:
make build cache="" pull=""

build-quick-%:
make build-$* cache="" pull=""

prod-build: prod-build-5.6 prod-build-7.0 prod-build-7.1 prod-build-7.2 prod-build-7.3 prod-build-7.4 prod-build-8.0 prod-build-8.1 prod-build-8.2
prod-build: prod-build-5.6 prod-build-7.0 prod-build-7.1 prod-build-7.2 prod-build-7.3 prod-build-7.4 prod-build-8.0 prod-build-8.1 prod-build-8.2 prod-build-8.3
prod-build-quick:
make prod-build cache="" pull=""

prod-build-quick-%:
make prod-build-$* cache="" pull=""

tag: tag-5.6 tag-7.0 tag-7.1 tag-7.2 tag-7.3 tag-7.4 tag-8.0 tag-8.1 test-8.2
test: test-5.6 test-7.0 test-7.1 test-7.2 test-7.3 test-7.4 test-8.0 test-8.1 test-8.2
push: push-5.6 push-7.0 push-7.1 push-7.2 push-7.3 push-7.4 push-8.0 push-8.1 push-8.2
clean: clean-5.6 clean-7.0 clean-7.1 clean-7.2 clean-7.3 clean-7.4 clean-8.0 clean-8.1 clean-8.2
deploy: deploy-5.6 deploy-7.0 deploy-7.1 deploy-7.2 deploy-7.3 deploy-7.4 deploy-8.0 deploy-8.1 deploy-8.2
tag: tag-5.6 tag-7.0 tag-7.1 tag-7.2 tag-7.3 tag-7.4 tag-8.0 tag-8.1 tag-8.2 tag-8.3
test: test-5.6 test-7.0 test-7.1 test-7.2 test-7.3 test-7.4 test-8.0 test-8.1 test-8.2 test-8.3
push: push-5.6 push-7.0 push-7.1 push-7.2 push-7.3 push-7.4 push-8.0 push-8.1 push-8.2 push-8.3
clean: clean-5.6 clean-7.0 clean-7.1 clean-7.2 clean-7.3 clean-7.4 clean-8.0 clean-8.1 clean-8.2 clean-8.3
deploy: deploy-5.6 deploy-7.0 deploy-7.1 deploy-7.2 deploy-7.3 deploy-7.4 deploy-8.0 deploy-8.1 deploy-8.2 deploy-8.3

build-%: cache ?= --no-cache
build-%: pull ?= --pull
Expand Down