forked from deephealthproject/eddl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (42 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
51
52
53
FROM ubuntu:20.04
# Install minimum dependencies ******************
RUN apt-get update
RUN apt-get install -y build-essential ca-certificates apt-utils checkinstall # Essentials
RUN apt-get install -y git wget vim
# Install miniconda
RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh
# Activate conda
ENV PATH="/root/miniconda3/bin:$PATH"
RUN conda --version
# Set working directory
WORKDIR /eddl
# Environment first (to reduce the building time if something has change)
COPY environment.yml .
# Install dependencies
RUN conda update conda && \
conda env create -f environment.yml
# Copy repo
COPY . .
# Make RUN commands use the new environment:
SHELL ["conda", "run", "-n", "eddl", "/bin/bash", "-c"]
# Build EDDL
RUN mkdir build
RUN cd build && \
cmake .. \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DBUILD_SUPERBUILD=OFF \
-DBUILD_TARGET=CPU \
-DBUILD_HPC=OFF -DBUILD_TESTS=ON \
-DBUILD_DIST=OFF -DBUILD_RUNTIME=OFF
RUN cd build && \
make -j$(nproc) && \
make install
# Test EDDL
RUN cd build/bin/ && ./unit_tests
# Build docs (optional, check .dockerignore)
RUN cd docs/doxygen/ && doxygen
RUN cd docs/sphinx/source/ && make clean && make html