Skip to content

Commit

Permalink
update and cleanup PHP8.2 images
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBadBassMan committed Sep 24, 2024
1 parent fa00ca7 commit ca93692
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 52 deletions.
12 changes: 0 additions & 12 deletions .docker/Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions .docker/build
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions .docker/dockerhub.dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
7 changes: 0 additions & 7 deletions .docker/php82

This file was deleted.

25 changes: 25 additions & 0 deletions .docker/php82.dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
19 changes: 0 additions & 19 deletions .docker/php82_build_phar

This file was deleted.

9 changes: 0 additions & 9 deletions .docker/php82_xdebug

This file was deleted.

25 changes: 25 additions & 0 deletions .docker/php82_xdebug.dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
4 changes: 2 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
cancel-in-progress: true

env:
DOCKERFILE: .docker/Dockerfile
DOCKERFILE: .docker/dockerhub.dockerfile
DOCKERHUB_USERNAME: boxproject
TERM: xterm

Expand Down

0 comments on commit ca93692

Please sign in to comment.