forked from hyperledger/iroha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (27 loc) · 944 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# builder image
ARG TAG=dev
FROM hyperledger/iroha2-base:$TAG AS builder
WORKDIR /iroha
COPY . .
RUN rm -f rust-toolchain.toml
RUN mold --run cargo build --profile deploy --target x86_64-unknown-linux-musl --features vendored
# final image
FROM alpine:3.16
ARG STORAGE=/storage
ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-musl/deploy
ENV BIN_PATH=/usr/local/bin/
ENV CONFIG_DIR=/config
ENV IROHA2_CONFIG_PATH=$CONFIG_DIR/config.json
ENV IROHA2_GENESIS_PATH=$CONFIG_DIR/genesis.json
ENV KURA_BLOCK_STORE_PATH=$STORAGE
RUN set -ex && \
apk --update add curl ca-certificates && \
adduser --disabled-password iroha --shell /bin/bash --home /app && \
mkdir -p $CONFIG_DIR && \
mkdir $STORAGE && \
chown iroha:iroha $STORAGE
COPY --from=builder $TARGET_DIR/iroha $BIN_PATH
COPY --from=builder $TARGET_DIR/iroha_client_cli $BIN_PATH
COPY --from=builder $TARGET_DIR/kagami $BIN_PATH
USER iroha
CMD iroha