forked from rust-bitcoin/rust-bitcoinconsensus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
77 additions
and
5 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
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,27 @@ | ||
FROM rust:1.70-bookworm as builder | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y dist-upgrade \ | ||
&& apt-get install --no-install-recommends -y \ | ||
build-essential \ | ||
ca-certificates \ | ||
clang \ | ||
emscripten \ | ||
libc6-dev-i386 \ | ||
libstdc++-11-dev \ | ||
pkg-config \ | ||
sudo \ | ||
wasi-libc \ | ||
&& apt -y autoremove \ | ||
&& apt clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG UID | ||
RUN useradd -m -u $UID satoshi | ||
USER satoshi | ||
WORKDIR /bitcoinconsensus | ||
|
||
RUN cargo install wasm-pack | ||
RUN rustup target add wasm32-unknown-emscripten \ | ||
&& rustup target add wasm32-unknown-unknown \ | ||
&& rustup target add wasm32-wasi |
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,22 @@ | ||
TAG := bitcoinconsensus | ||
|
||
DOCKER_RUN := docker run --interactive --rm \ | ||
-v ${PWD}:/bitcoinconsensus \ | ||
|
||
build-emscripten: builder | ||
$(DOCKER_RUN) --tty ${TAG} cargo build --target wasm32-unknown-emscripten | ||
|
||
build-unknown: builder | ||
$(DOCKER_RUN) --tty ${TAG} cargo build --target wasm32-unknown-unknown | ||
|
||
build-wasi: builder | ||
$(DOCKER_RUN) --tty ${TAG} cargo build --target wasm32-wasi | ||
|
||
wasm-pack: builder | ||
$(DOCKER_RUN) --tty ${TAG} wasm-pack build --target web | ||
|
||
builder: | ||
docker build --tag ${TAG} \ | ||
--build-arg UID="$(shell id -u)" \ | ||
. | ||
|
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