Permalink
Browse files

Provide a Dockerfile to build a standard development image

  • Loading branch information...
jubianchi committed Mar 22, 2016
1 parent 4e83bc7 commit 8e0a6bfd0f006c05194fee67ff5d986f23b6bf8d
Showing with 51 additions and 0 deletions.
  1. +27 −0 Dockerfile
  2. +24 −0 README.md
View
@@ -0,0 +1,27 @@
+FROM debian:jessie
+
+ENV ARCH=x86_64-unknown-linux-gnu
+ENV RUST_RELEASE=1.9.0
+ENV LLVM_RELEASE=3.9
+ENV CARGO_RELEASE=nightly
+
+RUN echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie main" > /etc/apt/sources.list.d/llvm.list && \
+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421 && \
+ apt-get update && \
+ apt-get install -y curl llvm-$LLVM_RELEASE vim gcc libssl-dev libedit-dev libstdc++-4.9-dev && \
+ find /usr/bin -executable -iname llvm* | xargs -n1 -I file echo ln -s file file | sed s/-$LLVM_RELEASE$// | bash
+
+RUN curl -sL https://static.rust-lang.org/dist/rust-$RUST_RELEASE-$ARCH.tar.gz | tar xvz -C /tmp && \
+ /tmp/rust-$RUST_RELEASE-$ARCH/install.sh && \
+ rm -rf /tmp/rust-$RUST_RELEASE-$ARCH
+
+RUN curl -sL https://static.rust-lang.org/cargo-dist/cargo-$CARGO_RELEASE-$ARCH.tar.gz | tar xvz -C /tmp && \
+ /tmp/cargo-$CARGO_RELEASE-$ARCH/install.sh && \
+ rm -rf /tmp/cargo-$CARGO_RELEASE-$ARCH
+
+RUN apt-get remove --purge -y curl && \
+ apt-get autoclean && apt-get clean && \
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+VOLUME /source
+WORKDIR /source
View
@@ -101,6 +101,30 @@ $ cargo build
$ ./target/debug/tvm --help
```
+### Using Docker
+
+If you don't want to install Rust and LLVM on your machine you can use Docker:
+It provides everything you will need to build, test and run Tagua VM.
+
+First, you will need to build the docker image:
+
+```sh
+$ docker build -t tagua-vm .
+```
+
+You will then be able to run a container from this image:
+
+```sh
+$ docker run --rm -it --name tagua-vm-dev -v `pwd`:/source` bash
+```
+
+You are now inside a fresh container. To see if everything is fine, you can
+start the test suite:
+
+```sh
+$ cargo test
+```
+
## Contributing
Do whatever you want. Just respect the license and the other contributors. Your

0 comments on commit 8e0a6bf

Please sign in to comment.