11# ##
22# # docker image build \
33# # --file testchains/nethermind.dockerfile \
4- # # --tag nexus.iex.ec/poco-chain:native-vX.Y.Z-alpha.0 \
4+ # # --tag nexus.intra. iex.ec/poco-chain:native-vX.Y.Z-alpha.0-5s \
55# # --build-arg MNEMONIC="actual surround disorder swim upgrade devote digital misery truly verb slide final" \
66# # --build-arg CHAIN_TYPE=native \
77# # --build-arg CHAIN_BLOCK_TIME=5 \
1111
1212FROM iexechub/nethermind:1.14.1-patch.0 AS builder
1313
14- RUN apt-get update && apt-get install bash jq nodejs npm -y
15- # Add git required to install ethereumjs-abi from github (https://github.com/MetaMask/web3-provider-engine/issues/345)
16- #
17- 18- 19- 20- 21- # └── [email protected] (git+https://github.com/ethereumjs/ethereumjs-abi.git#ee3994657fa7a427238e6ba92a84d0b529bbcde0)22- RUN apt-get install git -y
14+ RUN apt-get update && apt-get -y install bash jq nodejs npm git
2315RUN echo -e "Node: `node -v` - npm: `npm -v`"
2416
2517# ##
@@ -38,6 +30,18 @@ RUN echo "CHAIN_BLOCK_TIME: ${CHAIN_BLOCK_TIME}"
3830ARG CHAIN_FORCE_SEALING=true
3931RUN echo "CHAIN_FORCE_SEALING: ${CHAIN_FORCE_SEALING}"
4032
33+ # ##
34+ # # Install npm packages
35+ # ##
36+ WORKDIR /iexec-poco
37+ COPY package.json package-lock.json ./
38+ # Remove ethereumjs-util for sidechains
39+ RUN if [ "${CHAIN_TYPE}" = "native" ] ; \
40+ then \
41+ sed -i '/ethereumjs-util/d' package.json; \
42+ fi
43+ RUN npm ci --production=false
44+
4145# ##
4246# # Copy chain config.
4347# ##
@@ -53,10 +57,20 @@ RUN if [ "${CHAIN_TYPE}" = "native" ] ; \
5357 fi
5458
5559# ##
56- # # Copy PoCo contracts
60+ # # Copy project files
61+ # # Copy only needed files to make use
62+ # # of Docker's build cache.
5763# ##
58- COPY . /iexec-poco
59- RUN mv /iexec-poco/config/config_${CHAIN_TYPE}.json /iexec-poco/config/config.json
64+ COPY config config
65+ COPY contracts contracts
66+ COPY migrations migrations
67+ COPY scripts scripts
68+ COPY utils utils
69+ COPY truffle-security.json truffle-security.json
70+ COPY truffle.js truffle.js
71+ COPY testchains/nethermind/migrate-all.sh migrate-all.sh
72+ COPY testchains/nethermind/migrate.sh migrate.sh
73+ RUN mv config/config_${CHAIN_TYPE}.json config/config.json
6074
6175# ##
6276# # Deploy contracts
@@ -69,19 +83,20 @@ RUN echo "MNEMONIC: ${MNEMONIC}"
6983# token -> migrate-all.sh
7084RUN if [ "${CHAIN_TYPE}" = "native" ] ; \
7185 then \
72- echo "Migration file: ${BASE_DIR}/ migrate.sh" ; \
73- bash /iexec-poco/testchains/nethermind/ migrate.sh; \
86+ echo "Migration file: migrate.sh" ; \
87+ bash migrate.sh; \
7488 else \
75- echo "Migration file: ${BASE_DIR}/ migrate-all.sh" ; \
76- bash /iexec-poco/testchains/nethermind/ migrate-all.sh; \
89+ echo "Migration file: migrate-all.sh" ; \
90+ bash migrate-all.sh; \
7791 fi
7892
7993FROM iexechub/nethermind:1.14.1-patch.0
8094
8195COPY --from=builder /nethermind /nethermind
96+ COPY --from=builder /iexec-poco/build /build
8297
8398# ##
8499# # Configure entrypoint
85100# ##
86101ENTRYPOINT [ "/nethermind/Nethermind.Runner" ]
87- CMD [ "--config=/nethermind/configs/ poco-chain.cfg " ]
102+ CMD [ "--config poco-chain" ]
0 commit comments