Skip to content

Commit 91c32eb

Browse files
committed
Build 8.1 images
1 parent 769adeb commit 91c32eb

11 files changed

Lines changed: 61 additions & 33 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
- id: supported-php-versions
4040
name: Generate PHP
4141
uses: wyrihaximus/github-action-supported-php-versions@v1
42+
with:
43+
upcomingReleases: true
4244
registry-matrix:
4345
name: Extract registries from registry secret mapping
4446
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master'
@@ -184,7 +186,7 @@ jobs:
184186
path: ./docker-image
185187
- run: ls -lasth ./docker-image
186188
- run: docker load --input ./docker-image/image.tar
187-
- run: make $(php -r 'echo "test-", explode("-", str_replace(["zts-zts", "cli-nts"], ["zts", "nts"], "${{ matrix.image }}"))[0];')
189+
- run: IMAGE_BASE_VERSION=$(php -r 'echo explode("-", "${{ matrix.image }}")[2];') make $(php -r 'echo "test-", explode("-", str_replace(["zts-zts", "cli-nts"], ["zts", "nts"], "${{ matrix.image }}"))[0];')
188190
- run: rm -Rf ./docker-image/
189191
check-mark:
190192
name: ✔️

Dockerfile-nts-alpine

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ FROM base AS base-build
2222
RUN apk add --no-cache $PHPIZE_DEPS git libuv-dev
2323

2424
FROM base-build AS build-uv
25-
RUN git clone https://github.com/amphp/php-uv uv
25+
RUN git clone https://github.com/amphp/ext-uv uv
2626
WORKDIR /uv
2727
RUN git fetch \
2828
&& git pull \
@@ -82,7 +82,7 @@ RUN touch /.you-are-in-a-wyrihaximus.net-php-docker-image-dev
8282
# Install docker help scripts
8383
COPY src/php/utils/docker/alpine/dev-mode /usr/local/bin/dev-mode
8484
COPY src/php/utils/docker/alpine/docker-php-dev-mode /usr/local/bin/docker-php-dev-mode
85-
RUN dev-mode && rm -rf /usr/local/bin/dev-mode && rm -rf /usr/local/bin/docker-php-dev-mode
85+
RUN if [ $(php -v | grep "PHP 8.1" | wc -l) != 0 ] ; then true ; else dev-mode; fi && rm -rf /usr/local/bin/dev-mode && rm -rf /usr/local/bin/docker-php-dev-mode
8686

8787
# Install composer
8888
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
@@ -98,7 +98,7 @@ RUN touch /.you-are-in-a-wyrihaximus.net-php-docker-image-dev
9898
# Install docker help scripts
9999
COPY src/php/utils/docker/alpine/dev-mode /usr/local/bin/dev-mode
100100
COPY src/php/utils/docker/alpine/docker-php-dev-mode /usr/local/bin/docker-php-dev-mode
101-
RUN dev-mode && rm -rf /usr/local/bin/dev-mode && rm -rf /usr/local/bin/docker-php-dev-mode
101+
RUN if [ $(php -v | grep "PHP 8.1" | wc -l) != 0 ] ; then true ; else dev-mode; fi && rm -rf /usr/local/bin/dev-mode && rm -rf /usr/local/bin/docker-php-dev-mode
102102

103103
# Install composer
104104
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer

Dockerfile-nts-debian

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ FROM base AS base-build
2222
RUN yes | apt-get install $PHPIZE_DEPS git libuv1-dev
2323

2424
FROM base-build AS build-uv
25-
RUN git clone https://github.com/amphp/php-uv uv
25+
RUN git clone https://github.com/amphp/ext-uv uv
2626
WORKDIR /uv
2727
RUN git fetch \
2828
&& git pull \
@@ -94,7 +94,10 @@ RUN touch /.you-are-in-a-wyrihaximus.net-php-docker-image-dev
9494
# Install docker help scripts
9595
COPY src/php/utils/docker/debian/dev-mode /usr/local/bin/dev-mode
9696
COPY src/php/utils/docker/debian/docker-php-dev-mode /usr/local/bin/docker-php-dev-mode
97-
RUN dev-mode && rm -rf /usr/local/bin/dev-mode && rm -rf /usr/local/bin/docker-php-dev-mode && yes | apt-get install make wget unzip
97+
RUN if [ $(php -v | grep "alpha\|beta\|rc" | wc -l) != 0 ] ; then true ; else dev-mode; fi \
98+
&& rm -rf /usr/local/bin/dev-mode \
99+
&& rm -rf /usr/local/bin/docker-php-dev-mode \
100+
&& yes | apt-get install make
98101

99102
# Install composer
100103
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
@@ -110,7 +113,10 @@ RUN touch /.you-are-in-a-wyrihaximus.net-php-docker-image-dev
110113
# Install docker help scripts
111114
COPY src/php/utils/docker/debian/dev-mode /usr/local/bin/dev-mode
112115
COPY src/php/utils/docker/debian/docker-php-dev-mode /usr/local/bin/docker-php-dev-mode
113-
RUN dev-mode && rm -rf /usr/local/bin/dev-mode && rm -rf /usr/local/bin/docker-php-dev-mode && yes | apt-get install make wget unzip
116+
RUN if [ $(php -v | grep "alpha\|beta\|rc" | wc -l) != 0 ] ; then true ; else dev-mode; fi \
117+
&& rm -rf /usr/local/bin/dev-mode \
118+
&& rm -rf /usr/local/bin/docker-php-dev-mode \
119+
&& yes | apt-get install make
114120

115121
# Install composer
116122
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer

Dockerfile-zts-alpine

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ FROM base AS base-build
2222
RUN apk add --no-cache $PHPIZE_DEPS git libuv-dev
2323

2424
FROM base-build AS build-uv
25-
RUN git clone https://github.com/amphp/php-uv uv
25+
RUN git clone https://github.com/amphp/ext-uv uv
2626
WORKDIR /uv
2727
RUN git fetch \
2828
&& git pull \
@@ -58,7 +58,7 @@ RUN EXTENSION_DIR=`php-config --extension-dir 2>/dev/null` && \
5858
## Install PECL
5959
&& wget -q pear.php.net/go-pear.phar && php go-pear.phar \
6060
&& install-php-extensions pcntl pgsql pdo pdo_pgsql bcmath zip gmp iconv opcache \
61-
&& pecl install parallel || (cd /tmp && apk add --no-cache $PHPIZE_DEPS git && git clone https://github.com/krakjoe/parallel && cd parallel && git fetch && git pull && phpize && ./configure && make install && cd) \
61+
&& pecl install parallel || (cd /tmp && apk add --no-cache $PHPIZE_DEPS git && git clone https://github.com/WyriHaximus-labs/parallel && cd parallel && git fetch && git checkout php-8.1-part-2 && git pull && phpize && ./configure && make install && cd) \
6262
&& docker-php-ext-enable parallel \
6363
&& if [ $(php -v | grep "PHP 8." | wc -l) != 0 ] ; then true ; else pecl install eio; fi \
6464
&& if [ $(php -v | grep "PHP 8." | wc -l) != 0 ] ; then true ; else docker-php-ext-enable eio; fi \
@@ -87,7 +87,7 @@ RUN touch /.you-are-in-a-wyrihaximus.net-php-docker-image-dev
8787

8888
# Install docker help scripts
8989
COPY src/php/utils/docker/alpine/dev-mode /usr/local/bin/dev-mode
90-
RUN dev-mode && rm -rf /usr/local/bin/dev-mode
90+
RUN if [ $(php -v | grep "PHP 8.1" | wc -l) != 0 ] ; then true ; else dev-mode; fi && rm -rf /usr/local/bin/dev-mode
9191

9292
# Install composer
9393
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
@@ -102,7 +102,7 @@ RUN touch /.you-are-in-a-wyrihaximus.net-php-docker-image-dev
102102

103103
# Install docker help scripts
104104
COPY src/php/utils/docker/alpine/dev-mode /usr/local/bin/dev-mode
105-
RUN dev-mode && rm -rf /usr/local/bin/dev-mode
105+
RUN if [ $(php -v | grep "PHP 8.1" | wc -l) != 0 ] ; then true ; else dev-mode; fi && rm -rf /usr/local/bin/dev-mode
106106

107107
# Install composer
108108
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer

Dockerfile-zts-debian

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ FROM base AS base-build
2222
RUN yes | apt-get install $PHPIZE_DEPS git libuv1-dev
2323

2424
FROM base-build AS build-uv
25-
RUN git clone https://github.com/amphp/php-uv uv
25+
RUN git clone https://github.com/amphp/ext-uv uv
2626
WORKDIR /uv
2727
RUN git fetch \
2828
&& git pull \
@@ -65,7 +65,7 @@ RUN EXTENSION_DIR=`php-config --extension-dir 2>/dev/null` && \
6565
gdb \
6666
$PHPIZE_DEPS \
6767
&& docker-php-ext-install -j$(nproc) pcntl pgsql pdo pdo_pgsql bcmath zip gmp iconv \
68-
&& pecl install parallel || (cd /tmp && (yes | apt-get install $PHPIZE_DEPS git) && git clone https://github.com/krakjoe/parallel && cd parallel && git fetch && git pull && phpize && ./configure && make install && cd) \
68+
&& pecl install parallel || (cd /tmp && (yes | apt-get install $PHPIZE_DEPS git) && git clone https://github.com/WyriHaximus-labs/parallel && cd parallel && git fetch && git checkout php-8.1-part-2 && git pull && phpize && ./configure && make install && cd) \
6969
&& docker-php-ext-enable parallel \
7070
&& if [ $(php -v | grep "PHP 8." | wc -l) != 0 ] ; then true ; else pecl install eio; fi \
7171
&& if [ $(php -v | grep "PHP 8." | wc -l) != 0 ] ; then true ; else docker-php-ext-enable eio; fi \
@@ -96,7 +96,10 @@ RUN touch /.you-are-in-a-wyrihaximus.net-php-docker-image-dev
9696
# Install docker help scripts
9797
COPY src/php/utils/docker/debian/dev-mode /usr/local/bin/dev-mode
9898
COPY src/php/utils/docker/debian/docker-php-dev-mode /usr/local/bin/docker-php-dev-mode
99-
RUN dev-mode && rm -rf /usr/local/bin/dev-mode && rm -rf /usr/local/bin/docker-php-dev-mode && yes | apt-get install make wget unzip
99+
RUN if [ $(php -v | grep "alpha\|beta\|rc" | wc -l) != 0 ] ; then true ; else dev-mode; fi \
100+
&& rm -rf /usr/local/bin/dev-mode \
101+
&& rm -rf /usr/local/bin/docker-php-dev-mode \
102+
&& yes | apt-get install make
100103

101104
# Install composer
102105
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
@@ -112,7 +115,10 @@ RUN touch /.you-are-in-a-wyrihaximus.net-php-docker-image-dev
112115
# Install docker help scripts
113116
COPY src/php/utils/docker/debian/dev-mode /usr/local/bin/dev-mode
114117
COPY src/php/utils/docker/debian/docker-php-dev-mode /usr/local/bin/docker-php-dev-mode
115-
RUN dev-mode && rm -rf /usr/local/bin/dev-mode && rm -rf /usr/local/bin/docker-php-dev-mode && yes | apt-get install make wget unzip
118+
RUN if [ $(php -v | grep "alpha\|beta\|rc" | wc -l) != 0 ] ; then true ; else dev-mode; fi \
119+
&& rm -rf /usr/local/bin/dev-mode \
120+
&& rm -rf /usr/local/bin/docker-php-dev-mode \
121+
&& yes | apt-get install make
116122

117123
# Install composer
118124
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer

test-nts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ declare -r DOCKER_TAG="$1"
1313

1414
declare TEST_SUITE
1515

16-
if [[ $DOCKER_TAG == *"-dev"* ]]; then
16+
if [[ $DOCKER_TAG == *"-dev"* && $IMAGE_BASE_VERSION != *"alpha"* && $IMAGE_BASE_VERSION != *"beta"* && $IMAGE_BASE_VERSION != *"rc"* ]]; then
1717
TEST_SUITE="php_nts or php_dev"
1818
else
1919
TEST_SUITE="php_nts or php_no_dev and not php_dev"

test-zts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ declare -r DOCKER_TAG="$1"
1313

1414
declare TEST_SUITE
1515

16-
if [[ $DOCKER_TAG == *"-dev"* ]]; then
16+
if [[ $DOCKER_TAG == *"-dev"* && $IMAGE_BASE_VERSION != *"alpha"* && $IMAGE_BASE_VERSION != *"beta"* && $IMAGE_BASE_VERSION != *"rc"* ]]; then
1717
TEST_SUITE="php_zts or php_dev"
1818
else
1919
TEST_SUITE="php_zts or php_no_dev and not php_dev"

utils/all-image-tags.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
require __DIR__ . DIRECTORY_SEPARATOR . 'cleaned-up-version.php';
4+
35
$upstreamImages = [];
46
foreach (range(1, 10) as $i) {
57
$upstreamJson = json_decode(file_get_contents('https://hub.docker.com/v2/repositories/library/php/tags?page_size=100&page=' . $i), true);
@@ -22,6 +24,7 @@
2224

2325
$list = [];
2426
foreach (json_decode(getenv('PHP'), true) as $php) {
27+
2528
$latestOSVersion = '1.0';
2629
foreach (json_decode(getenv('ALPINE'), true) as $alpine) {
2730
if (version_compare($alpine, $latestOSVersion, ">=")) {

utils/all-images.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
require __DIR__ . DIRECTORY_SEPARATOR . 'cleaned-up-version.php';
4+
35
$upstreamImages = [];
46
foreach (range(1, 10) as $i) {
57
$upstreamJson = json_decode(file_get_contents('https://hub.docker.com/v2/repositories/library/php/tags?page_size=100&page=' . $i), true);
@@ -24,33 +26,33 @@
2426
$latestOSVersion = $alpine;
2527
}
2628
if (array_key_exists($php . '-zts-alpine' . $alpine, $upstreamImages)) {
27-
$line[] = 'zts-zts-' . $php . '-' . $php . '-alpine-alpine' . $alpine . '-alpine' . $alpine . '-alpine3.11';
29+
$line[] = 'zts-zts-' . $php . '-' . cleanUpVersion($php) . '-alpine-alpine' . $alpine . '-alpine' . $alpine . '-alpine3.11';
2830
}
2931
if (array_key_exists($php . '-cli-alpine' . $alpine, $upstreamImages)) {
30-
$line[] = 'cli-nts-' . $php . '-' . $php . '-alpine-alpine' . $alpine . '-alpine' . $alpine . '-alpine3.11';
32+
$line[] = 'cli-nts-' . $php . '-' . cleanUpVersion($php) . '-alpine-alpine' . $alpine . '-alpine' . $alpine . '-alpine3.11';
3133
}
3234
}
3335

3436
if (array_key_exists($php . '-zts-alpine' . $latestOSVersion, $upstreamImages)) {
35-
$line[] = 'zts-zts-' . $php . '-' . $php . '-alpine-alpine' . $latestOSVersion . '-alpine-alpine3.11';
37+
$line[] = 'zts-zts-' . $php . '-' . cleanUpVersion($php) . '-alpine-alpine' . $latestOSVersion . '-alpine-alpine3.11';
3638
}
3739
if (array_key_exists($php . '-cli-alpine' . $latestOSVersion, $upstreamImages)) {
38-
$line[] = 'cli-nts-' . $php . '-' . $php . '-alpine-alpine' . $latestOSVersion . '-alpine-alpine3.11';
40+
$line[] = 'cli-nts-' . $php . '-' . cleanUpVersion($php) . '-alpine-alpine' . $latestOSVersion . '-alpine-alpine3.11';
3941
}
4042
}
4143

4244
foreach (json_decode(getenv('PHP'), true) as $php) {
4345
foreach (json_decode(getenv('DEBIAN'), true) as $debian) {
4446
if (array_key_exists($php . '-zts-' . $debian, $upstreamImages)) {
45-
$line[] = 'zts-zts-' . $php . '-' . $php . '-debian-' . $debian . '-' . $debian . '-buster';
47+
$line[] = 'zts-zts-' . $php . '-' . cleanUpVersion($php) . '-debian-' . $debian . '-' . $debian . '-buster';
4648
if ($debian === 'buster') {
47-
$line[] = 'zts-zts-' . $php . '-' . $php . '-debian-' . $debian . '-debian-buster';
49+
$line[] = 'zts-zts-' . $php . '-' . cleanUpVersion($php) . '-debian-' . $debian . '-debian-buster';
4850
}
4951
}
5052
if (array_key_exists($php . '-cli-' . $debian, $upstreamImages)) {
51-
$line[] = 'cli-nts-' . $php . '-' . $php . '-debian-' . $debian . '-' . $debian . '-buster';
53+
$line[] = 'cli-nts-' . $php . '-' . cleanUpVersion($php) . '-debian-' . $debian . '-' . $debian . '-buster';
5254
if ($debian === 'buster') {
53-
$line[] = 'cli-nts-' . $php . '-' . $php . '-debian-' . $debian . '-debian-buster';
55+
$line[] = 'cli-nts-' . $php . '-' . cleanUpVersion($php) . '-debian-' . $debian . '-debian-buster';
5456
}
5557
}
5658
}

utils/cleaned-up-version.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
function cleanUpVersion(string $version): string
4+
{
5+
[$major, $minor] = explode('.', $version);
6+
7+
return $major . '.' . $minor;
8+
}

0 commit comments

Comments
 (0)