-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
43 lines (37 loc) · 1021 Bytes
/
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
# Start with a configurable base image
ARG IMG="debian"
FROM "${IMG}"
# Declare the arguments
ARG PKG="gcc g++"
ARG CC="gcc"
ARG CXX="g++"
# Update the package lists
RUN apt-get update
# Install the packages needed for the build
RUN env DEBIAN_FRONTEND=noninteractive apt-get install --yes \
"bear" \
"clang" \
"clang-tidy" \
"libglib2.0-dev" \
"libmosquitto-dev" \
"libopenmpi-dev" \
"libpapi-dev" \
"libprotobuf-c-dev" \
"make" \
"openssh-client" \
"pkg-config" \
"protobuf-c-compiler" \
"python" \
${PKG}
# Copy the current directory to the container and continue inside it
COPY "." "/mnt"
WORKDIR "/mnt"
# mpirun doesn't like being run as root, so continue as an unpriviledged user
RUN useradd "user"
RUN chown --recursive "user:user" "."
USER "user"
# Build and test
RUN CC="${CC}" CXX="${CXX}" ./configure
RUN OMPI_CC="${CC}" bear make
RUN make test
RUN find 'src' -name '*.c' -print0 | xargs --null --max-args='1' clang-tidy -p 'compile_commands.json'