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

build(rs-drive-abci): update Dockerfile to Alpine and build correctly on ARM64 #859

Merged
merged 4 commits into from
Apr 1, 2023
Merged
Changes from 1 commit
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
14 changes: 11 additions & 3 deletions packages/rs-drive-abci/Dockerfile
lklimek marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,24 @@ ARG ACTIONS_RUNTIME_TOKEN
ARG CARGO_INCREMENTAL=false
lklimek marked this conversation as resolved.
Show resolved Hide resolved

# Run the build, with extensive caching.
#
# Note:
# 1. All these --mount... are to cache reusable info between runs.
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
# --mount=type=cache,sharing=private,target=/usr/src/platform/target \
# 2. We add `--config net.git-fetch-with-cli=true` to address ARM build issue,
# see https://github.com/rust-lang/cargo/issues/10781#issuecomment-1441071052
# 3. To preserve space on github cache, we call `cargo clean`.
RUN --mount=type=cache,sharing=shared,target=/root/.cache/sccache \
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/.crates.toml \
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/.crates2.json \
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/cache \
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/git/db \
cargo build -p drive-abci \
&& cp /usr/src/platform/target/${CARGO_BUILD_PROFILE}/drive-abci /usr/src/platform/drive-abci
cargo build \
--package drive-abci \
--config net.git-fetch-with-cli=true && \
cp /usr/src/platform/target/${CARGO_BUILD_PROFILE}/drive-abci /usr/src/platform/drive-abci && \
cargo clean

#
# FINAL IMAGE
Expand Down