Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1FROM debian:stable-slim3SHELL ["/bin/bash", "-c"]5WORKDIR /root7# A too high maximum number of file descriptors (with the default value8# inherited from the docker host) can cause issues with some of our tools:9# - sanitizers hanging: https://github.com/google/sanitizers/issues/166210# - valgrind crashing: https://stackoverflow.com/a/7529301411# This is not be a problem on our CI hosts, but developers who run the image12# on their machines may run into this (e.g., on Arch Linux), so warn them.13# (Note that .bashrc is only executed in interactive bash shells.)14RUN echo 'if [[ $(ulimit -n) -gt 200000 ]]; then echo "WARNING: Very high value reported by \"ulimit -n\". Consider passing \"--ulimit nofile=32768\" to \"docker run\"."; fi' >> /root/.bashrc16RUN dpkg --add-architecture i386 && \17dpkg --add-architecture s390x && \18dpkg --add-architecture armhf && \19dpkg --add-architecture arm64 && \20dpkg --add-architecture ppc64el22# dpkg-dev: to make pkg-config work in cross-builds23# llvm: for llvm-symbolizer, which is used by clang's UBSan for symbolized stack traces24RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \25git ca-certificates \26make automake libtool pkg-config dpkg-dev valgrind qemu-user \27gcc clang llvm libclang-rt-dev libc6-dbg \28g++ \29gcc-i686-linux-gnu libc6-dev-i386-cross libc6-dbg:i386 libubsan1:i386 libasan8:i386 \30gcc-s390x-linux-gnu libc6-dev-s390x-cross libc6-dbg:s390x \31gcc-arm-linux-gnueabihf libc6-dev-armhf-cross libc6-dbg:armhf \32gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross libc6-dbg:ppc64el \33gcc-mingw-w64-x86-64-win32 wine64 wine \34gcc-mingw-w64-i686-win32 wine32 \35python3-full && \36if ! ( dpkg --print-architecture | grep --quiet "arm64" ) ; then \37DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \38gcc-aarch64-linux-gnu libc6-dev-arm64-cross libc6-dbg:arm64 ;\39fi && \40apt-get clean && rm -rf /var/lib/apt/lists/*42# Build and install gcc snapshot43ARG GCC_SNAPSHOT_MAJOR=1744RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \45wget libgmp-dev libmpfr-dev libmpc-dev flex && \46mkdir gcc && cd gcc && \47wget --progress=dot:giga --https-only --recursive --accept '*.tar.xz' --level 1 --no-directories "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}" && \48wget "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}/sha512.sum" && \49sha512sum --check --ignore-missing sha512.sum && \50# We should have downloaded exactly one tar.xz file51ls && \52[ $(ls *.tar.xz | wc -l) -eq "1" ] && \53tar xf *.tar.xz && \54mkdir gcc-build && cd gcc-build && \55../*/configure --prefix=/opt/gcc-snapshot --enable-languages=c --disable-bootstrap --disable-multilib --without-isl && \56make -j $(nproc) && \57make install && \58cd ../.. && rm -rf gcc && \59ln -s /opt/gcc-snapshot/bin/gcc /usr/bin/gcc-snapshot && \60apt-get autoremove -y wget libgmp-dev libmpfr-dev libmpc-dev flex && \61apt-get clean && rm -rf /var/lib/apt/lists/*63# Install clang snapshot, see https://apt.llvm.org/64RUN \65# Setup GPG keys of LLVM repository66apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y wget && \67wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \68# Add repository for this Debian release69. /etc/os-release && echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME} main" >> /etc/apt/sources.list && \70apt-get update && \71# Determine the version number of the LLVM development branch72LLVM_VERSION=$(apt-cache search --names-only '^clang-[0-9]+$' | sort -V | tail -1 | cut -f1 -d" " | cut -f2 -d"-" ) && \73# Install74DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y "clang-${LLVM_VERSION}" "libclang-rt-${LLVM_VERSION}-dev" && \75# Create symlink76ln -s "/usr/bin/clang-${LLVM_VERSION}" /usr/bin/clang-snapshot && \77# Clean up78apt-get autoremove -y wget && \79apt-get clean && rm -rf /var/lib/apt/lists/*81ENV VIRTUAL_ENV=/root/venv82RUN python3 -m venv $VIRTUAL_ENV83ENV PATH="$VIRTUAL_ENV/bin:$PATH"84RUN pip install lief
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.