Skip to content

Commit

Permalink
[docker] Added Dockerfile for the Move CLI
Browse files Browse the repository at this point in the history
Added Dockerfile for Move command-line interface for getting started
easier. This Dockerfile is based on the CI image found in docker/.

Also added building instructions to README.
  • Loading branch information
villesundell authored and vgao1996 committed May 23, 2022
1 parent f7d5b1a commit 6941dce
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ Move is a programming language for writing safe smart contracts originally devel

This repository is the official home of the Move virtual machine, bytecode verifier, compiler, prover, package manager, and book. For Move code examples and papers, check out [awesome-move](https://github.com/MystenLabs/awesome-move).

## Quickstart

### Build the [Docker](https://www.docker.com/community/open-source/) Image for the Command Line Tool

```
docker build -t move/cli -f docker/move-cli/Dockerfile .
```

### Build a Test Project

```
cd ./language/documentation/tutorial/step_1/BasicCoin
docker run -v `pwd`:/project move/cli package build
```

## Community

* Join us on the [Move Discord](https://discord.gg/cPUmhe24Mz).
Expand Down
41 changes: 41 additions & 0 deletions docker/move-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM debian:buster-20211011@sha256:f9182ead292f45165f4a851e5ff98ea0800e172ccedce7d17764ffaae5ed4d6e

VOLUME /project
WORKDIR /project

ADD . /move/

#Needed for sccache to function, and to work around home dir being blatted.
ENV CARGO_HOME "/opt/cargo"
ENV RUSTUP_HOME "/opt/rustup"

ENV DOTNET_ROOT "/opt/dotnet"
ENV Z3_EXE "/opt/bin/z3"
ENV CVC5_EXE "/opt/bin/cvc5"
ENV BOOGIE_EXE "/opt/dotnet/tools/boogie"
ENV SOLC_EXE "/opt/bin/solc"
ENV PATH "/opt/cargo/bin:/usr/lib/golang/bin:/opt/bin:${DOTNET_ROOT}:${DOTNET_ROOT}/tools:$PATH"

# Batch mode and all operations tooling
RUN mkdir -p /github/home && \
mkdir -p /opt/cargo/ && \
mkdir -p /opt/git/ && \
/move/scripts/dev_setup.sh -t -b -p -y -d -n && \
apt-get install -y git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Compile a small rust tool? But we already have in dev_setup (sccache/grcov)...?
# Test that all commands we need are installed and on the PATH
RUN [ -x "$(set -x; command -v rustup)" ] \
&& [ -x "$(set -x; command -v cargo)" ] \
&& [ -x "$(set -x; command -v solc)" ] \
&& [ -x "$(set -x; command -v z3)" ] \
&& [ -x "$(set -x; command -v "$BOOGIE_EXE")" ] \
&& [ -x "$(set -x; xargs rustup which cargo --toolchain < /move/rust-toolchain )" ] \
&& [ -x "$(set -x; command -v clang)" ] \
&& [ -x "$(set -x; command -v npm)" ]

RUN cd /move; cargo build -p move-cli

ENTRYPOINT ["/move/target/debug/move"]

0 comments on commit 6941dce

Please sign in to comment.