Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Docker.offchain #27

Merged
merged 3 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/on_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions Dockerfile.offchain
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ 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/default.toml /var/light-client.toml
COPY --from=build /near/near-light-client /usr/local/bin
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-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"]
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Loading