forked from AleoNet/snarkOS
-
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.
Merge pull request AleoNet#1288 from AleoHQ/docker-builds
Docker builds
- Loading branch information
Showing
3 changed files
with
180 additions
and
0 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,59 @@ | ||
FROM ubuntu:18.04 AS builder | ||
ENV RUSTUP_HOME=/usr/local/rustup \ | ||
CARGO_HOME=/usr/local/cargo \ | ||
PATH=/usr/local/cargo/bin:$PATH \ | ||
DEBIAN_FRONTEND=noninteractive | ||
RUN set -eux ; \ | ||
apt-get update -y && \ | ||
apt-get dist-upgrade -y && \ | ||
apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
gcc \ | ||
libc6-dev \ | ||
wget \ | ||
build-essential \ | ||
clang \ | ||
gcc \ | ||
libssl-dev \ | ||
make \ | ||
pkg-config \ | ||
xz-utils && \ | ||
dpkgArch="$(dpkg --print-architecture)"; \ | ||
case "${dpkgArch##*-}" in \ | ||
amd64) rustArch='x86_64-unknown-linux-gnu' ;; \ | ||
arm64) rustArch='aarch64-unknown-linux-gnu' ;; \ | ||
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ | ||
esac; \ | ||
\ | ||
url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \ | ||
wget "$url"; \ | ||
chmod +x rustup-init; \ | ||
./rustup-init -y --no-modify-path --default-toolchain stable; \ | ||
rm rustup-init; \ | ||
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ | ||
rustup --version; \ | ||
cargo --version; \ | ||
rustc --version; \ | ||
apt-get remove -y --auto-remove wget && \ | ||
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/*; | ||
WORKDIR /usr/src/snarkOS | ||
COPY . . | ||
RUN cargo build --release | ||
FROM ubuntu:18.04 | ||
SHELL ["/bin/bash", "-c"] | ||
VOLUME ["/aleo/data"] | ||
RUN set -ex && \ | ||
apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y -o DPkg::Options::=--force-confold && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
ca-certificates curl jq && \ | ||
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
mkdir -p /aleo/{bin,data} && \ | ||
mkdir /usr/local/cargo | ||
COPY --from=builder /usr/src/snarkOS/target/release/snarkos /aleo/bin/ | ||
COPY --from=builder /usr/src/snarkOS/start /aleo/ | ||
CMD ["/aleo/start"] |
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,8 @@ | ||
#!/bin/bash | ||
mkdir -p /aleo/data/ledger && \ | ||
mkdir -p /aleo/data/params/git/checkouts/snarkvm-f1160780ffe17de8/e7266f9/parameters/src/testnet2/resources && \ | ||
mkdir -p /aleo/data/params/registry/src/github.com-1ecc6299db9ec823/snarkvm-parameters-0.7.9/src/testnet2/resources && \ | ||
ln -s /aleo/data/ledger /.ledger-2 && \ | ||
ln -s /aleo/data/params/git /usr/local/cargo/git && \ | ||
ln -s /aleo/data/params/registry /usr/local/cargo/registry && \ | ||
/aleo/bin/snarkos --node 4132 --rpc 3032 --verbosity 3 --trial |