I have used docker to install EOS and to run nodeos. Here are the containers -
docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 39d42adc46cc eosio/eos "/opt/eosio/bin/keos…" 10 hours ago Up 10 hours docker_keosd_1 7af14e3c1b23 eosio/eos "/opt/eosio/bin/node…" 10 hours ago Up 10 hours 0.0.0.0:8888->8888/tcp, 0.0.0.0:9876->9876/tcp docker_nodeosd_1
I need to add a plugin for history, for example - https://eosio-nodeos.readme.io/docs/history_api_plugin -
# config.ini plugin = eosio::chain_plugin plugin = eosio::mongo_db_plugin # nodeos startup params --plugin eosio::chain_plugin --plugin eosio::mongo_db_plugin
I guess I could use docker-compose down, change config.ini (and Dockerfile), and then up but I am unsure what impact that would have on persistent data and also that is not very convenient.
Is there a preferred way to add plugins to a docker container running nodeos? On a related point, I will need to add more nodes, so I assume there is an easy way to add more nodes also using docker, is that starting new containers (or does that mean defining a service in docker)?
Here is the Dockerfile -
FROM eosio/builder as builder ARG branch=master ARG symbol=SYS RUN git clone -b $branch https://github.com/EOSIO/eos.git --recursive \ && cd eos && echo "$branch:$(git rev-parse HEAD)" > /etc/eosio-version \ && cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/tmp/build -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true - DCORE_SYMBOL_NAME=$symbol \ && cmake --build /tmp/build --target install && rm /tmp/build/bin/eosiocpp FROM ubuntu:18.04 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates && rm -rf /var/lib/apt/lists/* COPY --from=builder /usr/local/lib/* /usr/local/lib/ COPY --from=builder /tmp/build/bin /opt/eosio/bin COPY --from=builder /tmp/build/contracts /contracts COPY --from=builder /eos/Docker/config.ini / COPY --from=builder /etc/eosio-version /etc COPY --from=builder /eos/Docker/nodeosd.sh /opt/eosio/bin/nodeosd.sh ENV EOSIO_ROOT=/opt/eosio RUN chmod +x /opt/eosio/bin/nodeosd.sh ENV LD_LIBRARY_PATH /usr/local/lib VOLUME /opt/eosio/bin/data-dir ENV PATH /opt/eosio/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin