-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (33 loc) · 1.55 KB
/
Dockerfile
File metadata and controls
40 lines (33 loc) · 1.55 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
FROM rust:bookworm AS builder
# This will be overridden by the value from docker-compose
# Supports: branch name, tag, or commit SHA
# Examples:
# STACKS_CORE_BASE_BRANCH=develop (branch)
# STACKS_CORE_BASE_BRANCH=3.3.0.0.1 (tag)
# STACKS_CORE_BASE_BRANCH=abc123def456 (commit)
ARG STACKS_CORE_BASE_BRANCH=master
RUN echo "Building Stacks Core from: $STACKS_CORE_BASE_BRANCH"
# Clone efficiently: shallow for branches/tags, targeted fetch for commits
RUN git init /code/stacks-core && \
cd /code/stacks-core && \
git remote add origin https://github.com/stacks-network/stacks-core.git && \
git fetch --depth=1 origin $STACKS_CORE_BASE_BRANCH && \
git checkout FETCH_HEAD
WORKDIR /code/stacks-core
RUN apt-get update && apt-get install -y libclang-dev llvm
# Run an build that we'll cache the result of and then build the code
RUN cargo build --features monitoring_prom,slog_json --bin stacks-node --bin stacks-signer
FROM debian:bookworm-slim AS stacks-node
RUN apt-get update \
&& apt-get install -y ca-certificates --no-install-recommends \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN mkdir /data
COPY --from=builder /code/stacks-core/target/debug/stacks-node /usr/local/bin/stacks-node
STOPSIGNAL SIGTERM
FROM debian:bookworm-slim AS stacks-signer
RUN apt-get update \
&& apt-get install -y ca-certificates --no-install-recommends \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN mkdir /data
COPY --from=builder /code/stacks-core/target/debug/stacks-signer /usr/local/bin/stacks-signer
STOPSIGNAL SIGTERM