/
Dockerfile.test
executable file
·45 lines (32 loc) · 1.05 KB
/
Dockerfile.test
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
FROM debian:bookworm AS builder
# get the necessary libraries
RUN apt-get update &&\
# apt-get install --yes git &&\
apt-get install --yes make g++ gfortran libglu1-mesa-dev
# prepare the directory for the executables
RUN mkdir ~/bin
# prepare the directory for the library
RUN mkdir ~/lib
RUN mkdir ~/lib/CitySim
# prepare the directory for the sources
WORKDIR /src
# get the open-source code
# RUN git clone https://github.com/kaemco/CitySim-Solver.git
# or copy it from the current directory
COPY . /src/CitySim-Solver
# compile the code
WORKDIR CitySim-Solver
RUN make -j $(nproc)
# make a final image with the executables and the necessary libraries
FROM python:3.10-slim-bookworm
RUN apt-get update &&\
apt-get --no-install-recommends install --yes gfortran libglu1-mesa
# prepare the environnement for the executables
ENV PATH "$PATH:/root/bin"
# copy the build solver from the builder image
COPY --from=builder /root/bin /root/bin
# prepare the testing
COPY test test
WORKDIR test
RUN pip3 install -r ./checks/requirements.txt
CMD ./test.sh