2022-04-08 13:54:04 -07:00
|
|
|
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
|
2022-10-27 12:20:50 -07:00
|
|
|
FROM node:16-alpine@sha256:004dbac84fed48e20f9888a23e32fa7cf83c2995e174a78d41d9a9dd1e051a20 as const-build
|
2022-04-08 13:54:04 -07:00
|
|
|
|
|
|
|
# fetch scripts/guardian-set-init.sh deps
|
2022-10-27 12:20:50 -07:00
|
|
|
RUN apk update && apk add bash g++ make python3 curl jq findutils
|
2022-04-08 13:54:04 -07:00
|
|
|
|
2022-10-27 12:20:50 -07:00
|
|
|
# Support additional root CAs
|
|
|
|
COPY README.md cert.pem* /certs/
|
|
|
|
# Alpine
|
|
|
|
RUN if [ -e /certs/cert.pem ]; then cp /certs/cert.pem /etc/ssl/cert.pem; fi
|
2022-04-08 13:54:04 -07:00
|
|
|
|
2022-07-02 10:52:28 -07:00
|
|
|
# install CLI deps & build
|
2022-05-05 17:51:24 -07:00
|
|
|
WORKDIR /clients/js
|
2022-10-27 12:20:50 -07:00
|
|
|
|
2022-04-08 13:54:04 -07:00
|
|
|
# copy package.json & package-lock.json by themselves to create a cache layer
|
2022-05-05 17:51:24 -07:00
|
|
|
COPY clients/js/package.json clients/js/package-lock.json ./
|
2022-04-08 13:54:04 -07:00
|
|
|
# mount the buildkit cache on npm's cache dir, install dependencies
|
2022-11-02 13:21:08 -07:00
|
|
|
|
|
|
|
# Commenting out npm cache due to heisenbug with github build machines
|
2022-12-12 15:43:22 -08:00
|
|
|
# RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm
|
2022-11-02 13:21:08 -07:00
|
|
|
|
|
|
|
RUN npm ci
|
|
|
|
|
2022-04-08 13:54:04 -07:00
|
|
|
# copy the rest of the source files, as a layer on top of the deps
|
2022-05-05 17:51:24 -07:00
|
|
|
COPY clients/js ./
|
2022-07-02 10:52:28 -07:00
|
|
|
# build CLI
|
|
|
|
RUN make build
|
2022-04-08 13:54:04 -07:00
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
|
|
|
|
COPY scripts ./scripts
|
|
|
|
COPY ethereum/.env.test ./ethereum/.env.test
|
|
|
|
|
2022-10-17 05:16:54 -07:00
|
|
|
ARG num_guardians
|
|
|
|
ENV NUM_GUARDIANS=$num_guardians
|
|
|
|
|
2023-01-27 11:27:21 -08:00
|
|
|
# run distribute-devnet-consts.sh to copy devnet-consts.json to chain dirs for use
|
|
|
|
RUN ./scripts/distribute-devnet-consts.sh
|
|
|
|
|
2022-04-08 13:54:04 -07:00
|
|
|
# run guardian-set-init.sh to create env files with the init state for NUM_GUARDIANS
|
|
|
|
RUN ./scripts/guardian-set-init.sh $NUM_GUARDIANS
|
|
|
|
|
|
|
|
FROM scratch AS const-export
|
|
|
|
COPY --from=const-build /scripts/.env.0x ethereum/.env
|
|
|
|
COPY --from=const-build /scripts/.env.hex solana/.env
|
|
|
|
COPY --from=const-build /scripts/.env.hex terra/tools/.env
|
2022-12-12 15:43:22 -08:00
|
|
|
COPY --from=const-build /scripts/.env.hex cosmwasm/deployment/terra2/tools/.env
|
2022-04-29 12:53:48 -07:00
|
|
|
COPY --from=const-build /scripts/.env.hex algorand/.env
|
2022-08-04 08:52:26 -07:00
|
|
|
COPY --from=const-build /scripts/.env.hex near/.env
|
2022-10-13 18:23:23 -07:00
|
|
|
COPY --from=const-build /scripts/.env.hex aptos/.env
|
2023-01-27 11:27:21 -08:00
|
|
|
COPY --from=const-build /scripts/.env.hex wormchain/contracts/tools/.env
|
|
|
|
|
|
|
|
COPY --from=const-build /scripts/devnet-consts.json wormchain/contracts/tools/
|