-
-
Save s311354/29c09cecf258d1435574b0148c107d18 to your computer and use it in GitHub Desktop.
Build Docker Image with Boost Library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
MAINTAINER Louis Liu <s041978@hotmail.com> | |
WORKDIR /mnt/ | |
ARG DEBIAN_FRONTEND=noninteractive | |
ARG CMAKE_VERSION=3.25.1 | |
# Install package dependencies | |
RUN apt-get update &&\ | |
apt-get install -y --no-install-recommends software-properties-common build-essential \ | |
autoconf libtool pkg-config ca-certificates libssl-dev pkg-config \ | |
git wget vim cppman \ | |
automake g++ gcc \ | |
gdb valgrind && \ | |
apt-get clean | |
# We pass the boost version as argument | |
ARG BOOST_VERSION | |
ARG NUM_JOBS | |
ENV NUM_JOBS=${NUM_JOBS} | |
# Install CMake | |
RUN cd /tmp && \ | |
wget https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FKitware%2FCMake%2Freleases%2Fdownload%2Fv%24&data=05%7C01%7C%7C0dca2689d18b42771ee808db012a764e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638105054127172004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ba4bIIOdgEf5LVWjXRXsE%2BgAQeTF6MQnzTlmXS%2F4xxU%3D&reserved=0{CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz && \ | |
tar xzf cmake-${CMAKE_VERSION}.tar.gz && \ | |
cd cmake-${CMAKE_VERSION} && \ | |
./bootstrap && \ | |
make -j${NUM_JOBS} && \ | |
make install && \ | |
rm -rf /tmp/* | |
ENV BOOST_VERSION=${BOOST_VERSION} | |
ENV BOOST_ROOT=/usr/include/boost | |
# Install Boost | |
RUN cd /tmp && \ | |
BOOST_VERSION_MOD=$(echo $BOOST_VERSION | tr . _) && \ | |
wget https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fboostorg.jfrog.io%2Fartifactory%2Fmain%2Frelease%2F%24&data=05%7C01%7C%7C0dca2689d18b42771ee808db012a764e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638105054127172004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=VWEW0PG7CmnLkqMMf%2FX3jXkKX2G4Jb8TvZqg8C8njD8%3D&reserved=0{BOOST_VERSION}/source/boost_${BOOST_VERSION_MOD}.tar.bz2 && \ | |
tar --bzip2 -xf boost_${BOOST_VERSION_MOD}.tar.bz2 && \ | |
cd boost_${BOOST_VERSION_MOD} && \ | |
./bootstrap.sh --prefix=/usr/local && \ | |
./b2 --prefix=/usr/local install && \ | |
rm -rf /tmp/* | |
RUN echo ${BOOST_ROOT} | |
ENTRYPOINT /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Practice how to build Docker Image with Boost Library