forked from broxus/tycho
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtycho.Dockerfile
More file actions
29 lines (21 loc) · 958 Bytes
/
tycho.Dockerfile
File metadata and controls
29 lines (21 loc) · 958 Bytes
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
ARG BASE="localhost/tycho-rocksdb"
# syntax=docker/dockerfile:1.2
FROM $BASE AS builder
WORKDIR /build
# Install Rust using rustup
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
COPY . .
# Set up Rust environment
ENV PATH="/root/.cargo/bin:${PATH}"
# Additional options to speedup link phase a bit
ENV RUSTFLAGS="-Clinker=clang -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--no-rosegment ${RUSTFLAGS}"
# Use cache mounts for cargo registry and git to speed up builds
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
cargo build --release --example network-node && \
cargo build --release --bin tycho --features=debug
FROM fedora:42
RUN mkdir /app
RUN dnf update -y && dnf install -y iproute iputils && dnf clean all
COPY --from=builder /build/target/release/examples/network-node /app/network-node
COPY --from=builder /build/target/release/tycho /app/tycho