diff --git a/Dockerfile b/Dockerfile index 548ed3928..a54f248c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -128,3 +128,6 @@ RUN mkdir /build && cd /src/php-src && emcc $OPTIMIZE \ -lidbfs.js \ /src/phpw.o /src/usr/lib/sqlite3.o .libs/libphp.a /src/usr/lib/libxml2.a RUN rm -r /src/* + +FROM scratch +COPY --from=php-wasm /build/ . diff --git a/README.md b/README.md index 685c63dae..fa47a9697 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,7 @@ I fixed some inconsistencies in the Makefile and removed non-essential things. T ## Build ``` -docker build . -t php-wasm -# create a temporary container -docker create --name=php-wasm php-wasm -# to copy builded files -docker cp php-wasm:/build/php-web.wasm ./build -docker cp php-wasm:/build/php-web.mjs ./build/php-web.mjs +docker buildx bake ``` Builded files will be located in `build/php-web.js` and `build/php-web.wasm`. diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 000000000..00bd33e59 --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,4 @@ +target "default" { + output = ["type=local,dest=./build"] + tags = ["php-wasm"] +}