forked from ChicoState/MyFave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (28 loc) · 834 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
FROM ubuntu:noble
LABEL title="CPP Container"
LABEL version=1.0
ENV GTEST_REPO=/googletest
ENV GTEST_DIR=${GTEST_REPO}/googletest
ENV WORKDIR=/usr/src
WORKDIR /usr/src
# Set Docker arguments
ARG DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && \
apt-get install -y \
build-essential \
g++ \
cmake \
git-all \
dos2unix
RUN apt-get clean
# Setup GoogleTest
RUN git clone --depth=1 https://github.com/google/googletest ${GTEST_REPO}
RUN mkdir ${GTEST_REPO}/build && cd ${GTEST_REPO}/build \
&& cmake .. -DBUILD_GMOCK=OFF && make && cd ${WORKDIR}
# Copy repo source into container
COPY . ${WORKDIR}
# Assure Unix linefeed for all files
RUN find . -type f -print0 | xargs -0 dos2unix --
# Build project
CMD sh -c ${WORKDIR}/test_runner.sh