Skip to content

Commit 13d953d

Browse files
authored
fix: make Dockerfile build (#5271)
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
1 parent 8035043 commit 13d953d

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

Dockerfile

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
1-
# base stage
2-
FROM debian:bookworm-slim AS builder
1+
# builder stage
2+
FROM rust:slim-bookworm AS builder
3+
4+
WORKDIR /app
35

46
# install required packages
57
RUN apt-get update -y && \
6-
apt-get install -y curl build-essential mold pkg-config libssl-dev
8+
apt-get install -y build-essential mold
79

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

16-
# builder stage
17-
WORKDIR /iroha
1814
COPY . .
1915
ARG PROFILE="deploy"
2016
ARG RUSTFLAGS=""
2117
ARG FEATURES=""
2218
ARG CARGOFLAGS=""
23-
RUN RUSTFLAGS="${RUSTFLAGS}" mold --run cargo ${CARGOFLAGS} build --target x86_64-unknown-linux-gnu --profile "${PROFILE}" --features "${FEATURES}"
19+
RUN RUSTFLAGS="${RUSTFLAGS}" mold --run cargo ${CARGOFLAGS} build --profile "${PROFILE}" --features "${FEATURES}"
2420

2521
# final image
2622
FROM debian:bookworm-slim
2723

2824
ARG PROFILE="deploy"
2925
ARG STORAGE=/storage
30-
ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-gnu/${PROFILE}
26+
ARG TARGET_DIR=/app/target/${PROFILE}
3127
ENV BIN_PATH=/usr/local/bin/
3228
ENV CONFIG_DIR=/config
3329
ENV KURA_STORE_DIR=$STORAGE
@@ -63,7 +59,6 @@ COPY --from=builder $TARGET_DIR/iroha $BIN_PATH
6359
COPY --from=builder $TARGET_DIR/kagami $BIN_PATH
6460
COPY defaults/genesis.json $CONFIG_DIR
6561
COPY defaults/executor.wasm $CONFIG_DIR
66-
COPY defaults/libs $CONFIG_DIR/libs/
6762
COPY defaults/client.toml $CONFIG_DIR
6863
USER $USER
6964
CMD ["irohad"]

Dockerfile.musl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ COPY --from=builder $TARGET_DIR/iroha $BIN_PATH
8282
COPY --from=builder $TARGET_DIR/kagami $BIN_PATH
8383
COPY defaults/genesis.json $CONFIG_DIR
8484
COPY defaults/executor.wasm $CONFIG_DIR
85-
COPY defaults/libs $CONFIG_DIR/libs/
8685
COPY defaults/client.toml $CONFIG_DIR
8786
USER $USER
8887
CMD ["irohad"]

0 commit comments

Comments
 (0)