From 0f455056e9a51434caf4a08ecf07aff39ca60d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Grze=C5=9Bkiewicz?= Date: Mon, 12 Aug 2024 20:30:27 +0200 Subject: [PATCH] feat(en): added Dockerfile to build EN from scratch (#2640) Signed-off-by: tomg10 --- .../building-from-scratch/Dockerfile | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 docs/guides/external-node/building-from-scratch/Dockerfile diff --git a/docs/guides/external-node/building-from-scratch/Dockerfile b/docs/guides/external-node/building-from-scratch/Dockerfile new file mode 100644 index 000000000000..e0aa07cfa7c7 --- /dev/null +++ b/docs/guides/external-node/building-from-scratch/Dockerfile @@ -0,0 +1,31 @@ +FROM matterlabs/zk-environment:latest2.0-lightweight + +RUN git clone https://github.com/matter-labs/zksync-era + +WORKDIR /usr/src/zksync/zksync-era + +# core 24.16.0 (#2608), see: https://github.com/matter-labs/zksync-era/releases +RUN git reset --hard 1ac52c5 + +ENV ZKSYNC_HOME=/usr/src/zksync/zksync-era +ENV PATH="${ZKSYNC_HOME}/bin:${PATH}" + +# build zk tool +RUN zk +RUN yarn zk build + +# build rust +RUN cargo build --release +RUN cp target/release/zksync_external_node /usr/bin + +# build contracts +RUN git submodule update --init --recursive +RUN zk run yarn +RUN zk compiler all +RUN zk contract build +RUN zk f yarn run l2-contracts build + +# copy migrations (node expects them to be in specific directory) +RUN cp -r core/lib/dal/migrations/ migrations + +ENTRYPOINT [ "sh", "docker/external-node/entrypoint.sh"]