Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Changes to Docker buildere
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Iles committed May 10, 2018
1 parent 5100a22 commit 5b0a011
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
25 changes: 25 additions & 0 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,31 @@ If you don't need keosd afterwards, you can stop the keosd service using
docker-compose stop keosd
```

### Develop/Build custom contracts

Due to the fact that the eosio/eos image does not contain the required dependencies for contract development (this is by design, to keep the image size small), you will need to utilize eosio/builder. However, eosio/builder does not contain eosiocpp. As such, you will need to run eosio/builder interactively, and clone, build and install EOS. Once this is complete, you can then utilize eosiocpp to compile your contracts.

You can also create a Dockerfile that will do this for you.

```
FROM eosio/builder
RUN git clone -b master --depth 1 https://github.com/EOSIO/eos.git --recursive \
&& cd eos \
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true \
&& cmake --build /tmp/build --target install && rm -rf /tmp/build /eos
```

Then, from the same directory as the Dockerfile, simply run:

```bash
docker build -t eosio/contracts .
docker run -it -v /path/to/custom/contracts:/contracts eosio/contracts /bin/bash
```

At this time you should be at a bash shell. You can navigate into the /contracts directory and use eosiocpp to compile your custom contracts.

### Change default configuration

You can use docker compose override file to change the default configurations. For example, create an alternate config file `config2.ini` and a `docker-compose.override.yml` with the following content.
Expand Down
6 changes: 0 additions & 6 deletions Docker/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,3 @@ RUN git clone --depth 1 --single-branch --branch master https://github.com/ucb-b
&& mv ../../source/include /opt/berkeley-softfloat-3/include && cd - && rm -rf berkeley-softfloat-3

ENV SOFTFLOAT_ROOT /opt/berkeley-softfloat-3

RUN git clone -b master --depth 1 https://github.com/EOSIO/eos.git --recursive \
&& cd eos \
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true \
&& cmake --build /tmp/build --target install && rm -rf /tmp/build /eos

0 comments on commit 5b0a011

Please sign in to comment.