Skip to content

Commit f41ff7e

Browse files
authored
feat: Update docker images (#1472)
Closes #1329 and #1418. This addresses the point of #1329 but simplifying a bit the changes of #1418 as the points mentioned in #1329 only need to be addressed for the Dockerfile used for publishing the box image, not the ghcr images which are purely for internal testing.
1 parent 5365e9c commit f41ff7e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.docker/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ FROM php:8.2-cli-alpine
33
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
44
RUN install-php-extensions zlib phar sodium tokenizer filter
55

6+
# Include Composer as it is required for dumping the autoloader when no external Composer bin is provided.
7+
COPY --from=composer/composer /composer /usr/bin/composer
8+
69
COPY bin/box.phar /box.phar
710

11+
# Adjusts PHP settings
12+
RUN echo "memory_limit=512M" > /usr/local/etc/php/conf.d/memory-limit.ini \
13+
&& echo "phar.readonly=Off" > /usr/local/etc/php/conf.d/phar-readonly.ini
14+
15+
RUN mkdir -p /local
16+
WORKDIR /local
817
ENTRYPOINT ["/box.phar"]

doc/installation.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,17 @@ The official docker image for the project is [`boxproject/box`][docker-image]:
8989

9090
```shell
9191
docker pull boxproject/box
92+
docker run --rm -v $(pwd):/app boxproject/box
9293
```
9394

95+
Beware that with the above you may be limited with the Composer binary used. If you need your own
96+
Composer binary, you will have to create a docker file to add it to the same volume with the right
97+
permissions.
98+
99+
Box automatically looks up for a Composer binary and the docker image ships one, if you want to use
100+
your own you may also need to specify it with `--composer-bin`.
101+
102+
94103
## `shivammathur/setup-php` (GitHub Actions)
95104

96105
Box is supported as a [shivammathur/setup-php tool]:

0 commit comments

Comments
 (0)