forked from stellar/quickstart
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathDockerfile.core
More file actions
50 lines (44 loc) · 1.9 KB
/
Copy pathDockerfile.core
File metadata and controls
50 lines (44 loc) · 1.9 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
# Build stage — build stellar-core from source.
# v26 requires C++20, so the build stage is Ubuntu 24.04 (noble) with clang-20 /
# libc++-20, matching upstream stellar/quickstart's recipe.
FROM ubuntu:24.04 AS buildstage
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y install iproute2 procps lsb-release \
git build-essential pkg-config autoconf automake libtool \
bison flex sed perl libpq-dev parallel libgoogle-perftools-dev \
clang-20 libc++abi-20-dev libc++-20-dev \
postgresql curl
ARG CORE_REPO=https://github.com/stellar/stellar-core.git
ARG REF
ARG CONFIGURE_FLAGS='--disable-tests'
RUN git clone --branch ${REF} --recurse-submodules ${CORE_REPO} /stellar-core
WORKDIR /stellar-core
ARG CC=clang-20
ARG CXX=clang++-20
ARG CFLAGS='-O3 -g1 -fno-omit-frame-pointer'
ARG CXXFLAGS='-O3 -g1 -fno-omit-frame-pointer -stdlib=libc++'
RUN ./autogen.sh
RUN ./install-rust.sh
ENV PATH "/root/.cargo/bin:$PATH"
RUN ./configure CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" ${CONFIGURE_FLAGS}
# Build Rust/cargo artifacts serially before the parallel C++ compile: concurrent
# cargo writes during `make -j` trigger spurious ETXTBSY (Error 127) on macOS overlayfs.
RUN make -C src \
rust/RustBridge.h rust/RustBridge.cpp \
../src/rust/src/dep-trees/equal-trees.stamp \
../src/rust/soroban/soroban-libs.stamp \
../target/release/librust_stellar_core.a
RUN make -j$(nproc)
RUN make install
# Deploy stage — only runtime deps.
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y install libunwind8 postgresql curl sqlite3 iproute2 \
libc++abi1-20 libc++1-20 && \
rm -rf /var/lib/apt/lists/*
COPY --from=buildstage /usr/local/bin/stellar-core /usr/local/bin/stellar-core
EXPOSE 11625
EXPOSE 11626
CMD ["stellar-core"]