From c6f17fd42edf466a6bf9ff975736721d01823e1e Mon Sep 17 00:00:00 2001 From: noprom Date: Tue, 3 Apr 2018 16:11:02 +0800 Subject: [PATCH] fix bug when run using docker-compose --- Docker/README.md | 11 +++++++---- Docker/docker-compose.yml | 6 +++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Docker/README.md b/Docker/README.md index 9538a8ea6..e62bb74d0 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -4,10 +4,11 @@ Simple and fast setup of EOS.IO on Docker is also available. ## Install Dependencies - [Docker](https://docs.docker.com) Docker 17.05 or higher is required + - [docker-compose](https://docs.docker.com/compose/) version >= 1.10.0 ## Docker Requirement - At least 8GB RAM (Docker -> Preferences -> Advanced -> Memory -> 8GB or above) - + ## Build eos image ```bash @@ -43,10 +44,12 @@ curl http://127.0.0.1:8888/v1/chain/get_info ## Start both nodeos and walletd containers ```bash -docker-compose up +docker volume create --name=nodeos-data-volume +docker volume create --name=walletd-data-volume +docker-compose up -d ``` -After `docker-compose up`, two services named nodeos and walletd will be started. nodeos service would expose ports 8888 and 9876 to the host. walletd service does not expose any port to the host, it is only accessible to cleos when runing cleos is running inside the walletd container as described in "Execute cleos commands" section. +After `docker-compose up -d`, two services named nodeos and walletd will be started. nodeos service would expose ports 8888 and 9876 to the host. walletd service does not expose any port to the host, it is only accessible to cleos when runing cleos is running inside the walletd container as described in "Execute cleos commands" section. ### Execute cleos commands @@ -54,7 +57,7 @@ After `docker-compose up`, two services named nodeos and walletd will be started You can run the `cleos` commands via a bash alias. ```bash -alias cleos='docker-compose exec walletd /opt/eosio/bin/cleos -H nodeos' +alias cleos='docker-compose exec walletd /opt/eosio/bin/cleos -H nodeosd' cleos get info cleos get account inita ``` diff --git a/Docker/docker-compose.yml b/Docker/docker-compose.yml index ae7e25df4..542f30245 100755 --- a/Docker/docker-compose.yml +++ b/Docker/docker-compose.yml @@ -1,4 +1,4 @@ -version: "4" +version: "3" services: builder: @@ -11,6 +11,7 @@ services: context: . image: eosio/eos command: /opt/eosio/bin/nodeosd.sh + hostname: nodeosd ports: - 8888:8888 - 9876:9876 @@ -22,6 +23,7 @@ services: walletd: image: eosio/eos command: /opt/eosio/bin/keosd + hostname: walletd links: - nodeosd volumes: @@ -29,4 +31,6 @@ services: volumes: nodeos-data-volume: + external: true walletd-data-volume: + external: true -- GitLab