Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (61 loc) · 2.81 KB
/
Copy pathDockerfile
File metadata and controls
74 lines (61 loc) · 2.81 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
ARG CHEF_IMAGE=chef
FROM ${CHEF_IMAGE} AS builder
ARG TARGETARCH
ARG RUST_PROFILE=profiling
ARG RUST_FEATURES="asm-keccak,jemalloc,otlp"
ARG VERGEN_GIT_SHA
ARG VERGEN_GIT_SHA_SHORT
ARG EXTRA_RUSTFLAGS=""
COPY . .
# Build ALL binaries in one pass - they share compiled artifacts
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked,id=cargo-registry-${TARGETARCH} \
--mount=type=cache,target=/usr/local/cargo/git,sharing=locked,id=cargo-git-${TARGETARCH} \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked,id=sccache-${TARGETARCH} \
RUSTFLAGS="-C link-arg=-fuse-ld=mold ${EXTRA_RUSTFLAGS}" \
cargo build --profile ${RUST_PROFILE} \
--bin tempo --features "${RUST_FEATURES},localnet" \
--bin tempo-localnet --features "${RUST_FEATURES},localnet" \
--bin tempo-sidecar \
--bin tempo-xtask
# Reuse the regular build artifacts, enabling custom PCRs only for the devnet binary.
FROM builder AS devnet-builder
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked,id=cargo-registry-${TARGETARCH} \
--mount=type=cache,target=/usr/local/cargo/git,sharing=locked,id=cargo-git-${TARGETARCH} \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked,id=sccache-${TARGETARCH} \
RUSTFLAGS="-C link-arg=-fuse-ld=mold ${EXTRA_RUSTFLAGS}" \
cargo build --profile ${RUST_PROFILE} \
--bin tempo --features "${RUST_FEATURES},localnet,custom-pcrs"
FROM debian:bookworm-slim@sha256:4724b8cc51e33e398f0e2e15e18d5ec2851ff0c2280647e1310bc1642182655d AS base
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /data
# tempo
FROM base AS tempo
ARG RUST_PROFILE=profiling
COPY --from=builder /app/target/${RUST_PROFILE}/tempo /usr/local/bin/tempo
ENTRYPOINT ["/usr/local/bin/tempo"]
# tempo-devnet
FROM base AS tempo-devnet
ARG RUST_PROFILE=profiling
COPY --from=devnet-builder /app/target/${RUST_PROFILE}/tempo /usr/local/bin/tempo
ENTRYPOINT ["/usr/local/bin/tempo"]
# tempo-localnet
FROM base AS tempo-localnet
ARG RUST_PROFILE=profiling
COPY --from=builder /app/target/${RUST_PROFILE}/tempo /usr/local/bin/tempo
COPY --from=builder /app/target/${RUST_PROFILE}/tempo-localnet /usr/local/bin/tempo-localnet
EXPOSE 8545
VOLUME ["/data"]
HEALTHCHECK --interval=2s --timeout=2s --start-period=120s --retries=5 CMD ["/usr/local/bin/tempo-localnet", "--health"]
ENTRYPOINT ["/usr/local/bin/tempo-localnet"]
# tempo-sidecar
FROM base AS tempo-sidecar
ARG RUST_PROFILE=profiling
COPY --from=builder /app/target/${RUST_PROFILE}/tempo-sidecar /usr/local/bin/tempo-sidecar
ENTRYPOINT ["/usr/local/bin/tempo-sidecar"]
# tempo-xtask
FROM base AS tempo-xtask
ARG RUST_PROFILE=profiling
COPY --from=builder /app/target/${RUST_PROFILE}/tempo-xtask /usr/local/bin/tempo-xtask
ENTRYPOINT ["/usr/local/bin/tempo-xtask"]