Skip to content

Commit

Permalink
fix: make Dockerfile build
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <[email protected]>
  • Loading branch information
mversic committed Dec 13, 2024
1 parent 8035043 commit 45c8c3c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
# base stage
FROM debian:bookworm-slim AS builder
# builder stage
FROM rust:slim-bookworm AS builder

WORKDIR /app

# install required packages
RUN apt-get update -y && \
apt-get install -y curl build-essential mold pkg-config libssl-dev
apt-get install -y curl build-essential mold

# set up Rust toolchain
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup toolchain install nightly-2024-09-09
RUN rustup default nightly-2024-09-09
RUN rustup target add wasm32-unknown-unknown
RUN rustup component add rust-src
RUN rustup default nightly-2024-09-09

# builder stage
WORKDIR /iroha
COPY . .
ARG PROFILE="deploy"
ARG RUSTFLAGS=""
ARG FEATURES=""
ARG CARGOFLAGS=""
RUN RUSTFLAGS="${RUSTFLAGS}" mold --run cargo ${CARGOFLAGS} build --target x86_64-unknown-linux-gnu --profile "${PROFILE}" --features "${FEATURES}"
RUN RUSTFLAGS="${RUSTFLAGS}" mold --run cargo ${CARGOFLAGS} build --profile "${PROFILE}" --features "${FEATURES}"

# final image
FROM debian:bookworm-slim

ARG PROFILE="deploy"
ARG STORAGE=/storage
ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-gnu/${PROFILE}
ARG TARGET_DIR=/app/target/${PROFILE}
ENV BIN_PATH=/usr/local/bin/
ENV CONFIG_DIR=/config
ENV KURA_STORE_DIR=$STORAGE
Expand Down

0 comments on commit 45c8c3c

Please sign in to comment.