Skip to content

Commit

Permalink
Merge pull request #22 from near/daniyar/optimized-docker-build
Browse files Browse the repository at this point in the history
feat: optimize dockerfile
  • Loading branch information
volovyks authored Apr 4, 2023
2 parents e358dd9 + c0bc361 commit e0fb307
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM rust:latest
WORKDIR /usr/src/app
RUN echo "fn main() {}" > dummy.rs
COPY mpc-recovery/Cargo.toml Cargo.toml
RUN sed -i 's#src/main.rs#dummy.rs#' Cargo.toml
RUN cargo build --release
COPY . .
RUN cargo install --path mpc-recovery/
RUN mv /usr/local/cargo/bin/mpc-recovery /usr/local/bin/mpc-recovery
Expand Down
4 changes: 4 additions & 0 deletions mpc-recovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name = "mpc-recovery"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "mpc-recovery"
path = "src/main.rs"

# We have encountered issue with linking GMP on ARM macos machines. This is a temporary fix that
# replaces GMP implementation with num-bigint.
# [target.'cfg(macos)'.dependencies]
Expand Down

0 comments on commit e0fb307

Please sign in to comment.