Public Repository

Last pushed: 8 months ago
Short Description
Boost (1.63.0) with GMP (6.1.2), from lastest GCC image (6.3.0)
Full Description

Build info

  • Preparation
    FROM gcc:latest  
    RUN apt-get -y update \
    && apt-get -y install libicu-dev python-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
    
  • GMP
    ARG gmp_version=6.1.2
    ARG gmp_dir=gmp-6.1.2
    RUN wget --quiet https://gmplib.org/download/gmp/${gmp_dir}.tar.xz \
    && tar xf ${gmp_dir}.tar.xz \
    && rm ${gmp_dir}.tar.xz \
    && cd ${gmp_dir} \
    && ./configure --prefix=/usr \
    && make install \
    && cd .. \
    && rm -rf ${gmp_dir}
    ENV gmp_version ${gmp_version}
    
  • Boost
    ARG boost_version=1.63.0
    ARG boost_dir=boost_1_63_0
    RUN wget --quiet http://downloads.sourceforge.net/project/boost/boost/${boost_version}/${boost_dir}.tar.gz \
    && tar xfz ${boost_dir}.tar.gz \
    && rm ${boost_dir}.tar.gz \
    && cd ${boost_dir} \
    && ./bootstrap.sh --prefix=/usr \
    && (./b2    -j4 link=shared threading=multi -sNO_BZIP2=1 install \
    || ./b2    -j4 link=shared threading=multi -sNO_BZIP2=1 install \
    || ./b2    -j4 link=shared threading=multi -sNO_BZIP2=1 install \
    || ./b2 -q -j4 link=shared threading=multi -sNO_BZIP2=1 install) \
    && cd .. \
    && rm -rf ${boost_dir}
    ENV boost_version ${boost_version}
    

Usage

  • Get a bash command line
    docker run --rm -it tntxtnt/boost
    
  • Build and run your project
    cd ~/cpp/example
    docker run --rm -v "$PWD":/home -w /home tntxtnt/boost /bin/bash -c "g++ --std=c++14 -Wall -O2 -s main.cpp -lgmp -o main; ./main"
    
Docker Pull Command
Owner
tntxtnt