mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-19 11:15:50 +00:00
69 lines
3.3 KiB
Plaintext
69 lines
3.3 KiB
Plaintext
FROM ubuntu:focal
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
ARG TARGETARCH
|
|
|
|
USER root
|
|
WORKDIR /root/
|
|
|
|
ENV GCC_VERSION=11 \
|
|
CCACHE_VERSION=4.8.3 \
|
|
LLVM_TOOLS_VERSION=17 \
|
|
GH_VERSION=2.40.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 \
|
|
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
|
|
&& wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - \
|
|
&& apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' \
|
|
&& 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 cmake python3 python3-pip sudo git \
|
|
ninja-build make pkg-config libzstd-dev libzstd1 g++-${GCC_VERSION} jq \
|
|
clang-format-${LLVM_TOOLS_VERSION} clang-tidy-${LLVM_TOOLS_VERSION} clang-tools-${LLVM_TOOLS_VERSION} \
|
|
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 100 \
|
|
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${GCC_VERSION} 100 \
|
|
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 100 \
|
|
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${GCC_VERSION} 100 \
|
|
&& update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-${GCC_VERSION} 100 \
|
|
&& update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-${GCC_VERSION} 100 \
|
|
&& update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-${GCC_VERSION} 100 \
|
|
&& update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${LLVM_TOOLS_VERSION} 100 \
|
|
&& apt-get clean && apt remove -y software-properties-common \
|
|
&& pip3 install -q --upgrade --no-cache-dir pip \
|
|
&& pip3 install -q --no-cache-dir conan==1.62 gcovr cmake-format
|
|
|
|
# Install ccache from source
|
|
WORKDIR /tmp
|
|
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 .. \
|
|
&& ninja && cp ./ccache /usr/bin/ccache
|
|
|
|
# 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
|
|
|
|
# Clean up
|
|
RUN rm -rf /tmp/* /var/tmp/*
|
|
|
|
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
|
|
RUN conan profile new default --detect \
|
|
&& conan profile update settings.compiler.cppstd=20 default \
|
|
&& conan profile update settings.compiler.libcxx=libstdc++11 default \
|
|
&& conan remote add --insert 0 conan-non-prod http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
|
|
|
|
|