From 7ef04af4e0c9206a77f4785e7ae1e09772daef2d Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Fri, 12 Jul 2024 14:33:16 +0300 Subject: [PATCH 1/3] redundant / removed, docker commands separated --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 542355b..01f8b59 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,13 @@ .EXPORT_ALL_VARIABLES: -include .env -TAG_PREFIX?=us-docker.pkg.dev/pagoda-solutions-dev/rollup-data-availability/ +TAG_PREFIX?=us-docker.pkg.dev/pagoda-solutions-dev/rollup-data-availability IMAGE_TAG?=dev -docker: +docker-offchain: DOCKER_BUILDKIT=1 docker build --progress=plain -t $(TAG_PREFIX)/light-client:$(IMAGE_TAG) -f Dockerfile.offchain . + +docker-operator: docker build -t $(TAG_PREFIX)/nearx-operator:$(IMAGE_TAG) -f Dockerfile.operator . test: From 78f2cc3d6dc764bc7862829901f49c8f0f4dafc2 Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Mon, 15 Jul 2024 20:25:31 +0300 Subject: [PATCH 2/3] fix file and build artifact names --- .github/workflows/on_main.yml | 2 +- Dockerfile.offchain | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/on_main.yml b/.github/workflows/on_main.yml index a3701f9..0fd8b2f 100644 --- a/.github/workflows/on_main.yml +++ b/.github/workflows/on_main.yml @@ -29,7 +29,7 @@ jobs: with: context: . push: true - file: Dockerfile + file: Dockerfile.offchain tags: | ghcr.io/near/near-light-client/light-client:${{ github.sha }} ghcr.io/near/near-light-client/light-client:latest diff --git a/Dockerfile.offchain b/Dockerfile.offchain index a6ef493..7583fbe 100644 --- a/Dockerfile.offchain +++ b/Dockerfile.offchain @@ -15,19 +15,15 @@ RUN apt-get update && apt-get install -y \ pkg-config \ cbindgen -COPY Cargo.toml Cargo.lock ./ -RUN mkdir -p src/bin && echo "fn main() {}" > src/bin/dummy.rs -RUN cargo build --release --config net.git-fetch-with-cli=true --bin dummy - COPY ./ ./ RUN cargo build --release --config net.git-fetch-with-cli=true -RUN ldd target/release/near-offchain-lightclient -RUN cp target/release/near-offchain-lightclient /near/near-offchain-light-client +RUN ldd target/release/near-light-client +RUN cp target/release/near-light-client /near/near-light-client FROM debian:bookworm-slim RUN apt-get update && apt-get install -y openssl libssl-dev pkg-config ca-certificates && rm -rf /var/lib/apt/lists/* -COPY --from=build /near/near-offchain-light-client /usr/local/bin +COPY --from=build /near/near-light-client /usr/local/bin COPY --from=build /near/default.toml /var/light-client.toml -RUN ldd /usr/local/bin/near-offchain-light-client -ENTRYPOINT ["/usr/local/bin/near-offchain-light-client"] +RUN ldd /usr/local/bin/near-light-client +ENTRYPOINT ["/usr/local/bin/near-light-client"] From 63eab428447ceeb2efe70f97b5e8fc15af270f8a Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Mon, 15 Jul 2024 21:27:19 +0300 Subject: [PATCH 3/3] added env variables in Docker.offchain --- Dockerfile.offchain | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile.offchain b/Dockerfile.offchain index 7583fbe..58b8b1d 100644 --- a/Dockerfile.offchain +++ b/Dockerfile.offchain @@ -23,7 +23,11 @@ RUN cp target/release/near-light-client /near/near-light-client FROM debian:bookworm-slim RUN apt-get update && apt-get install -y openssl libssl-dev pkg-config ca-certificates && rm -rf /var/lib/apt/lists/* COPY --from=build /near/near-light-client /usr/local/bin -COPY --from=build /near/default.toml /var/light-client.toml +COPY --from=build /near/config.toml /var/near-light-client/config.toml + +ENV NEAR_LIGHT_CLIENT_DIR=/var/near-light-client +ENV NEAR_LIGHT_CLIENT_CONFIG_FILE=/var/near-light-client/config.toml +ENV NEAR_LIGHT_CLIENT_MODE=default RUN ldd /usr/local/bin/near-light-client ENTRYPOINT ["/usr/local/bin/near-light-client"]