Skip to content

Commit

Permalink
add basic Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid committed Mar 20, 2021
1 parent be56ef5 commit 08de2b7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM debian:buster

RUN apt update && \
# Install common dependencies
apt install -y \
cmake \
curl \
g++ \
gcc \
git \
gnupg \
lsb-release \
make \
software-properties-common \
wget && \
# Install LLVM:12
curl -sSf https://apt.llvm.org/llvm.sh | bash -s -- 12 && \
# Install Node.js:14
curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && \
apt install nodejs -y && \
# Install Rust nightly
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \
--default-toolchain nightly \
--profile minimal \
--component clippy,rustfmt,rust-src \
--target wasm32-unknown-unknown && \
echo 'source $HOME/.cargo/env' >> $HOME/.bashrc && \
# Install wasm-opt from binaryen
git clone --depth 1 --branch version_100 https://github.com/WebAssembly/binaryen.git /binaryen && \
cd /binaryen && \
cmake . && \
make -j$(nproc) && \
make install && \
rm -rf /binaryen && \
# Remove apt files
rm -rf /var/lib/{apt,dpkg,cache,log}/
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-js:
build-node-%: export PAIR = $(subst +, ,$(subst build-node-,,$@))
build-node-%:
cargo build --package secp256k1-node --target $(firstword $(PAIR)) -Z build-std=panic_abort,std --release
cp -f target/$(firstword $(PAIR))/release/libsecp256k1_node.so lib/secp256k1-$(lastword $(PAIR)).so
mkdir -p lib && cp -f target/$(firstword $(PAIR))/release/libsecp256k1_node.so lib/secp256k1-$(lastword $(PAIR)).so
strip lib/secp256k1-$(lastword $(PAIR)).so

.PHONY: build-node-debug
Expand All @@ -17,7 +17,7 @@ build-node-debug:
build-node-debug-%: export PAIR = $(subst +, ,$(subst build-node-debug-,,$@))
build-node-debug-%:
cargo build --package secp256k1-node --target $(firstword $(PAIR))
cp -f target/$(firstword $(PAIR))/debug/libsecp256k1_node.so lib/secp256k1-$(lastword $(PAIR)).so
mkdir -p lib && cp -f target/$(firstword $(PAIR))/debug/libsecp256k1_node.so lib/secp256k1-$(lastword $(PAIR)).so

.PHONY: build-wasm
build-wasm:
Expand Down

0 comments on commit 08de2b7

Please sign in to comment.