Dockerfile.const 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. # syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
  2. FROM cli-gen as cli-export
  3. FROM node:18-alpine@sha256:44aaf1ccc80eaed6572a0f2ef7d6b5a2982d54481e4255480041ac92221e2f11 as const-build
  4. # fetch scripts/guardian-set-init.sh deps
  5. RUN apk update && apk add bash g++ make python3 curl jq findutils
  6. # Copy and link CLI
  7. COPY --from=cli-export clients/js /cli
  8. WORKDIR /cli
  9. RUN npm link
  10. WORKDIR /
  11. COPY scripts ./scripts
  12. COPY ethereum/.env.test ./ethereum/.env.test
  13. ARG num_guardians
  14. ENV NUM_GUARDIANS=$num_guardians
  15. # run distribute-devnet-consts.sh to copy devnet-consts.json to chain dirs for use
  16. RUN ./scripts/distribute-devnet-consts.sh
  17. # run guardian-set-init.sh to create env files with the init state for NUM_GUARDIANS
  18. RUN ./scripts/guardian-set-init.sh $NUM_GUARDIANS
  19. FROM scratch AS const-export
  20. COPY --from=const-build /scripts/.env.0x .env.0x
  21. COPY --from=const-build /scripts/.env.hex .env
  22. COPY --from=const-build /scripts/devnet-consts.json devnet-consts.json