Skip to content

Commit

Permalink
feat(local docker build and run)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhalambek committed Mar 8, 2021
1 parent 3ae275a commit 77d22e0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
Dockerfile.local
34 changes: 34 additions & 0 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM bridge as bridge
FROM ubuntu:20.04 as wasm

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update -qq && apt-get install -y \
git \
cmake \
g++ \
pkg-config \
libssl-dev \
curl \
llvm \
clang \
&& rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | \
sh -s -- -y --no-modify-path

RUN rustup target add wasm32-unknown-unknown
WORKDIR /root
COPY . .
RUN ./build.sh

FROM node:12
ENV NEAR_ENV local
RUN npm install -g near-cli
COPY --from=bridge /root/.near/localnet/node0/validator_key.json .
COPY --from=wasm /root/res/linkdrop.wasm .
CMD ["near deploy --accountId node0 --wasmFile linkdrop.wasm --keyPath validator_key.json --nodeUrl $NODE_URL"]

0 comments on commit 77d22e0

Please sign in to comment.