Skip to content

Commit

Permalink
Fix local docker builds (#793)
Browse files Browse the repository at this point in the history
1. We need to un-ignore the `.git` directory when copying files
into the build container, so `vergen` can read git information.

2. Previously we copied everything into `/`. It appears `vergen`
or `git2` doesn't like Git repositories named `/`, so instead we
copy and build everything into `/zilliqa`.
  • Loading branch information
JamesHinshelwood authored Mar 25, 2024
1 parent ae32d2c commit b8e6cf5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.cache
.git
**/target/

docker-compose.yaml
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ RUN apt update -y && \

RUN apt autoremove

WORKDIR /zilliqa

RUN mkdir build

COPY . .

RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/target \
cargo build --bin zilliqa && \
mv /target/debug/zilliqa /build/
mv ./target/debug/zilliqa ./build/


FROM gcr.io/distroless/cc-debian11

COPY --from=builder /build/zilliqa /zilliqa
COPY --from=builder /zilliqa/build/zilliqa /zilliqa

0 comments on commit b8e6cf5

Please sign in to comment.