mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
75 lines
3.5 KiB
Plaintext
75 lines
3.5 KiB
Plaintext
FROM rippleci/clio_gcc:12.3.0
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
ARG TARGETARCH
|
|
|
|
SHELL ["/bin/bash", "-c"]
|
|
USER root
|
|
WORKDIR /root
|
|
|
|
ENV CCACHE_VERSION=4.8.3 \
|
|
LLVM_TOOLS_VERSION=17 \
|
|
GH_VERSION=2.40.0 \
|
|
DOXYGEN_VERSION=1.10.0
|
|
|
|
# Add repositories
|
|
RUN apt-get -qq update \
|
|
&& apt-get -qq install -y --no-install-recommends --no-install-suggests gnupg wget curl software-properties-common \
|
|
&& echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${LLVM_TOOLS_VERSION} main" >> /etc/apt/sources.list \
|
|
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
|
|
|
|
# Install packages
|
|
RUN apt update -qq \
|
|
&& apt install -y --no-install-recommends --no-install-suggests python3 python3-pip git git-lfs make ninja-build flex bison jq graphviz \
|
|
clang-format-${LLVM_TOOLS_VERSION} clang-tidy-${LLVM_TOOLS_VERSION} clang-tools-${LLVM_TOOLS_VERSION} \
|
|
&& update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${LLVM_TOOLS_VERSION} 100 \
|
|
&& pip3 install -q --upgrade --no-cache-dir pip && pip3 install -q --no-cache-dir conan==1.62 gcovr cmake cmake-format \
|
|
&& apt-get clean && apt remove -y software-properties-common
|
|
|
|
WORKDIR /tmp
|
|
|
|
# Install ccache from source
|
|
RUN wget "https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz" \
|
|
&& tar xf "ccache-${CCACHE_VERSION}.tar.gz" \
|
|
&& cd "ccache-${CCACHE_VERSION}" \
|
|
&& mkdir build && cd build \
|
|
&& cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. \
|
|
&& cmake --build . --target install \
|
|
&& rm -rf /tmp/* /var/tmp/*
|
|
|
|
# Install doxygen from source
|
|
RUN wget "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.src.tar.gz" \
|
|
&& tar xf "doxygen-${DOXYGEN_VERSION}.src.tar.gz" \
|
|
&& cd "doxygen-${DOXYGEN_VERSION}" \
|
|
&& mkdir build && cd build \
|
|
&& cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. \
|
|
&& cmake --build . --target install \
|
|
&& rm -rf /tmp/* /var/tmp/*
|
|
|
|
# Install gh
|
|
RUN wget https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_${TARGETARCH}.tar.gz \
|
|
&& tar xf gh_${GH_VERSION}_linux_${TARGETARCH}.tar.gz \
|
|
&& mv gh_${GH_VERSION}_linux_${TARGETARCH}/bin/gh /usr/bin/gh \
|
|
&& rm -rf /tmp/* /var/tmp/*
|
|
|
|
# Libstdc++ from gcc-12 got lost, probably via apt update. Let's recover it
|
|
RUN update-alternatives --install /usr/bin/ccache ccache /usr/local/bin/ccache 100 \
|
|
&& update-alternatives --auto libstdc++.so.6
|
|
|
|
WORKDIR /root
|
|
# Using root by default is not very secure but github checkout action doesn't work with any other user
|
|
# https://github.com/actions/checkout/issues/956
|
|
# And Github Actions doc recommends using root
|
|
# https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
|
|
|
|
# Setup conan
|
|
# Note: intentionally leaving cppstd=20
|
|
RUN conan profile new default --detect \
|
|
&& conan profile update settings.compiler=gcc default \
|
|
&& conan profile update settings.compiler.version=12 default \
|
|
&& conan profile update settings.compiler.cppstd=20 default \
|
|
&& conan profile update settings.compiler.libcxx=libstdc++11 default \
|
|
&& conan profile update env.CC=/opt/bin/gcc default \
|
|
&& conan profile update env.CXX=/opt/bin/g++ default \
|
|
&& conan profile update "conf.tools.build:compiler_executables={\"c\": \"/opt/bin/gcc\", \"cpp\": \"/opt/bin/g++\"}" default \
|
|
&& conan remote add --insert 0 conan-non-prod http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
|