-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docker tooling to verify and show how to setup it
Signed-off-by: Romain Gautier <[email protected]>
- Loading branch information
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
Makefile | ||
Dockerfile | ||
docker-bake.hcl | ||
tests-docker-output | ||
|
||
*.lo | ||
*.o | ||
.deps | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,5 @@ tests/*.mem | |
tmp-php.ini | ||
|
||
coverage_report/** | ||
|
||
tests-docker-output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM php_specified_version AS build | ||
|
||
RUN <<EOF | ||
apt update | ||
apt upgrade -y | ||
|
||
apt-get install -y build-essential git libnode-dev | ||
|
||
cp -s /usr/lib/`uname -m`-linux-gnu/libv8* /usr/local/lib/ | ||
cp -rs /usr/include/node/* /usr/local/include/ | ||
EOF | ||
|
||
#RUN git clone https://github.com/phpv8/v8js.git --branch php8 /tmp/php-v8js | ||
COPY --from=php-v8js-source-code / /tmp/php-v8js | ||
WORKDIR /tmp/php-v8js | ||
|
||
RUN <<EOF | ||
phpize | ||
./configure | ||
make -j$(nproc) | ||
make test > php$(php -r 'echo PHP_VERSION;')_$(uname -m)-make_test_std 2>&1 || true | ||
ls php_test_results_*.txt && mv php_test_results_*.txt php$(php -r 'echo PHP_VERSION;')_$(uname -m)-make_test_report || true | ||
EOF | ||
|
||
|
||
|
||
FROM scratch | ||
COPY --from=build /tmp/php-v8js/*-make_test_* / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Usage: | ||
# docker buildx bake | ||
# PHP_VERSION=8.3 docker buildx bake | ||
# PHP_VERSION=8.2 docker buildx bake | ||
# PHP_VERSION=8.1 docker buildx bake | ||
|
||
group "default" { | ||
targets = ["main"] | ||
platforms = ["linux/amd64", "linux/arm64"] | ||
} | ||
|
||
variable "PHP_VERSION" { | ||
default = "8.4" | ||
} | ||
|
||
target "main" { | ||
dockerfile = "Dockerfile" | ||
contexts = { | ||
"php_specified_version" = "docker-image://php:${PHP_VERSION}" | ||
"php-v8js-source-code" = "https://github.com/phpv8/v8js.git#php8" | ||
} | ||
output = ["type=local,dest=tests-docker-output/"] | ||
} |