From 2d0d08e42a164e8b6802c7fba6534be84ef72a7d Mon Sep 17 00:00:00 2001 From: BigBadBassMan Date: Tue, 24 Sep 2024 09:04:38 +0200 Subject: [PATCH 1/4] add composer to dockerhub image --- .docker/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 1e772c5f3..2ab222999 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,8 +1,12 @@ FROM php:8.2-cli-alpine +# hadolint ignore=DL3022 COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ RUN install-php-extensions zlib phar sodium tokenizer filter +# hadolint ignore=DL3022 +COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer + COPY bin/box.phar /box.phar ENTRYPOINT ["/box.phar"] From fa00ca7e7801a1de9afd4054c369b505e7f72f21 Mon Sep 17 00:00:00 2001 From: BigBadBassMan Date: Tue, 24 Sep 2024 09:06:22 +0200 Subject: [PATCH 2/4] drop PHP7.2 image --- .docker/build | 4 ---- .docker/php725 | 1 - .github/workflows/docker.yaml | 3 --- .github/workflows/requirement-checker.yaml | 10 +++++----- 4 files changed, 5 insertions(+), 13 deletions(-) delete mode 100644 .docker/php725 diff --git a/.docker/build b/.docker/build index 1a5b84ae8..2e45cedf5 100755 --- a/.docker/build +++ b/.docker/build @@ -4,10 +4,6 @@ set -euf -o pipefail readonly SCRIPT_DIR=$(dirname $(realpath "${BASH_SOURCE:-$0}")) -if [[ "$(docker images -q ghcr.io/box-project/box_php725 2> /dev/null)" == "" ]]; then - docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php725 --file "${SCRIPT_DIR}/php725" . -fi - if [[ "$(docker images -q ghcr.io/box-project/box_php82 2> /dev/null)" == "" ]]; then docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php82 --file "${SCRIPT_DIR}/php82" . fi diff --git a/.docker/php725 b/.docker/php725 deleted file mode 100644 index 2acc08764..000000000 --- a/.docker/php725 +++ /dev/null @@ -1 +0,0 @@ -FROM php:7.2.5-alpine diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 727aefac6..dbdf31f92 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -32,9 +32,6 @@ jobs: fail-fast: false matrix: include: - - name: PHP 7.2.5 - docker-file: .docker/php725 - image-tag: ghcr.io/box-project/box_php725 - name: PHP 8.2 docker-file: .docker/php82 image-tag: ghcr.io/box-project/box_php82 diff --git a/.github/workflows/requirement-checker.yaml b/.github/workflows/requirement-checker.yaml index 06919f944..c49eb0723 100644 --- a/.github/workflows/requirement-checker.yaml +++ b/.github/workflows/requirement-checker.yaml @@ -195,21 +195,21 @@ jobs: matrix: e2e: - command: _test_e2e_pass_no_config_min_composer_php - docker-image: ghcr.io/box-project/box_php725 + docker-image: ghcr.io/box-project/box_php82 - command: _test_e2e_pass_no_config_min_box_php docker-image: ghcr.io/box-project/box_php82 - command: _test_e2e_pass_complete_min_composer_php - docker-image: ghcr.io/box-project/box_php725 + docker-image: ghcr.io/box-project/box_php82 - command: _test_e2e_pass_complete_min_box_php docker-image: ghcr.io/box-project/box_php82 - command: _test_e2e_fail_complete_min_composer_php - docker-image: ghcr.io/box-project/box_php725 + docker-image: ghcr.io/box-project/box_php82 - command: _test_e2e_fail_complete_min_box_php docker-image: ghcr.io/box-project/box_php82 - command: _test_e2e_skip_min_composer_php - docker-image: ghcr.io/box-project/box_php725 + docker-image: ghcr.io/box-project/box_php82 - command: _test_e2e_pass_complete_requirement_checker_not_disabled - docker-image: ghcr.io/box-project/box_php725 + docker-image: ghcr.io/box-project/box_php82 - command: _test_e2e_fail_conflict docker-image: ghcr.io/box-project/box_php82 steps: From ca93692e463d9deac010a50efc704b52802e22ef Mon Sep 17 00:00:00 2001 From: BigBadBassMan Date: Tue, 24 Sep 2024 09:43:40 +0200 Subject: [PATCH 3/4] update and cleanup PHP8.2 images --- .docker/Dockerfile | 12 ------------ .docker/build | 4 ++-- .docker/dockerhub.dockerfile | 14 ++++++++++++++ .docker/php82 | 7 ------- .docker/php82.dockerfile | 25 +++++++++++++++++++++++++ .docker/php82_build_phar | 19 ------------------- .docker/php82_xdebug | 9 --------- .docker/php82_xdebug.dockerfile | 25 +++++++++++++++++++++++++ .github/workflows/docker.yaml | 4 ++-- .github/workflows/release.yaml | 2 +- 10 files changed, 69 insertions(+), 52 deletions(-) delete mode 100644 .docker/Dockerfile create mode 100644 .docker/dockerhub.dockerfile delete mode 100644 .docker/php82 create mode 100644 .docker/php82.dockerfile delete mode 100644 .docker/php82_build_phar delete mode 100644 .docker/php82_xdebug create mode 100644 .docker/php82_xdebug.dockerfile diff --git a/.docker/Dockerfile b/.docker/Dockerfile deleted file mode 100644 index 2ab222999..000000000 --- a/.docker/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:8.2-cli-alpine - -# hadolint ignore=DL3022 -COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ -RUN install-php-extensions zlib phar sodium tokenizer filter - -# hadolint ignore=DL3022 -COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer - -COPY bin/box.phar /box.phar - -ENTRYPOINT ["/box.phar"] diff --git a/.docker/build b/.docker/build index 2e45cedf5..304a5f24b 100755 --- a/.docker/build +++ b/.docker/build @@ -5,9 +5,9 @@ set -euf -o pipefail readonly SCRIPT_DIR=$(dirname $(realpath "${BASH_SOURCE:-$0}")) if [[ "$(docker images -q ghcr.io/box-project/box_php82 2> /dev/null)" == "" ]]; then - docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php82 --file "${SCRIPT_DIR}/php82" . + docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php82 --file "${SCRIPT_DIR}/php82.dockerfile" . fi if [[ "$(docker images -q ghcr.io/box-project/box_php82_xdebug 2> /dev/null)" == "" ]]; then - docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php82_xdebug --file "${SCRIPT_DIR}/php82_xdebug" . + docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php82_xdebug --file "${SCRIPT_DIR}/php82_xdebug.dockerfile" . fi diff --git a/.docker/dockerhub.dockerfile b/.docker/dockerhub.dockerfile new file mode 100644 index 000000000..e0e2e2efc --- /dev/null +++ b/.docker/dockerhub.dockerfile @@ -0,0 +1,14 @@ +FROM --platform=linux/amd64 php:8.2-cli-alpine + +# hadolint ignore=DL3022 +COPY --chmod=755 --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ +RUN install-php-extensions zlib phar sodium tokenizer filter + +# hadolint ignore=DL3022 +COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer + +COPY --chmod=755 bin/box.phar /box.phar + +RUN mkdir -p /local +WORKDIR /local +ENTRYPOINT ["/box.phar"] diff --git a/.docker/php82 b/.docker/php82 deleted file mode 100644 index 5e9d61ec3..000000000 --- a/.docker/php82 +++ /dev/null @@ -1,7 +0,0 @@ -FROM php:8.2-cli - -RUN echo '' | \ - apt-get -y update; \ - apt-get install -y --no-install-recommends libicu-dev; \ - docker-php-ext-configure intl; \ - docker-php-ext-install intl; diff --git a/.docker/php82.dockerfile b/.docker/php82.dockerfile new file mode 100644 index 000000000..5f41ff826 --- /dev/null +++ b/.docker/php82.dockerfile @@ -0,0 +1,25 @@ +FROM --platform=linux/amd64 php:8.2-cli-alpine AS build-stage + +RUN apk add --update make git + +# hadolint ignore=DL3022 +COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer + +RUN mkdir -p /opt/box-project/box +WORKDIR /opt/box-project/box +ADD . /opt/box-project/box +RUN make compile + +FROM --platform=linux/amd64 php:8.2-cli-alpine + +# hadolint ignore=DL3022 +COPY --chmod=755 --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ +RUN install-php-extensions zlib phar sodium tokenizer filter intl + +COPY --chmod=755 --from=build-stage /opt/box-project/box/bin/box.phar /usr/bin/box +# hadolint ignore=DL3022 +COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer + +RUN mkdir -p /local +WORKDIR /local +ENTRYPOINT ["/usr/bin/box"] diff --git a/.docker/php82_build_phar b/.docker/php82_build_phar deleted file mode 100644 index e5cd65ee1..000000000 --- a/.docker/php82_build_phar +++ /dev/null @@ -1,19 +0,0 @@ -FROM php:8.2-cli-alpine as build-stage - -RUN apk add --update make git - -COPY --from=composer:latest /usr/bin/composer /usr/bin/composer - -RUN mkdir -p /opt/box-project/box -WORKDIR /opt/box-project/box -ADD . /opt/box-project/box -RUN cd /opt/box-project/box && \ - make compile - -FROM php:8.2-cli-alpine - -COPY --from=build-stage /opt/box-project/box/bin/box.phar /usr/bin/box - -RUN mkdir -p /local -WORKDIR /local -ENTRYPOINT ["/usr/bin/box"] \ No newline at end of file diff --git a/.docker/php82_xdebug b/.docker/php82_xdebug deleted file mode 100644 index ca34eab1b..000000000 --- a/.docker/php82_xdebug +++ /dev/null @@ -1,9 +0,0 @@ -FROM php:8.2-cli - -RUN echo '' | \ - apt-get -y update; \ - apt-get install -y --no-install-recommends libicu-dev; \ - docker-php-ext-configure intl; \ - docker-php-ext-install intl; \ - pecl install xdebug; \ - docker-php-ext-enable xdebug; diff --git a/.docker/php82_xdebug.dockerfile b/.docker/php82_xdebug.dockerfile new file mode 100644 index 000000000..0d11dd424 --- /dev/null +++ b/.docker/php82_xdebug.dockerfile @@ -0,0 +1,25 @@ +FROM --platform=linux/amd64 php:8.2-cli-alpine as build-stage + +RUN apk add --update make git + +# hadolint ignore=DL3022 +COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer + +RUN mkdir -p /opt/box-project/box +WORKDIR /opt/box-project/box +ADD . /opt/box-project/box +RUN make compile + +FROM --platform=linux/amd64 php:8.2-cli-alpine + +# hadolint ignore=DL3022 +COPY --chmod=755 --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ +RUN install-php-extensions zlib phar sodium tokenizer filter intl xdebug + +COPY --chmod=755 --from=build-stage /opt/box-project/box/bin/box.phar /usr/bin/box +# hadolint ignore=DL3022 +COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer + +RUN mkdir -p /local +WORKDIR /local +ENTRYPOINT ["/usr/bin/box"] diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index dbdf31f92..9bed22532 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -33,10 +33,10 @@ jobs: matrix: include: - name: PHP 8.2 - docker-file: .docker/php82 + docker-file: .docker/php82.dockerfile image-tag: ghcr.io/box-project/box_php82 - name: PHP 8.2 (Xdebug) - docker-file: .docker/php82_xdebug + docker-file: .docker/php82_xdebug.dockerfile image-tag: ghcr.io/box-project/box_php82_xdebug steps: - name: Checkout diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 744f0a500..5553b876e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,7 @@ concurrency: cancel-in-progress: true env: - DOCKERFILE: .docker/Dockerfile + DOCKERFILE: .docker/dockerhub.dockerfile DOCKERHUB_USERNAME: boxproject TERM: xterm From 4604233b439696cda5e4f64c1517526fcfcbbe24 Mon Sep 17 00:00:00 2001 From: BigBadBassMan Date: Tue, 24 Sep 2024 09:45:22 +0200 Subject: [PATCH 4/4] add PHP8.3 images for ghcr.io --- .docker/php83.dockerfile | 25 +++++++++++++++++++++++++ .docker/php83_xdebug.dockerfile | 25 +++++++++++++++++++++++++ .github/workflows/docker.yaml | 6 ++++++ 3 files changed, 56 insertions(+) create mode 100644 .docker/php83.dockerfile create mode 100644 .docker/php83_xdebug.dockerfile diff --git a/.docker/php83.dockerfile b/.docker/php83.dockerfile new file mode 100644 index 000000000..c75fbe718 --- /dev/null +++ b/.docker/php83.dockerfile @@ -0,0 +1,25 @@ +FROM --platform=linux/amd64 php:8.3-cli-alpine AS build-stage + +RUN apk add --update make git + +# hadolint ignore=DL3022 +COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer + +RUN mkdir -p /opt/box-project/box +WORKDIR /opt/box-project/box +ADD . /opt/box-project/box +RUN make compile + +FROM --platform=linux/amd64 php:8.3-cli-alpine + +# hadolint ignore=DL3022 +COPY --chmod=755 --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ +RUN install-php-extensions zlib phar sodium tokenizer filter intl + +COPY --chmod=755 --from=build-stage /opt/box-project/box/bin/box.phar /usr/bin/box +# hadolint ignore=DL3022 +COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer + +RUN mkdir -p /local +WORKDIR /local +ENTRYPOINT ["/usr/bin/box"] diff --git a/.docker/php83_xdebug.dockerfile b/.docker/php83_xdebug.dockerfile new file mode 100644 index 000000000..c2703d4c6 --- /dev/null +++ b/.docker/php83_xdebug.dockerfile @@ -0,0 +1,25 @@ +FROM --platform=linux/amd64 php:8.3-cli-alpine as build-stage + +RUN apk add --update make git + +# hadolint ignore=DL3022 +COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer + +RUN mkdir -p /opt/box-project/box +WORKDIR /opt/box-project/box +ADD . /opt/box-project/box +RUN make compile + +FROM --platform=linux/amd64 php:8.3-cli-alpine + +# hadolint ignore=DL3022 +COPY --chmod=755 --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ +RUN install-php-extensions zlib phar sodium tokenizer filter intl xdebug + +COPY --chmod=755 --from=build-stage /opt/box-project/box/bin/box.phar /usr/bin/box +# hadolint ignore=DL3022 +COPY --chmod=755 --from=composer/composer:2-bin /composer /usr/bin/composer + +RUN mkdir -p /local +WORKDIR /local +ENTRYPOINT ["/usr/bin/box"] diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 9bed22532..5ca3ff232 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -38,6 +38,12 @@ jobs: - name: PHP 8.2 (Xdebug) docker-file: .docker/php82_xdebug.dockerfile image-tag: ghcr.io/box-project/box_php82_xdebug + - name: PHP 8.3 + docker-file: .docker/php83.dockerfile + image-tag: ghcr.io/box-project/box_php83 + - name: PHP 8.3 (Xdebug) + docker-file: .docker/php83_xdebug.dockerfile + image-tag: ghcr.io/box-project/box_php83_xdebug steps: - name: Checkout uses: actions/checkout@v4