-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (38 loc) · 1.36 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Development / Testing image for C++ CMake template project
# base image used as the starting point for this image
FROM debian:latest
# ENV DEBIAN_FRONTEND=noninteractive
# Adding all required packages to the image
RUN apt-get update \
&& apt-get install -y \
apt-utils \
git \
build-essential \
libtool autoconf pkg-config \
clang \
llvm \
libc++-dev libc++abi-dev \
cmake \
libboost-all-dev \
ccache \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Enviroment variables
ENV CC=/usr/bin/clang
ENV CXX=/usr/bin/clang++
# Variable that can be overwritten at build time of the image
ARG TEST_VAR_DOCKERFILE=test
# ↑ Setup build environment
# ↓ Build and compile project
# Copying the actual folder of the project into the cointainer filesystem
COPY ProjectFolder /ProjectFolder
# Setting the working directory inside the project folder
WORKDIR /
# Running Cmake build script, all cmake files are generated
RUN ProjectFolder/scripts/cmake_build.sh
# Building the project using the build files generated by Cmake
# RUN ProjectFolder/scripts/make_debug.sh
# WORKDIR /ProjectFolder/build/debug
# The command that is run by default when the container starts
CMD ["ctest", "--output-on-failure"]
# Run this to launch the project binary instead
# CMD ["./ProjectFolder/build/debug/bin/cpp-cmake-template"]