From 859aa0cac5f9cf1e7b5cff13e4a2666d1a9763ab Mon Sep 17 00:00:00 2001 From: ImJeremyHe Date: Fri, 12 Jul 2024 15:21:36 +0800 Subject: [PATCH] Add anvil and postgres to dev-node image --- docker/espresso-dev-node.Dockerfile | 8 +++++++- scripts/build-docker-images | 7 ++----- scripts/build-docker-images-native | 8 ++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docker/espresso-dev-node.Dockerfile b/docker/espresso-dev-node.Dockerfile index 7b59828572..5da893bac4 100644 --- a/docker/espresso-dev-node.Dockerfile +++ b/docker/espresso-dev-node.Dockerfile @@ -14,6 +14,12 @@ RUN curl -LO https://github.com/EspressoSystems/ark-srs/releases/download/v0.2.0 COPY target/$TARGETARCH/release/espresso-dev-node /bin/espresso-dev-node RUN chmod +x /bin/espresso-dev-node +# Download the anvil binary +RUN curl -L https://github.com/foundry-rs/foundry/releases/download/nightly/foundry_nightly_linux_${TARGETARCH}.tar.gz --output -| tar -xzvf - -C /bin/ anvil + +COPY scripts/launch-dev-node-with-postgres /bin/launch-dev-node-with-postgres +RUN chmod +x /bin/launch-dev-node-with-postgres + # When running as a Docker service, we always want a healthcheck endpoint, so set a default for the # port that the HTTP server will run on. This can be overridden in any given deployment environment. ENV ESPRESSO_SEQUENCER_API_PORT=8770 @@ -23,4 +29,4 @@ EXPOSE 8770 EXPOSE 8771 EXPOSE 8772 -CMD [ "/bin/espresso-dev-node"] +CMD [ "/bin/launch-dev-node-with-postgres"] diff --git a/scripts/build-docker-images b/scripts/build-docker-images index 2b31d20d46..60e3b4a6bc 100755 --- a/scripts/build-docker-images +++ b/scripts/build-docker-images @@ -38,14 +38,11 @@ for ARCH in "amd64" "arm64"; do for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client" "pub-key" "espresso-bridge" "espresso-dev-node"; do cp -v "${CARGO_TARGET_DIR}/${TARGET}/release/$binary" ${WORKDIR}/target/$ARCH/release done - - # Download the latest foundry binary and extract anvil for the dev-node docker image. - curl -L https://github.com/foundry-rs/foundry/releases/download/nightly/foundry_nightly_linux_${ARCH}.tar.gz -o ${WORKDIR}/foundry.tar.gz - tar -xzvf ${WORKDIR}/foundry.tar.gz -C ${WORKDIR}/target/$ARCH/release anvil done # Copy the dev-node launch script -cp -v scripts/launch-dev-node-with-postgres ${WORKDIR} +mkdir -p ${WORKDIR}/scripts +cp -v scripts/launch-dev-node-with-postgres ${WORKDIR}/scripts export DOCKER_BUILDKIT=1 docker build -t ghcr.io/espressosystems/espresso-sequencer/orchestrator:main -f docker/orchestrator.Dockerfile ${WORKDIR} diff --git a/scripts/build-docker-images-native b/scripts/build-docker-images-native index 10f659681d..4ed30ce6a3 100755 --- a/scripts/build-docker-images-native +++ b/scripts/build-docker-images-native @@ -96,12 +96,8 @@ for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequenc done # Copy the dev-node launch script -cp -v scripts/launch-dev-node-with-postgres ${WORKDIR} - -# Download the latest foundry binary and extract anvil for the dev-node docker image. -curl -L https://github.com/foundry-rs/foundry/releases/download/nightly/foundry_nightly_linux_${ARCH}.tar.gz -o ${WORKDIR}/foundry.tar.gz -tar -xzvf ${WORKDIR}/foundry.tar.gz -C ${WORKDIR}/target/$ARCH/release anvil - +mkdir -p ${WORKDIR}/scripts +cp -v scripts/launch-dev-node-with-postgres ${WORKDIR}/scripts export DOCKER_BUILDKIT=1 docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/orchestrator:main -f docker/orchestrator.Dockerfile ${WORKDIR}