-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
111 changed files
with
2,203 additions
and
1,508 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
## base image | ||
FROM ubuntu:20.04 AS base | ||
|
||
ARG extra_libraries | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt-get update -y -qq && apt-get install --no-install-recommends -y gnupg software-properties-common ca-certificates && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
# keys used by apt | ||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 | ||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 | ||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F | ||
# Install basic packages available from standard repos | ||
RUN apt-get update -y -qq && \ | ||
apt-get install --no-install-recommends -yq \ | ||
wget curl pkg-config zip unzip tar git && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# add setup_cpp | ||
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.18.0/setup_cpp_linux" -O /setup_cpp_linux | ||
RUN chmod +x /setup_cpp_linux | ||
RUN /setup_cpp_linux --compiler llvm --gcc true --make true --cmake true --ninja true --ccache true --doxygen true --gcovr true --cppcheck true --clangtidy true --clangformat true | ||
|
||
|
||
# Install more tools from standard repos | ||
RUN apt-get update -y && \ | ||
apt-get install --no-install-recommends -y \ | ||
${extra_libraries} cmake-extras \ | ||
valgrind linux-tools-common linux-tools-generic google-perftools \ | ||
python3 python3-pip \ | ||
neovim emacs nano && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install more pip tools | ||
RUN python3 -m pip install --upgrade pip setuptools && \ | ||
python3 -m pip install cogapp coverage | ||
|
||
## Cleanup cached apt data we don't need anymore | ||
RUN apt-get autoremove -y && apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# thx to https://github.com/lefticus/cpp_starter_project/pull/121 | ||
# By default, anything you run in Docker is done as superuser. | ||
# Conan runs some install commands as superuser, and will prepend `sudo` to | ||
# these commands, unless `CONAN_SYSREQUIRES_SUDO=0` is in your env variables. | ||
ENV CONAN_SYSREQUIRES_SUDO 0 | ||
# Some packages request that Conan use the system package manager to install | ||
# a few dependencies. This flag allows Conan to proceed with these installations; | ||
# leaving this flag undefined can cause some installation failures. | ||
ENV CONAN_SYSREQUIRES_MODE enabled | ||
|
||
|
||
ENV SETUP_ENV_SCRIPT ~/.cpprc | ||
|
||
# set default compiler | ||
ENV CC "/root/llvm/bin/clang" | ||
ENV CXX "/root/llvm/bin/clang++" | ||
ENV CMAKE "cmake" | ||
ENV MAKE "/root/ninja/ninja" | ||
|
||
# setup project env | ||
WORKDIR /home/project | ||
RUN bash -c 'source ~/.cpprc' | ||
|
||
CMD source ~/.cpprc | ||
ENTRYPOINT [ "/bin/bash" ] | ||
|
||
|
||
|
||
## ci image | ||
FROM base AS ci-base | ||
|
||
# default compiler versions | ||
ARG extra_libraries | ||
|
||
# Install packages available from standard repos | ||
RUN apt-get update -y && \ | ||
apt-get install --no-install-recommends -y \ | ||
wget curl ${extra_libraries} && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# set default compiler | ||
ENV CC "/root/llvm/bin/clang" | ||
ENV CXX "/root/llvm/bin/clang++" | ||
ENV CMAKE "cmake" | ||
ENV MAKE "/root/ninja/ninja" | ||
|
||
# build script settings | ||
ENV TARGET "all" | ||
ENV BUILD_TYPE "Release" | ||
ENV CMAKE_GENERATOR "Ninja" | ||
ENV VCPKG_TOOLCHAIN_FILE "/root/vcpkg/scripts/buildsystems/vcpkg.cmake" | ||
ENV TOOLCHAIN_FILE "/root/vcpkg/scripts/buildsystems/vcpkg.cmake" | ||
ENV CMAKE_ARGS "" | ||
|
||
# install vcpkg | ||
ENV VCPKG_DISABLE_METRICS 1 | ||
RUN /setup_cpp_linux --vcpkg true | ||
ENV VCPKG_ROOT "/root/vcpkg" | ||
|
||
ENV VCPKG_TOOLCHAIN_FILE "$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" | ||
|
||
# setup project env | ||
ENV PROJECT_DIR /home/project | ||
WORKDIR /home/project | ||
COPY ./scripts/docker-build.setup-cpp.sh ./docker-build.sh | ||
COPY ./scripts/docker-test.setup-cpp.sh ./docker-test.sh | ||
RUN mkdir build | ||
|
||
ENV SETUP_ENV_SCRIPT ~/.cpprc | ||
RUN bash -c 'source ~/.cpprc' | ||
CMD source ~/.cpprc | ||
ENTRYPOINT [ "/bin/bash" ] |
Oops, something went wrong.