Skip to content

Instantly share code, notes, and snippets.

@44uk
Created August 4, 2020 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 44uk/50370629530e5d4ee082a61e2da433f9 to your computer and use it in GitHub Desktop.
Save 44uk/50370629530e5d4ee082a61e2da433f9 to your computer and use it in GitHub Desktop.
catapult-server builder
# Build environment suide
# [catapult\-server/BUILDWIN\.md at conanbuild · nemtech/catapult\-server](https://github.com/nemtech/catapult-server/blob/conanbuild/docs/BUILDWIN.md)
#
FROM ubuntu:18.04
# WORKDIR /tmp
RUN sed -i.bak -e "s%http://[^ ]\+%http://linux.yz.yamagata-u.ac.jp/ubuntu/%g" /etc/apt/sources.list
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y --no-install-recommends \
git \
curl \
software-properties-common \
python3 \
python3-pip \
python3-setuptools \
pkg-config \
ninja-build \
build-essential \
libssl-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# CMake (at least 3.14)
# && ./bootstrap --prefix=/usr/local && make -j$(nproc) && make install \
RUN git clone https://gitlab.kitware.com/cmake/cmake.git -b v3.18.1 --depth 1 \
&& cd cmake \
&& ./bootstrap && make -j$(nproc) && make install \
&& cd -
# Conan
RUN pip3 install wheel \
&& pip3 install conan \
&& conan remote add nemtech https://api.bintray.com/conan/nemtech/symbol-server-dependencies
# gcc,g++ 9 (recommend version 9.2.1+)
RUN add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get purge -y gcc-7 g++-7 \
&& apt-get install -y --no-install-recommends g++-9-multilib \
&& ln -s /usr/bin/gcc-9 /usr/bin/gcc \
&& ln -s /usr/bin/g++-9 /usr/bin/g++ \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# catapult-server
RUN git clone https://github.com/nemtech/catapult-server.git -b main --depth 1 \
&& cd catapult-server \
&& mkdir _build && cd _build \
&& conan install .. --build=missing \
&& cmake -DUSE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -G Ninja .. \
&& ninja publish && ninja -j$(nproc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment