-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,6 +145,19 @@ ENV CARGO_INCREMENTAL=${CARGO_INCREMENTAL} | |
ARG AWS_ACCESS_KEY_ID | ||
ARG AWS_SECRET_ACCESS_KEY | ||
# | ||
# BUILD ROCKSDB STATIC LIBRARY | ||
# | ||
FROM deps-${RUSTC_WRAPPER:-base} AS rocksdb | ||
RUN mkdir -p /tmp/rocksdb | ||
WORKDIR /tmp/rocksdb | ||
RUN git clone https://github.com/facebook/rocksdb.git -b v8.10.2 --depth 1 . && \ | ||
make static_lib && \ | ||
make DESTDIR=/opt/rocksdb install-static && \ | ||
cd / && \ | ||
rm -rf /tmp/rocksdb | ||
# | ||
# DEPS: FULL DEPENDENCIES LIST | ||
# | ||
|
@@ -154,6 +167,14 @@ FROM deps-${RUSTC_WRAPPER:-base} AS deps | |
ARG SCCACHE_S3_KEY_PREFIX | ||
ENV SCCACHE_S3_KEY_PREFIX=${SCCACHE_S3_KEY_PREFIX}/${TARGETARCH}/linux-musl | ||
# Install prebuilt rocksdb library | ||
COPY --from=rocksdb /opt/rocksdb /opt/rocksdb | ||
# Set env variables so that Rust's rocksdb-sys will not build rocksdb from scratch | ||
|
||
ENV ROCKSDB_STATIC=/opt/rocksdb/usr/local/lib/librocksdb.a | ||
ENV ROCKSDB_LIB_DIR=/opt/rocksdb/usr/local/lib | ||
|
||
WORKDIR /platform | ||
|
||
# Install wasm-bindgen-cli in the same profile as other components, to sacrifice some performance & disk space to gain | ||
|
@@ -171,12 +192,17 @@ RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOM | |
# Meanwhile if you want to update wasm-bindgen you also need to update version in: | ||
# - packages/wasm-dpp/Cargo.toml | ||
# - packages/wasm-dpp/scripts/build-wasm.sh | ||
cargo install --profile "$CARGO_BUILD_PROFILE" [email protected] [email protected] --locked | ||
cargo install --profile "$CARGO_BUILD_PROFILE" [email protected] [email protected] --locked | ||
|
||
|
||
# | ||
# Rust build planner to speed up builds | ||
# | ||
FROM deps AS build-planner | ||
|
||
ENV ROCKSDB_STATIC=/opt/rocksdb/usr/local/lib/librocksdb.a | ||
ENV ROCKSDB_LIB_DIR=/opt/rocksdb/usr/local/lib | ||
|
||
WORKDIR /platform | ||
COPY . . | ||
RUN source $HOME/.cargo/env && \ | ||
|
@@ -196,6 +222,9 @@ SHELL ["/bin/bash", "-o", "pipefail","-e", "-x", "-c"] | |
ARG SCCACHE_S3_KEY_PREFIX | ||
ENV SCCACHE_S3_KEY_PREFIX=${SCCACHE_S3_KEY_PREFIX}/${TARGETARCH}/linux-musl | ||
|
||
ENV ROCKSDB_STATIC=/opt/rocksdb/usr/local/lib/librocksdb.a | ||
ENV ROCKSDB_LIB_DIR=/opt/rocksdb/usr/local/lib | ||
|
||
WORKDIR /platform | ||
|
||
COPY --from=build-planner /platform/recipe.json recipe.json | ||
|
@@ -251,6 +280,9 @@ FROM deps AS build-js | |
ARG SCCACHE_S3_KEY_PREFIX | ||
ENV SCCACHE_S3_KEY_PREFIX=${SCCACHE_S3_KEY_PREFIX}/wasm/wasm32 | ||
|
||
ENV ROCKSDB_STATIC=/opt/rocksdb/usr/local/lib/librocksdb.a | ||
ENV ROCKSDB_LIB_DIR=/opt/rocksdb/usr/local/lib | ||
|
||
WORKDIR /platform | ||
|
||
COPY --from=build-planner /platform/recipe.json recipe.json | ||
|