# syntax=docker.io/docker/dockerfile:1.7-labs FROM --platform=${TARGETPLATFORM} ubuntu:24.04 AS base ENV PATH="${PATH}:/root/.cargo/bin/" ARG TARGETOS ARG TARGETARCH # Install GMP 6.2 (6.3 which MacOS is using only available on Debian unstable) RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ cmake \ libgmp-dev \ libmpfr-dev \ libmpfr6 \ wget \ m4 \ pkg-config \ gcc \ g++ \ make \ autoconf \ automake \ libtool \ libssl-dev \ python3 \ python-is-python3 \ && rm -rf /var/lib/apt/lists/* ARG GO_VERSION=1.23.5 RUN apt update && apt install -y wget && \ ARCH=$(dpkg --print-architecture) && \ case ${ARCH} in \ amd64) GOARCH=amd64 ;; \ arm64) GOARCH=arm64 ;; \ *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \ esac && \ wget https://go.dev/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ rm -rf /usr/local/go && \ tar -C /usr/local -xzf go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ rm go${GO_VERSION}.linux-${GOARCH}.tar.gz ENV PATH=$PATH:/usr/local/go/bin RUN git clone https://github.com/flintlib/flint.git && \ cd flint && \ git checkout flint-3.0 && \ ./bootstrap.sh && \ ./configure \ --prefix=/usr/local \ --with-gmp=/usr/local \ --with-mpfr=/usr/local \ --enable-static \ --disable-shared \ CFLAGS="-O3" && \ make && \ make install && \ cd .. && \ rm -rf flint COPY docker/rustup-init.sh /opt/rustup-init.sh RUN /opt/rustup-init.sh -y --profile minimal # Install uniffi-bindgen-go RUN cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0 FROM base AS build ENV GOEXPERIMENT=arenas ENV QUILIBRIUM_SIGNATURE_CHECK=false # Install grpcurl before building the node and client # as to avoid needing to redo it on rebuilds RUN go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest WORKDIR /opt/ceremonyclient # Copy everything except node and client so as to avoid # invalidating the cache at this point on client or node rebuilds COPY --exclude=client \ --exclude=conntest \ --exclude=sidecar . . RUN bash install-emp.sh RUN cd emp-tool && sed -i 's/add_library(${NAME} SHARED ${sources})/add_library(${NAME} STATIC ${sources})/g' CMakeLists.txt && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local && cd .. && make && make install && cd .. RUN cd emp-ot && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local && cd .. && make && make install && cd .. RUN go mod download ## Generate Rust bindings for channel WORKDIR /opt/ceremonyclient/channel RUN go mod download RUN ./generate.sh ## Generate Rust bindings for VDF WORKDIR /opt/ceremonyclient/vdf RUN go mod download RUN ./generate.sh ## Generate Rust bindings for Ferret WORKDIR /opt/ceremonyclient/ferret RUN go mod download RUN ./generate.sh ## Generate Rust bindings for BLS48581 WORKDIR /opt/ceremonyclient/bls48581 RUN go mod download RUN ./generate.sh ## Generate Rust bindings for RPM WORKDIR /opt/ceremonyclient/rpm RUN go mod download RUN ./generate.sh ## Generate Rust bindings for VerEnc WORKDIR /opt/ceremonyclient/verenc RUN go mod download RUN ./generate.sh ## Generate Rust bindings for Bulletproofs WORKDIR /opt/ceremonyclient/bulletproofs RUN go mod download RUN ./generate.sh FROM build AS build-conntest # Build and install conntest COPY ./conntest /opt/ceremonyclient/conntest WORKDIR /opt/ceremonyclient/conntest ENV GOPROXY=direct RUN ./build.sh && cp conntest /usr/bin # Allows exporting single binary FROM scratch AS conntest COPY --from=build-conntest /usr/bin/conntest /conntest ENTRYPOINT [ "/conntest" ] FROM ubuntu:24.04 RUN apt-get update && apt-get install libflint-dev -y ARG NODE_VERSION ARG GIT_REPO ARG GIT_BRANCH ARG GIT_COMMIT ENV GOEXPERIMENT=arenas LABEL org.opencontainers.image.title="Quilibrium Network Node connection test" LABEL org.opencontainers.image.description="Quilibrium is a decentralized alternative to platform as a service providers." LABEL org.opencontainers.image.version=$NODE_VERSION LABEL org.opencontainers.image.vendor=Quilibrium LABEL org.opencontainers.image.url=https://quilibrium.com/ LABEL org.opencontainers.image.documentation=https://quilibrium.com/docs LABEL org.opencontainers.image.source=$GIT_REPO LABEL org.opencontainers.image.ref.name=$GIT_BRANCH LABEL org.opencontainers.image.revision=$GIT_COMMIT RUN apt-get update && apt-get install -y ca-certificates COPY --from=build-conntest /usr/bin/conntest /usr/local/bin WORKDIR /root ENTRYPOINT ["conntest"]