|
1 |
| -# base stage |
2 |
| -FROM debian:bookworm-slim AS builder |
| 1 | +# builder stage |
| 2 | +FROM rust:slim-bookworm AS builder |
| 3 | + |
| 4 | +WORKDIR /app |
3 | 5 |
|
4 | 6 | # install required packages
|
5 | 7 | 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 |
7 | 9 |
|
8 |
| -# set up Rust toolchain |
9 |
| -RUN curl https://sh.rustup.rs -sSf | bash -s -- -y |
10 |
| -ENV PATH="/root/.cargo/bin:${PATH}" |
11 | 10 | RUN rustup toolchain install nightly-2024-09-09
|
12 |
| -RUN rustup default nightly-2024-09-09 |
13 | 11 | RUN rustup target add wasm32-unknown-unknown
|
14 |
| -RUN rustup component add rust-src |
| 12 | +RUN rustup default nightly-2024-09-09 |
15 | 13 |
|
16 |
| -# builder stage |
17 |
| -WORKDIR /iroha |
18 | 14 | COPY . .
|
19 | 15 | ARG PROFILE="deploy"
|
20 | 16 | ARG RUSTFLAGS=""
|
21 | 17 | ARG FEATURES=""
|
22 | 18 | 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}" |
24 | 20 |
|
25 | 21 | # final image
|
26 | 22 | FROM debian:bookworm-slim
|
27 | 23 |
|
28 | 24 | ARG PROFILE="deploy"
|
29 | 25 | ARG STORAGE=/storage
|
30 |
| -ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-gnu/${PROFILE} |
| 26 | +ARG TARGET_DIR=/app/target/${PROFILE} |
31 | 27 | ENV BIN_PATH=/usr/local/bin/
|
32 | 28 | ENV CONFIG_DIR=/config
|
33 | 29 | ENV KURA_STORE_DIR=$STORAGE
|
@@ -63,7 +59,6 @@ COPY --from=builder $TARGET_DIR/iroha $BIN_PATH
|
63 | 59 | COPY --from=builder $TARGET_DIR/kagami $BIN_PATH
|
64 | 60 | COPY defaults/genesis.json $CONFIG_DIR
|
65 | 61 | COPY defaults/executor.wasm $CONFIG_DIR
|
66 |
| -COPY defaults/libs $CONFIG_DIR/libs/ |
67 | 62 | COPY defaults/client.toml $CONFIG_DIR
|
68 | 63 | USER $USER
|
69 | 64 | CMD ["irohad"]
|
0 commit comments