diff --git a/Dockerfile.const b/Dockerfile.const index 61348110e0..7e796104da 100644 --- a/Dockerfile.const +++ b/Dockerfile.const @@ -1,6 +1,6 @@ # syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2 FROM cli-gen as cli-export -FROM node:18-alpine@sha256:44aaf1ccc80eaed6572a0f2ef7d6b5a2982d54481e4255480041ac92221e2f11 as const-build +FROM node:18-alpine@sha256:6eb9c3d9bd191bd2cc6ce7ec3d5ec4c2127616140c8586af96a6bec8f28689d1 as const-build # fetch scripts/guardian-set-init.sh deps RUN apk update && apk add bash g++ make python3 curl jq findutils diff --git a/Dockerfile.proto b/Dockerfile.proto index fd94369095..65670a0f62 100644 --- a/Dockerfile.proto +++ b/Dockerfile.proto @@ -1,5 +1,5 @@ # syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2 -FROM docker.io/golang:1.23.3-bullseye@sha256:bc1b90c2a8eb0ffb62325e02a85d51031ad3afae15b3df4b6a48b7929b00badb AS go-tools +FROM docker.io/golang:1.23.3-bullseye@sha256:9e53abacfc22cd3df3e4ebcc04ac64951b71d2a38c52b690f3807af6a2000ed2 AS go-tools RUN mkdir /app @@ -10,7 +10,7 @@ RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \ cd /app/tools && CGO_ENABLED=0 ./build.sh # syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2 -FROM docker.io/golang:1.23.3-bullseye@sha256:bc1b90c2a8eb0ffb62325e02a85d51031ad3afae15b3df4b6a48b7929b00badb AS go-build +FROM docker.io/golang:1.23.3-bullseye@sha256:9e53abacfc22cd3df3e4ebcc04ac64951b71d2a38c52b690f3807af6a2000ed2 AS go-build COPY --from=go-tools /app /app @@ -22,7 +22,7 @@ RUN --mount=type=cache,target=/root/.cache \ tools/bin/buf lint && \ tools/bin/buf generate -FROM node:16-alpine@sha256:004dbac84fed48e20f9888a23e32fa7cf83c2995e174a78d41d9a9dd1e051a20 AS node-build +FROM node:16-alpine@sha256:a1f9d027912b58a7c75be7716c97cfbc6d3099f3a97ed84aa490be9dee20e787 AS node-build COPY --from=go-tools /app /app diff --git a/Tiltfile b/Tiltfile index 71872d3029..4ba2f5e5d8 100644 --- a/Tiltfile +++ b/Tiltfile @@ -124,15 +124,17 @@ def k8s_yaml_with_ns(objects): docker_build( ref = "cli-gen", - context = ".", - dockerfile = "Dockerfile.cli", + context = "clients/js", + dockerfile = "clients/js/Dockerfile", + ignore = ["build","node_modules"], ) docker_build( ref = "const-gen", context = ".", dockerfile = "Dockerfile.const", - build_args={"num_guardians": '%s' % (num_guardians)}, + build_args = {"num_guardians": '%s' % (num_guardians)}, + only = ["scripts", "ethereum/.env.test"] ) # node @@ -142,7 +144,8 @@ docker_build( context = ".", dockerfile = "node/Dockerfile", target = "build", - ignore=["./sdk/js", "./relayer"] + ignore = ["sdk/js", "sdk/js-*", "sdk/rust"], + only = ["node", "wormchain", "sdk"] ) def command_with_dlv(argv): @@ -512,26 +515,14 @@ docker_build( context = ".", only = ["./ethereum", "./relayer/ethereum"], dockerfile = "./ethereum/Dockerfile", - - # ignore local node_modules (in case they're present) ignore = ["./ethereum/node_modules","./relayer/ethereum/node_modules"], build_args = {"num_guardians": str(num_guardians), "dev": str(not ci)}, - - # sync external scripts for incremental development - # (everything else needs to be restarted from scratch for determinism) - # - # This relies on --update-mode=exec to work properly with a non-root user. - # https://github.com/tilt-dev/tilt/issues/3708 - live_update = [ - sync("./ethereum/src", "/home/node/app/src"), - ], ) if redis or generic_relayer: docker_build( ref = "redis", - context = ".", - only = ["./third_party"], + context = "third_party/redis", dockerfile = "third_party/redis/Dockerfile", ) @@ -573,8 +564,9 @@ if generic_relayer: ) docker_build( ref = "relayer-engine", - context = ".", - only = ["./relayer/generic_relayer", "./relayer/ethereum/ts-scripts/relayer/config"], + context = "relayer", + only = ["generic_relayer", "ethereum/ts-scripts/relayer/config"], + ignore = ["generic_relayer/node_modules"], dockerfile = "relayer/generic_relayer/relayer-engine-v2/Dockerfile", build_args = {"dev": str(not ci)} ) @@ -609,31 +601,22 @@ if ci_tests: ref = "sdk-test-image", context = ".", dockerfile = "testing/Dockerfile.sdk.test", - only = [], - live_update = [ - sync("./sdk/js/src", "/app/sdk/js/src"), - sync("./testing", "/app/testing"), - ], + only = ["ethereum", "relayer/ethereum", "solana/idl", "sdk/js", "testing"], + ignore = ["ethereum/node_modules", "relayer/ethereum/node_modules", "sdk/js/node_modules", "sdk/js/lib"], ) docker_build( ref = "spydk-test-image", context = ".", dockerfile = "testing/Dockerfile.spydk.test", - only = [], - live_update = [ - sync("./spydk/js/src", "/app/spydk/js/src"), - sync("./testing", "/app/testing"), - ], + only = ["spydk/js", "testing"], + ignore = ["spydk/js/node_modules", "spydk/js/lib"], ) docker_build( ref = "query-sdk-test-image", context = ".", dockerfile = "testing/Dockerfile.querysdk.test", - only = [], - live_update = [ - sync("./sdk/js/src", "/app/sdk/js-query/src"), - sync("./testing", "/app/testing"), - ], + only = ["sdk/js-query", "testing"], + ignore = ["sdk/js-query/node_modules", "sdk/js-query/lib"], ) k8s_yaml_with_ns( @@ -708,9 +691,10 @@ if terra2 or wormchain: docker_build( ref = "cosmwasm_artifacts", context = ".", - dockerfile = "./cosmwasm/Dockerfile", + dockerfile = "cosmwasm/Dockerfile", target = "artifacts", platform = "linux/amd64", + only = ["cosmwasm", "sdk/rust"] ) if terra2: @@ -778,10 +762,9 @@ if sui: docker_build( ref = "sui-node", target = "sui", - context = ".", + context = "sui", dockerfile = "sui/Dockerfile", - ignore = ["./sui/sui.log*", "sui/sui.log*", "sui.log.*"], - only = ["./sui"], + ignore = ["sui.log*"], ) k8s_resource( @@ -797,18 +780,12 @@ if sui: if near: k8s_yaml_with_ns("devnet/near-devnet.yaml") - docker_build( - ref = "near-node", - context = "near", - dockerfile = "near/Dockerfile", - only = ["Dockerfile", "node_builder.sh", "start_node.sh", "README.md"], - ) - docker_build( ref = "near-deploy", context = "near", dockerfile = "near/Dockerfile.deploy", - ignore = ["./test"] + ignore = ["./test"], + platform="linux/amd64" ) k8s_resource( @@ -828,8 +805,8 @@ if wormchain: dockerfile = "./wormchain/Dockerfile", platform = "linux/amd64", build_args = {"num_guardians": str(num_guardians)}, - only = [], - ignore = ["./wormchain/testing", "./wormchain/ts-sdk", "./wormchain/design", "./wormchain/vue", "./wormchain/build/wormchaind"], + only = ["wormchain", "sdk"], + ignore = ["./wormchain/testing", "./wormchain/ts-sdk", "./wormchain/design", "./wormchain/vue", "./wormchain/build/wormchaind", "sdk/js", "sdk/js-*", "sdk/rust"], ) # docker_build( @@ -905,9 +882,8 @@ if wormchain: if ibc_relayer: docker_build( ref = "ibc-relayer-image", - context = ".", - dockerfile = "./wormchain/ibc-relayer/Dockerfile", - only = [] + context = "wormchain/ibc-relayer", + dockerfile = "wormchain/ibc-relayer/Dockerfile", ) k8s_yaml_with_ns("devnet/ibc-relayer.yaml") diff --git a/aptos/Makefile b/aptos/Makefile index 1fd96377df..768292e0d4 100644 --- a/aptos/Makefile +++ b/aptos/Makefile @@ -7,6 +7,6 @@ $(TARGETS): $(foreach dir,$(CONTRACT_DIRS), make -C $(dir) $@ &&) true test-docker: - DOCKER_BUILDKIT=1 docker build --progress plain -f ../Dockerfile.cli -t cli-gen .. + DOCKER_BUILDKIT=1 docker build --progress plain -f ../clients/js/Dockerfile -t cli-gen ../clients/js DOCKER_BUILDKIT=1 docker build --build-arg num_guardians=1 --progress plain -f ../Dockerfile.const -t const-gen .. DOCKER_BUILDKIT=1 docker build --progress plain -f Dockerfile --target tests . diff --git a/clients/js/.dockerignore b/clients/js/.dockerignore new file mode 100644 index 0000000000..e3fbd98336 --- /dev/null +++ b/clients/js/.dockerignore @@ -0,0 +1,2 @@ +build +node_modules diff --git a/Dockerfile.cli b/clients/js/Dockerfile similarity index 69% rename from Dockerfile.cli rename to clients/js/Dockerfile index 3d5b35c672..d983342e82 100644 --- a/Dockerfile.cli +++ b/clients/js/Dockerfile @@ -1,15 +1,17 @@ # syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2 -FROM node:18-alpine@sha256:44aaf1ccc80eaed6572a0f2ef7d6b5a2982d54481e4255480041ac92221e2f11 as cli-build +FROM node:18-alpine@sha256:6eb9c3d9bd191bd2cc6ce7ec3d5ec4c2127616140c8586af96a6bec8f28689d1 as cli-build + +RUN apk update && apk add g++ make python3 # Copy package.json & package-lock.json by themselves to create a cache layer -COPY clients/js/package.json clients/js/package-lock.json /clients/js/ +COPY package.json package-lock.json /clients/js/ WORKDIR /clients/js RUN npm ci # Copy the rest of the source files, as a layer on top of the deps -COPY clients/js /clients/js +COPY . /clients/js # Build CLI RUN npm run build diff --git a/cosmwasm/Dockerfile.deploy b/cosmwasm/Dockerfile.deploy index d3558b37e4..b726dd3e20 100644 --- a/cosmwasm/Dockerfile.deploy +++ b/cosmwasm/Dockerfile.deploy @@ -7,7 +7,7 @@ FROM const-gen AS const-export FROM cosmwasm_artifacts AS artifacts # Contract deployment stage -FROM node:16-buster-slim@sha256:93c9fc3550f5f7d159f282027228e90e3a7f8bf38544758024f005e82607f546 +FROM node:16-buster-slim@sha256:3ebf2875c188d22939c6ab080cfb1a4a6248cc86bae600ea8e2326aa03acdb8f RUN apt update && apt install netcat curl jq -y diff --git a/devnet/near-devnet.yaml b/devnet/near-devnet.yaml index dcd78da2c3..a655bdb87f 100644 --- a/devnet/near-devnet.yaml +++ b/devnet/near-devnet.yaml @@ -31,7 +31,7 @@ spec: spec: containers: - name: near-node - image: near-node + image: ghcr.io/wormhole-foundation/near:2.4.0@sha256:22673c4152621a9c0624252e455b2743f20e37d8c7e3bc8e617b3e7df2ba39ce env: # this still results in DEBUG logs from "stats", but `warn,stats=warn` didn't work - name: RUST_LOG @@ -56,11 +56,14 @@ spec: command: - /bin/sh - -c - - "sh /app/devnet_deploy.sh && touch success && sleep infinity" + - "npx ts-node devnet_deploy.ts && touch success && sleep infinity" readinessProbe: - tcpSocket: - port: 3030 - periodSeconds: 1 - initialDelaySeconds: 15 + exec: + command: + - test + - -e + - "success" + initialDelaySeconds: 5 + periodSeconds: 5 restartPolicy: Always diff --git a/ethereum/Dockerfile b/ethereum/Dockerfile index 68f644a449..d1c92e3e56 100644 --- a/ethereum/Dockerfile +++ b/ethereum/Dockerfile @@ -1,24 +1,16 @@ # syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2 FROM const-gen AS const-export -FROM --platform=linux/amd64 ghcr.io/foundry-rs/foundry:nightly-55bf41564f605cae3ca4c95ac5d468b1f14447f9@sha256:8c15d322da81a6deaf827222e173f3f81c653136a3518d5eeb41250a0f2e17ea as foundry -FROM node:19.6.1-slim@sha256:a1ba21bf0c92931d02a8416f0a54daad66cb36a85d2b73af9d73b044f5f57cfc - -# npm wants to clone random Git repositories - lovely. -# RUN apk add git python make build-base -# RUN apk update && apk add bash -RUN apt-get update && apt-get -y install \ - git python make curl netcat vim - -RUN npm i typescript -g -RUN apt-get -y install jq +FROM ghcr.io/wormholelabs-xyz/foundry:nightly-55bf41564f605cae3ca4c95ac5d468b1f14447f9@sha256:50ffe8f3ba79274eaab85ce65e769e3d66b1c680f5a9acb9c25a393c4daeeeeb as foundry +FROM node:19.6.1-slim@sha256:e684615bdfb71cb676b3d0dfcc538c416f7254697d8f9639bd87255062fd1681 COPY --from=foundry /usr/local/bin/anvil /bin/anvil COPY --from=foundry /usr/local/bin/forge /bin/forge +RUN apt-get update && apt-get -y install git python3 build-essential curl netcat vim jq + # Run as user, otherwise, npx explodes. USER 1000 - RUN mkdir -p /home/node/app RUN mkdir -p /home/node/.npm diff --git a/near/Docker.md b/near/Docker.md index 226012f812..2b78067daf 100644 --- a/near/Docker.md +++ b/near/Docker.md @@ -1,12 +1,27 @@ -# first build the image +# build the image and tag it appropriately - -DOCKER_BUILDKIT=1 docker build -f Dockerfile.base -t near . + -# tag the image with the appropriate version +```bash +docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile.base -t ghcr.io/wormhole-foundation/near:2.4.0 . +``` -docker tag near:latest ghcr.io/wormhole-foundation/near:0.2 + # push to ghcr -docker push ghcr.io/wormhole-foundation/near:0.2 +```bash +docker push ghcr.io/wormhole-foundation/near:2.4.0 +``` + +# note: if unable to build amd64 + +M-series Macs may encounter an `illegal instruction` error when building the amd64 version of this image. Perform the arm64 build from a Mac and the amd64 build from another machine with native support. Then use a command like the following to create the multi-platform index from those manifests. + + + +```bash +docker buildx imagetools create -t ghcr.io/wormhole-foundation/near:2.4.0 ghcr.io/wormhole-foundation/near:2.4.0@sha256: ghcr.io/wormhole-foundation/near:2.4.0@sha256: +``` + + diff --git a/near/Dockerfile b/near/Dockerfile deleted file mode 100644 index 84b42f0ee1..0000000000 --- a/near/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM ghcr.io/wormhole-foundation/near:0.2@sha256:c2089c5e93df2396d74f9c07e7cd3d76983fad97bddb202030ca442c2c00c3c2 AS near-node diff --git a/near/Dockerfile.base b/near/Dockerfile.base index 28343e97ae..3d8f13b639 100644 --- a/near/Dockerfile.base +++ b/near/Dockerfile.base @@ -1,20 +1,26 @@ -FROM rust:1.60@sha256:48d3b5baf199dc7c378e775c47b0c40aaf7d8b23eaf67e15b095bbdaaecd1f10 AS near-node +FROM rust:1.82@sha256:d9c3c6f1264a547d84560e06ffd79ed7a799ce0bff0980b26cf10d29af888377 AS near-build -WORKDIR /tmp +WORKDIR /tmp/nearcore -RUN rustup update -RUN apt-get update && apt-get install apt-utils && apt-get install -y python3 npm curl make --no-install-recommends -RUN apt-get install -y build-essential git +# https://near-nodes.io/rpc/run-rpc-node-without-nearup#prerequisites +RUN apt-get update && apt-get install -y git binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake gcc g++ python3 protobuf-compiler libssl-dev pkg-config clang llvm cargo -RUN npm i -g n -RUN n stable +RUN git init +RUN git remote add origin https://github.com/near/nearcore +# https://github.com/near/nearcore/releases/tag/2.4.0 +RUN git fetch --depth 1 origin dc7b83c03529c6e9b432c649414aa9c79580df30 +RUN git checkout FETCH_HEAD +RUN make sandbox-release -COPY node_builder.sh /tmp +FROM rust:1.82@sha256:d9c3c6f1264a547d84560e06ffd79ed7a799ce0bff0980b26cf10d29af888377 AS near-node -RUN ./node_builder.sh +RUN apt-get update && apt-get install -y jq python3 +WORKDIR /tmp COPY start_node.sh /tmp RUN rm -rf /tmp/_sandbox RUN mkdir -p /tmp/sandbox + +COPY --from=near-build /tmp/nearcore/target/release/near-sandbox /tmp/nearcore/target/release/near-sandbox RUN nearcore/target/release/near-sandbox --home /tmp/_sandbox init diff --git a/near/Dockerfile.build b/near/Dockerfile.build index 93566523e6..c9f5ea5435 100644 --- a/near/Dockerfile.build +++ b/near/Dockerfile.build @@ -1,4 +1,4 @@ -FROM ghcr.io/wormhole-foundation/near:0.2@sha256:c2089c5e93df2396d74f9c07e7cd3d76983fad97bddb202030ca442c2c00c3c2 AS near-contracts-build +FROM rust:1.60@sha256:48d3b5baf199dc7c378e775c47b0c40aaf7d8b23eaf67e15b095bbdaaecd1f10 AS near-contracts-build ADD . . RUN make clean diff --git a/near/Dockerfile.contracts b/near/Dockerfile.contracts deleted file mode 100644 index 2c87e42457..0000000000 --- a/near/Dockerfile.contracts +++ /dev/null @@ -1,19 +0,0 @@ -FROM const-gen AS const-export -FROM ghcr.io/wormhole-foundation/near:0.2@sha256:c2089c5e93df2396d74f9c07e7cd3d76983fad97bddb202030ca442c2c00c3c2 AS near-contracts - -RUN mkdir -p /.npm /home/node/appa /home/node/.npm -WORKDIR /home/node/app -RUN chown -R 1000:1000 /home/node -RUN chown -R 1000:1000 /.npm - -USER 1000 - -ADD --chown=1000:1000 package.json . -ADD --chown=1000:1000 package-lock.json . -COPY --from=const-export --chown=1000:1000 .env . - -RUN npm ci - -ADD --chown=1000:1000 devnet_deploy.* . -ADD --chown=1000:1000 ./contracts/*/target/wasm32-unknown-unknown/release/*.wasm . - diff --git a/near/Dockerfile.deploy b/near/Dockerfile.deploy index 2aa9e84c5d..6ae2f61098 100644 --- a/near/Dockerfile.deploy +++ b/near/Dockerfile.deploy @@ -1,5 +1,5 @@ FROM const-gen AS const-export -FROM ghcr.io/wormhole-foundation/near:0.2@sha256:c2089c5e93df2396d74f9c07e7cd3d76983fad97bddb202030ca442c2c00c3c2 AS build +FROM rust:1.60@sha256:48d3b5baf199dc7c378e775c47b0c40aaf7d8b23eaf67e15b095bbdaaecd1f10 AS build WORKDIR /app @@ -7,17 +7,14 @@ COPY . . RUN ./build-contracts.sh -FROM node:16-alpine@sha256:004dbac84fed48e20f9888a23e32fa7cf83c2995e174a78d41d9a9dd1e051a20 AS deploy +FROM node:16-alpine@sha256:a1f9d027912b58a7c75be7716c97cfbc6d3099f3a97ed84aa490be9dee20e787 AS deploy WORKDIR /app COPY package.json . COPY package-lock.json . COPY --from=const-export .env . -COPY devnet_deploy.sh . COPY devnet_deploy.ts . COPY --from=build /app/contracts/*/target/wasm32-unknown-unknown/release/*.wasm . # mount the buildkit cache on npm's cache dir, install dependencies RUN --mount=type=cache,target=/root/.npm npm ci --production - - diff --git a/near/devnet_deploy.sh b/near/devnet_deploy.sh deleted file mode 100755 index 06e0f6f350..0000000000 --- a/near/devnet_deploy.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -f - -npx ts-node devnet_deploy.ts diff --git a/near/devnet_deploy.ts b/near/devnet_deploy.ts index b0d91b3893..00b909228d 100644 --- a/near/devnet_deploy.ts +++ b/near/devnet_deploy.ts @@ -42,6 +42,27 @@ async function initNear() { let masterKey: any; if (e === "sandbox") { + // wait for rpc to come up + let success = false; + while (!success) { + try { + const response = await fetch("http://localhost:3030", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: '{"jsonrpc": "2.0","id": "dontcare","method": "block","params": {"finality": "final"}}', + }); + if (response.ok) { + success = true; + } else { + await new Promise((f) => setTimeout(f, 1000)); + } + } catch (e) { + await new Promise((f) => setTimeout(f, 1000)); + } + } + // Retrieve the validator key directly in the Tilt environment const response = await fetch("http://localhost:3031/validator_key.json"); diff --git a/relayer/generic_relayer/relayer-engine-v2/Dockerfile b/relayer/generic_relayer/relayer-engine-v2/Dockerfile index 8a83ee9eaf..1cf3f669c7 100644 --- a/relayer/generic_relayer/relayer-engine-v2/Dockerfile +++ b/relayer/generic_relayer/relayer-engine-v2/Dockerfile @@ -1,11 +1,11 @@ # syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2 -FROM node:19.6.1-slim@sha256:a1ba21bf0c92931d02a8416f0a54daad66cb36a85d2b73af9d73b044f5f57cfc +FROM node:19.6.1-slim@sha256:e684615bdfb71cb676b3d0dfcc538c416f7254697d8f9639bd87255062fd1681 # npm wants to clone random Git repositories - lovely. # RUN apk add git python make build-base # RUN apk update && apk add bash RUN apt-get update && apt-get -y install \ - git python make curl netcat + git python3 make curl netcat g++ RUN npm i typescript -g @@ -19,14 +19,14 @@ WORKDIR /home/node/app # Fix git ssh error RUN git config --global url."https://".insteadOf ssh:// -COPY --chown=node:node ./relayer/ethereum/ts-scripts/relayer/config/ ./ethereum/ts-scripts/relayer/config/ +COPY --chown=node:node ./ethereum/ts-scripts/relayer/config/ ./ethereum/ts-scripts/relayer/config/ #Path matters so as to not break imports WORKDIR /home/node/app/relayer/generic_relayer/relayer-engine-v2/ # Only invalidate the npm install step if package.json changed -COPY --chown=node:node /relayer/generic_relayer/relayer-engine-v2/package.json . -COPY --chown=node:node /relayer/generic_relayer/relayer-engine-v2/package-lock.json . +COPY --chown=node:node /generic_relayer/relayer-engine-v2/package.json . +COPY --chown=node:node /generic_relayer/relayer-engine-v2/package-lock.json . # We want to cache node_modules *and* incorporate it into the final image. RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \ @@ -42,7 +42,7 @@ RUN rm -rf node_modules && mv node_modules_cache node_modules ARG dev ENV DEV=$dev -COPY --chown=node:node /relayer/generic_relayer/relayer-engine-v2/ . +COPY --chown=node:node /generic_relayer/relayer-engine-v2/ . diff --git a/sui/Dockerfile b/sui/Dockerfile index b584fa320e..1ed6914b8c 100644 --- a/sui/Dockerfile +++ b/sui/Dockerfile @@ -7,15 +7,15 @@ FROM ghcr.io/wormhole-foundation/sui:1.19.1-mainnet@sha256:97e2e62d43262883b7a5b # RUN sui genesis -f --from-config genesis_config # subsequent runs after committing files from /root/.sui/sui_config/ -COPY sui/devnet/ /root/.sui/sui_config/ +COPY devnet/ /root/.sui/sui_config/ WORKDIR /tmp -COPY sui/scripts/ scripts -COPY sui/wormhole/ wormhole -COPY sui/token_bridge/ token_bridge -COPY sui/examples/ examples -COPY sui/Makefile Makefile +COPY scripts/ scripts +COPY wormhole/ wormhole +COPY token_bridge/ token_bridge +COPY examples/ examples +COPY Makefile Makefile # Copy .env and CLI COPY --from=const-export .env .env diff --git a/sui/Makefile b/sui/Makefile index 0ee0e5eb94..fe550ab55d 100644 --- a/sui/Makefile +++ b/sui/Makefile @@ -10,6 +10,6 @@ test: $(foreach dir,$(TEST_CONTRACT_DIRS), make -C $(dir) $@ &&) true test-docker: - DOCKER_BUILDKIT=1 docker build --progress plain -f ../Dockerfile.cli -t cli-gen .. + DOCKER_BUILDKIT=1 docker build --progress plain -f ../clients/js/Dockerfile -t cli-gen ../clients/js DOCKER_BUILDKIT=1 docker build --build-arg num_guardians=1 --progress plain -f ../Dockerfile.const -t const-gen .. - DOCKER_BUILDKIT=1 docker build -f Dockerfile .. + DOCKER_BUILDKIT=1 docker build -f Dockerfile . diff --git a/terra/Dockerfile b/terra/Dockerfile index 6defdb4c05..3c01dae468 100644 --- a/terra/Dockerfile +++ b/terra/Dockerfile @@ -13,7 +13,7 @@ FROM scratch as artifacts COPY --from=builder /code/artifacts / # Contract deployment stage -FROM node:16-buster-slim@sha256:93c9fc3550f5f7d159f282027228e90e3a7f8bf38544758024f005e82607f546 +FROM node:16-buster-slim@sha256:3ebf2875c188d22939c6ab080cfb1a4a6248cc86bae600ea8e2326aa03acdb8f RUN apt update && apt install netcat curl jq -y diff --git a/testing/Dockerfile.querysdk.test b/testing/Dockerfile.querysdk.test index bafea606ec..31bb18e6f3 100644 --- a/testing/Dockerfile.querysdk.test +++ b/testing/Dockerfile.querysdk.test @@ -1,7 +1,7 @@ -FROM node:19.6.1-slim@sha256:a1ba21bf0c92931d02a8416f0a54daad66cb36a85d2b73af9d73b044f5f57cfc +FROM node:19.6.1-slim@sha256:e684615bdfb71cb676b3d0dfcc538c416f7254697d8f9639bd87255062fd1681 RUN apt-get update && apt-get -y install \ - git python3 make curl netcat + git python3 make curl netcat g++ RUN mkdir -p /app WORKDIR /app diff --git a/testing/Dockerfile.sdk.test b/testing/Dockerfile.sdk.test index 627406d91c..22baa32b88 100644 --- a/testing/Dockerfile.sdk.test +++ b/testing/Dockerfile.sdk.test @@ -1,12 +1,10 @@ -FROM --platform=linux/amd64 ghcr.io/foundry-rs/foundry:nightly-ea2eff95b5c17edd3ffbdfc6daab5ce5cc80afc0@sha256:2a774f86765258a0d176366fc46f92bc14f5040faae7a3c3ba59b1c24c5fa7cb as foundry -FROM node:19.6.1-slim@sha256:a1ba21bf0c92931d02a8416f0a54daad66cb36a85d2b73af9d73b044f5f57cfc +FROM ghcr.io/wormholelabs-xyz/foundry:nightly-55bf41564f605cae3ca4c95ac5d468b1f14447f9@sha256:50ffe8f3ba79274eaab85ce65e769e3d66b1c680f5a9acb9c25a393c4daeeeeb as foundry +FROM node:19.6.1-slim@sha256:e684615bdfb71cb676b3d0dfcc538c416f7254697d8f9639bd87255062fd1681 -RUN apt-get update && apt-get -y install \ - git python3 make curl netcat vim - -RUN npm i typescript -g COPY --from=foundry /usr/local/bin/forge /bin/forge +RUN apt-get update && apt-get -y install git python3 build-essential curl netcat vim + RUN mkdir -p /app WORKDIR /app diff --git a/testing/Dockerfile.spydk.test b/testing/Dockerfile.spydk.test index e099cdc73a..c61fb5615d 100644 --- a/testing/Dockerfile.spydk.test +++ b/testing/Dockerfile.spydk.test @@ -1,7 +1,7 @@ -FROM node:19.6.1-slim@sha256:a1ba21bf0c92931d02a8416f0a54daad66cb36a85d2b73af9d73b044f5f57cfc +FROM node:19.6.1-slim@sha256:e684615bdfb71cb676b3d0dfcc538c416f7254697d8f9639bd87255062fd1681 RUN apt-get update && apt-get -y install \ - git python3 make curl netcat + git python3 make curl netcat g++ RUN mkdir -p /app WORKDIR /app diff --git a/third_party/redis/Dockerfile b/third_party/redis/Dockerfile index 2b91e3ad18..2d17ff75dc 100644 --- a/third_party/redis/Dockerfile +++ b/third_party/redis/Dockerfile @@ -95,9 +95,8 @@ RUN mkdir /data && chown redis:redis /data VOLUME /data WORKDIR /data -COPY . . -RUN chmod 777 /data/third_party/redis/docker-entrypoint.sh -RUN cp /data/third_party/redis/docker-entrypoint.sh /usr/local/bin/ +COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +RUN chmod 777 /usr/local/bin/docker-entrypoint.sh ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/wormchain/Dockerfile.deploy b/wormchain/Dockerfile.deploy index 2606ed3818..ae1b9b75d1 100644 --- a/wormchain/Dockerfile.deploy +++ b/wormchain/Dockerfile.deploy @@ -7,9 +7,9 @@ FROM const-gen AS const-export FROM cosmwasm_artifacts AS artifacts # Contract deployment stage -FROM node:20.13.1-buster-slim@sha256:8916ca78cc94933fdaef715531141c8a658bea61b89d7d88a1b2dcc0a1ae92f6 +FROM node:20.13.1-buster-slim@sha256:7ab273816c6bc500ddba1400d825708a5a5ed963cdc17c32d3fce70ac9a0f477 -RUN apt update && apt install netcat curl jq -y +RUN apt update && apt install -y python3 make g++ netcat curl jq WORKDIR /app/tools diff --git a/wormchain/ibc-relayer/Dockerfile b/wormchain/ibc-relayer/Dockerfile index 2791d7b669..89d1975816 100644 --- a/wormchain/ibc-relayer/Dockerfile +++ b/wormchain/ibc-relayer/Dockerfile @@ -13,7 +13,7 @@ RUN tar xzf c30b8d9e0ba6b45f8a576f768cad0777de545cb3.tar.gz WORKDIR relayer-c30b8d9e0ba6b45f8a576f768cad0777de545cb3 RUN make install -COPY ./wormchain/ibc-relayer/chains /chains +COPY chains /chains RUN rly config init RUN rly chains add-dir /chains @@ -21,4 +21,4 @@ RUN rly keys restore localterra default "notice oak worry limit wrap speak medal RUN rly keys restore wormchain default "notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius" RUN rly paths new localterra wormchain terra-wormchain -EXPOSE 7597 \ No newline at end of file +EXPOSE 7597