Skip to content

Commit

Permalink
add docker-bake (#5)
Browse files Browse the repository at this point in the history
* add base for docker-bake

* simplify config

* use tab
  • Loading branch information
mykiwi committed Dec 10, 2023
1 parent b264188 commit 94332cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Expand Up @@ -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/ .
7 changes: 1 addition & 6 deletions README.md
Expand Up @@ -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`.
Expand Down
4 changes: 4 additions & 0 deletions docker-bake.hcl
@@ -0,0 +1,4 @@
target "default" {
output = ["type=local,dest=./build"]
tags = ["php-wasm"]
}

0 comments on commit 94332cc

Please sign in to comment.