diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 4b30514e335..0a37e7c2052 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -1,20 +1,27 @@ -FROM ubuntu:xenial-20170619 +FROM ubuntu MAINTAINER xiaobo (peterwillcn@gmail.com) RUN echo 'APT::Install-Recommends 0;' >> /etc/apt/apt.conf.d/01norecommends \ && echo 'APT::Install-Suggests 0;' >> /etc/apt/apt.conf.d/01norecommends \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y vim sudo wget htop iftop net-tools ca-certificates unzip + && DEBIAN_FRONTEND=noninteractive apt-get install -y sudo wget net-tools ca-certificates unzip RUN echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main" >> /etc/apt/sources.list.d/llvm.list \ - && echo "deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main" >> /etc/apt/sources.list.d/llvm.list \ && wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y git-core automake autoconf libtool make cmake build-essential automake pkg-config libtool \ - mpi-default-dev libicu-dev python-dev python3-dev libbz2-dev zlib1g-dev clang libssl-dev \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y git-core automake autoconf libtool build-essential pkg-config libtool \ + mpi-default-dev libicu-dev python-dev python3-dev libbz2-dev zlib1g-dev libssl-dev \ clang-4.0 lldb-4.0 lld-4.0 \ && rm -rf /var/lib/apt/lists/* +RUN update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-4.0/bin/clang 400 \ + && update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-4.0/bin/clang++ 400 + +RUN cd /tmp && wget https://cmake.org/files/v3.9/cmake-3.9.0-Linux-x86_64.sh \ + && mkdir /opt/cmake && chmod +x /tmp/cmake-3.9.0-Linux-x86_64.sh \ + && sh /tmp/cmake-3.9.0-Linux-x86_64.sh --prefix=/opt/cmake --skip-license \ + && ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake + RUN cd /tmp && wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz \ && tar zxf boost_1_64_0.tar.gz \ && cd boost_1_64_0 \ @@ -23,17 +30,21 @@ RUN cd /tmp && wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_ && ./b2 install --prefix=/usr \ && rm -rf /tmp/boost_1_64_0* -RUN update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-4.0/bin/clang 400 \ - && update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-4.0/bin/clang++ 400 - RUN cd /tmp && git clone https://github.com/cryptonomex/secp256k1-zkp.git \ - && tar zcf secp256k1-zkp.tgz secp256k1-zkp && cd secp256k1-zkp \ + && cd secp256k1-zkp \ && ./autogen.sh && ./configure && make && make install \ && ldconfig && rm -rf /tmp/secp256k1-zkp* +RUN cd /tmp && mkdir wasm-compiler && cd wasm-compiler \ + && git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git \ + && cd llvm/tools && git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git \ + && cd .. && mkdir build && cd build \ + && cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/opt/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ../ \ + && make -j$(nproc) install && rm -rf /tmp/wasm-compiler + RUN cd /tmp && git clone https://github.com/EOSIO/eos.git --recursive \ - && touch /tmp/eos/contracts/CMakeLists.txt && cd eos && mkdir build && cd build \ - && cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_STANDARD=14 -DCMAKE_INSTALL_PREFIX=/opt/eos ../ \ + && cd eos && mkdir build && cd build \ + && WASM_LLVM_CONFIG=/opt/wasm/bin/llvm-config cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/opt/eos ../ \ && make -j$(nproc) && make install \ && rm -rf /tmp/eos* diff --git a/Docker/README.md b/Docker/README.md index beb7be0f25b..5d5fe727ec2 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -10,12 +10,13 @@ Build eos images ``` cd eos/Docker cp ../genesis.json . -docker build -t eosio/eos . +docker build --rm -t eosio/eos . ``` Start docker ``` +sudo rm -rf /data/store/eos # options sudo mkdir -p /data/store/eos docker-compose -f docker-compose.yml up ``` diff --git a/README.md b/README.md index ea92b60c09a..a2bf186af27 100644 --- a/README.md +++ b/README.md @@ -92,12 +92,13 @@ Build eos images ``` cd eos/Docker cp ../genesis.json . -docker build -t eosio/eos . +docker build --rm -t eosio/eos . ``` Start docker ``` +sudo rm -rf /data/store/eos # options sudo mkdir -p /data/store/eos docker-compose -f docker-compose.yml up ``` diff --git a/circle.yml b/circle.yml new file mode 100644 index 00000000000..7efb088f0e3 --- /dev/null +++ b/circle.yml @@ -0,0 +1,13 @@ +machine: + services: + - docker + +dependencies: + override: + - cd ~/eos/Docker && docker build -t eosio/eos . + +test: + pre: + - sleep 5 + override: + - docker run eosio/eos