|
| 1 | +# syntax=docker/dockerfile:1.3-labs |
| 2 | +FROM debian:trixie@sha256:8f6a88feef3ed01a300dafb87f208977f39dccda1fd120e878129463f7fa3b8f as build |
| 3 | + |
| 4 | +ARG VERSION=2.6.2 |
| 5 | + |
| 6 | +ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London" |
| 7 | + |
| 8 | +RUN <<-EOF |
| 9 | + set -e |
| 10 | + apt-get -y update && apt-get -y install \ |
| 11 | + python3-venv \ |
| 12 | + curl \ |
| 13 | + git \ |
| 14 | + build-essential \ |
| 15 | + cmake |
| 16 | +EOF |
| 17 | + |
| 18 | +RUN <<-EOF |
| 19 | + set -e |
| 20 | + echo "conan" > /tmp/requirements.in |
| 21 | + python3 -m venv /opt/conan_env |
| 22 | + /opt/conan_env/bin/python -m pip install pip-tools |
| 23 | + /opt/conan_env/bin/pip-compile --generate-hashes --output-file=/tmp/requirements.txt /tmp/requirements.in |
| 24 | + /opt/conan_env/bin/python -m pip install -r /tmp/requirements.txt --require-hashes |
| 25 | +EOF |
| 26 | + |
| 27 | +RUN git clone --single-branch --branch "${VERSION}" https://github.com/ripple/rippled.git /opt/ripple |
| 28 | + |
| 29 | +WORKDIR /opt/ripple |
| 30 | + |
| 31 | +ENV PATH="/opt/conan_env/bin:$PATH" |
| 32 | + |
| 33 | +# https://github.com/XRPLF/rippled/blob/develop/BUILD.md |
| 34 | +RUN <<-EOF |
| 35 | + set -e |
| 36 | + git config --global http.postBuffer 1048576000 |
| 37 | + conan config install /opt/ripple/conan/profiles/default -tf $(conan config home)/profiles |
| 38 | + conan remote add --index 0 xrplf "https://conan.ripplex.io" |
| 39 | + mkdir cmake_build |
| 40 | +EOF |
| 41 | + |
| 42 | +RUN <<-EOF |
| 43 | + set -e |
| 44 | + cd cmake_build |
| 45 | + conan install \ |
| 46 | + .. \ |
| 47 | + --profile:host=default \ |
| 48 | + --profile:build=default \ |
| 49 | + --output-folder . \ |
| 50 | + --build missing \ |
| 51 | + --settings build_type=Release |
| 52 | +EOF |
| 53 | + |
| 54 | +RUN <<-EOF |
| 55 | + set -e |
| 56 | + cd cmake_build |
| 57 | + cmake \ |
| 58 | + -DCMAKE_BUILD_TYPE=Release \ |
| 59 | + -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \ |
| 60 | + -DCMAKE_INSTALL_PREFIX=/opt/ripple/build \ |
| 61 | + -Dstatic=ON \ |
| 62 | + -Dxrpld=ON \ |
| 63 | + -Dtests=OFF \ |
| 64 | + -B./ .. |
| 65 | +EOF |
| 66 | + |
| 67 | +RUN <<-EOF |
| 68 | + set -e |
| 69 | + cd cmake_build |
| 70 | + cmake --build . --target install -- -j 8 |
| 71 | + find /opt/ripple/build/bin -type f -executable -exec strip -s {} + 2>/dev/null || true |
| 72 | + mkdir -p /opt/ripple/.ripple/db |
| 73 | +EOF |
| 74 | + |
| 75 | +COPY rippled.conf validators.txt /opt/ripple/.ripple/ |
| 76 | + |
| 77 | +FROM debian:trixie@sha256:8f6a88feef3ed01a300dafb87f208977f39dccda1fd120e878129463f7fa3b8f |
| 78 | +COPY --from=build /opt/ripple/build /opt/ripple/ |
| 79 | + |
| 80 | +ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London" |
| 81 | +ENV PATH="/opt/ripple/bin:${PATH}" |
| 82 | + |
| 83 | +RUN <<-EOF |
| 84 | +apt-get -y update && \ |
| 85 | +apt-get -y install \ |
| 86 | +libboost-all-dev \ |
| 87 | +net-tools \ |
| 88 | +curl \ |
| 89 | +jq \ |
| 90 | +netcat-openbsd |
| 91 | +EOF |
| 92 | + |
| 93 | +RUN <<-EOF |
| 94 | + mkdir -p /opt/ripple/.ripple/db && \ |
| 95 | + chmod 755 /opt/ripple/.ripple/db |
| 96 | +EOF |
| 97 | + |
| 98 | +COPY ./rippled.conf /opt/ripple/.ripple/rippled.conf |
| 99 | +COPY ./validators.txt /opt/ripple/.ripple/validators.txt |
| 100 | + |
| 101 | +# https://xrpl.org/commandline-usage.html |
| 102 | +ENTRYPOINT ["rippled", "--conf=/opt/ripple/.ripple/rippled.conf", "--fg"] |
0 commit comments