<commit_before>FROM debian:stretch as builder

# To use http/https proxy while building, use:
# docker build --build-arg https_proxy=http://fwdproxy:8080 --build-arg http_proxy=http://fwdproxy:8080

RUN echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list && apt-get update && apt-get install -y protobuf-compiler/stretch-backports cmake golang curl && apt-get clean && rm -r /var/lib/apt/lists/*

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none
ENV PATH "$PATH:/root/.cargo/bin"

WORKDIR /libra
COPY rust-toolchain /libra/rust-toolchain
RUN rustup install $(cat rust-toolchain)

COPY . /libra
RUN cargo build --release -p libra_node

### Production Image ###
FROM debian:stretch

RUN mkdir -p /opt/libra/bin /opt/libra/etc
COPY terraform/validator-sets/dev/node.config.toml /opt/libra/etc
COPY docker/validator/install-tools.sh /root
COPY --from=builder /libra/target/release/libra_node /opt/libra/bin

# Admission control
EXPOSE 30307
# Validator network
EXPOSE 30303
# Metrics
EXPOSE 14297

# Define SEED_PEERS, SELF_IP, PEER_KEYPAIRS, GENESIS_BLOB and PEER_ID environment variables when running
CMD cd /opt/libra/etc && sed -i "s,SELF_IP,$SELF_IP," node.config.toml && echo "$SEED_PEERS" > seed_peers.config.toml && echo "$TRUSTED_PEERS" > trusted_peers.config.toml && echo "$PEER_KEYPAIRS" > peer_keypairs.config.toml && echo "$GENESIS_BLOB" | base64 -d > genesis.blob && exec /opt/libra/bin/libra_node -f node.config.toml --peer_id "$PEER_ID"

ARG BUILD_DATE<commit_msg>Set RUST_BACKTRACE=1 to enable stack trace capture on error and panic<commit_after>FROM debian:stretch as builder

# To use http/https proxy while building, use:
# docker build --build-arg https_proxy=http://fwdproxy:8080 --build-arg http_proxy=http://fwdproxy:8080

RUN echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list && apt-get update && apt-get install -y protobuf-compiler/stretch-backports cmake golang curl && apt-get clean && rm -r /var/lib/apt/lists/*

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none
ENV PATH "$PATH:/root/.cargo/bin"

WORKDIR /libra
COPY rust-toolchain /libra/rust-toolchain
RUN rustup install $(cat rust-toolchain)

COPY . /libra
RUN cargo build --release -p libra_node

### Production Image ###
FROM debian:stretch

RUN mkdir -p /opt/libra/bin /opt/libra/etc
COPY terraform/validator-sets/dev/node.config.toml /opt/libra/etc
COPY docker/validator/install-tools.sh /root
COPY --from=builder /libra/target/release/libra_node /opt/libra/bin

# Admission control
EXPOSE 30307
# Validator network
EXPOSE 30303
# Metrics
EXPOSE 14297

# Capture backtrace on error
ENV RUST_BACKTRACE 1

# Define SEED_PEERS, SELF_IP, PEER_KEYPAIRS, GENESIS_BLOB and PEER_ID environment variables when running
CMD cd /opt/libra/etc && sed -i "s,SELF_IP,$SELF_IP," node.config.toml && echo "$SEED_PEERS" > seed_peers.config.toml && echo "$TRUSTED_PEERS" > trusted_peers.config.toml && echo "$PEER_KEYPAIRS" > peer_keypairs.config.toml && echo "$GENESIS_BLOB" | base64 -d > genesis.blob && exec /opt/libra/bin/libra_node -f node.config.toml --peer_id "$PEER_ID"

ARG BUILD_DATE
{'fraction_non_alphanumeric': 0.13161922252831343, 'fraction_numerical': 0.017141108050198958, 'mean_word_length': 4.288025889967638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4107792', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1173, 'n_words': 298}