diff --git a/.docker/Dockerfile b/.docker/Dockerfile deleted file mode 100644 index 1e772c5f3..000000000 --- a/.docker/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM php:8.2-cli-alpine - -COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ -RUN install-php-extensions zlib phar sodium tokenizer filter - -COPY bin/box.phar /box.phar - -ENTRYPOINT ["/box.phar"] diff --git a/.docker/build b/.docker/build index 1a5b84ae8..304a5f24b 100755 --- a/.docker/build +++ b/.docker/build @@ -4,14 +4,10 @@ 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" . + 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/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/.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/.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 727aefac6..5ca3ff232 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -32,15 +32,18 @@ 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 + 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 + - 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 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 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: