Skip to content

Commit 68243ca

Browse files
committed
added dockerfile to run php-ffi
1 parent 261737f commit 68243ca

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM php:7.4-cli-buster
2+
3+
RUN apt-get -y update \
4+
&& DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install libffi-dev \
5+
&& docker-php-ext-configure ffi --with-ffi \
6+
&& docker-php-ext-install ffi \
7+
&& apt-get clean \
8+
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/cache/apt/archives/*

readme.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ Usage:
2121

2222
php -dffi.enable=1 ackermann.php
2323

24+
or:
25+
26+
docker build -t php-ffi .
27+
docker run -it --rm -v $(pwd):/code php-ffi php /code/ackermann.php
28+
29+
2430
Example output:
2531

2632
PHP
@@ -36,7 +42,7 @@ Example output:
3642
Requirements:
3743

3844
Go package (https://golang.org/dl/)
39-
PHP 7.4+
45+
PHP 7.4+ with FFI extension enabled
4046

4147
Notes:
4248

0 commit comments

Comments
 (0)