-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
95 lines (84 loc) · 2.59 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Container with dependencies necessary to run note-c unit tests.
# Build development environment
# $ docker build . --tag note_c_run_unit_tests
# Launch development environment (mount source root as /note-c/)
# $ docker run --rm --volume $(pwd)/../../../:/note-c/ --workdir /note-c/ note_c_run_unit_tests
# Global Argument(s)
ARG DEBIAN_FRONTEND="noninteractive"
ARG UID=1000
ARG USER="blues"
# POSIX compatible (Linux/Unix) base image.
FROM --platform=linux/amd64 debian:stable-slim
# Import Global Argument(s)
ARG DEBIAN_FRONTEND
ARG UID
ARG USER
# Local Argument(s)
# Create Non-Root User
RUN ["dash", "-c", "\
addgroup \
--gid ${UID} \
\"${USER}\" \
&& adduser \
--disabled-password \
--gecos \"\" \
--ingroup \"${USER}\" \
--uid ${UID} \
\"${USER}\" \
&& usermod \
--append \
--groups \"dialout,plugdev\" \
\"${USER}\" \
"]
# Install whatever dependencies we can via apt-get.
RUN ["dash", "-c", "\
apt-get update --quiet \
&& apt-get install --assume-yes --no-install-recommends --quiet \
astyle \
ca-certificates \
curl \
g++ \
gcc \
gdb \
git \
lcov \
make \
nano \
python3-pip \
python3-sphinx \
valgrind \
&& pip install --break-system-packages \
breathe \
sphinx-rtd-theme \
&& apt-get clean \
&& apt-get purge \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
"]
# Download and install Doxygen 1.9.8. Currently, the version of Doxygen that
# gets installed via apt-get doesn't have support FAIL_ON_WARNINGS_PRINT for the
# WARN_AS_ERROR config option (added in 1.9.7).
RUN ["dash", "-c", "\
curl -LO https://github.com/doxygen/doxygen/releases/download/Release_1_9_8/doxygen-1.9.8.linux.bin.tar.gz \
&& tar xf doxygen-1.9.8.linux.bin.tar.gz \
&& cd doxygen-1.9.8 \
&& make INSTALL=/usr install \
&& cd .. \
&& rm doxygen-1.9.8.linux.bin.tar.gz \
&& rm -rf doxygen-1.9.8 \
"]
# Download and install CMake v3.25.1. We need CMake v3.20+ in order to get the
# ctest --test-dir option used by run_unit_tests.sh.
RUN ["dash", "-c", "\
curl -LO https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1-linux-x86_64.tar.gz \
&& tar xf cmake-3.25.1-linux-x86_64.tar.gz --strip-components=1 -C /usr \
&& rm cmake-3.25.1-linux-x86_64.tar.gz \
"]
# Download and install Catch2 v3.2.1.
RUN ["dash", "-c", "\
curl -LO https://github.com/catchorg/Catch2/archive/refs/tags/v3.2.1.tar.gz \
&& tar xf v3.2.1.tar.gz \
&& cd Catch2-3.2.1 \
&& cmake -DCATCH_INSTALL_DOCS=0 -B build/ \
&& cmake --build build/ --target install \
&& rm -rf Catch2-3.2.1 v3.2.1.tar.gz \
"]