forked from wormhole-foundation/wormhole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.const
54 lines (40 loc) · 1.99 KB
/
Dockerfile.const
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
FROM node:16-alpine@sha256:004dbac84fed48e20f9888a23e32fa7cf83c2995e174a78d41d9a9dd1e051a20 as const-build
# fetch scripts/guardian-set-init.sh deps
RUN apk update && apk add bash g++ make python3 curl jq findutils
# 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
# install CLI deps & build
WORKDIR /clients/js
# copy package.json & package-lock.json by themselves to create a cache layer
COPY clients/js/package.json clients/js/package-lock.json ./
# mount the buildkit cache on npm's cache dir, install dependencies
# Commenting out npm cache due to heisenbug with github build machines
# RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm
RUN npm ci
# copy the rest of the source files, as a layer on top of the deps
COPY clients/js ./
# build CLI
RUN make build
WORKDIR /
COPY scripts ./scripts
COPY ethereum/.env.test ./ethereum/.env.test
ARG num_guardians
ENV NUM_GUARDIANS=$num_guardians
# run distribute-devnet-consts.sh to copy devnet-consts.json to chain dirs for use
RUN ./scripts/distribute-devnet-consts.sh
# 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
COPY --from=const-build /scripts/.env.hex cosmwasm/deployment/terra2/tools/.env
COPY --from=const-build /scripts/.env.hex algorand/.env
COPY --from=const-build /scripts/.env.hex near/.env
COPY --from=const-build /scripts/.env.hex sui/.env
COPY --from=const-build /scripts/.env.hex aptos/.env
COPY --from=const-build /scripts/.env.hex wormchain/contracts/tools/.env
COPY --from=const-build /scripts/devnet-consts.json wormchain/contracts/tools/