From 1afede57b1e4a2818e0daa2fa51f3bf0e71915d9 Mon Sep 17 00:00:00 2001 From: LopesManuel Date: Tue, 12 Oct 2021 09:14:22 +0100 Subject: [PATCH] Add Dockerfile.dev and start_dev_env script to bootstrap a c++ development environment --- Dockerfile.dev | 23 +++++++++++++++++++++++ start_dev_env.sh | 7 +++++++ 2 files changed, 30 insertions(+) create mode 100644 Dockerfile.dev create mode 100755 start_dev_env.sh diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..de56e59 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,23 @@ + +FROM ubuntu:21.04 + +ARG DEBIAN_FRONTEND=noninteractive + +# Following https://github.com/zouzias/docker-boost/blob/master/Dockerfile + +ENV BOOST_VERSION=1.77.0 +ENV BOOST_VERSION_=1_77_0 +ENV BOOST_ROOT=/usr/include/boost + +RUN apt-get -qq update && apt-get install -q -y software-properties-common +RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y +RUN apt-get -qq update && apt-get install -qy g++ gcc git wget cmake libspdlog-dev python3 python3-pip gdb libssl-dev + +RUN wget --max-redirect 3 https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_}.tar.gz +RUN mkdir -p /usr/include/boost && tar zxf boost_${BOOST_VERSION_}.tar.gz -C /usr/include/boost --strip-components=1 + +RUN mkdir /home/app +WORKDIR /home/app + +RUN echo ${BOOST_ROOT} +ENTRYPOINT /bin/bash diff --git a/start_dev_env.sh b/start_dev_env.sh new file mode 100755 index 0000000..a63f426 --- /dev/null +++ b/start_dev_env.sh @@ -0,0 +1,7 @@ + +if [[ "$(docker images -q cpp_dev_env:latest 2> /dev/null)" == "" ]]; then + docker build -f Dockerfile.dev . -t cpp_dev_env +fi + + +docker run -ti --rm -v ${PWD}:/home/app cpp_dev_env bash