-
Notifications
You must be signed in to change notification settings - Fork 54
/
dockerfile
94 lines (83 loc) · 2.18 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
# Fletch Dockerfile
# Installs the fletch binary to /opt/kitware/fletch
ARG BASE_IMAGE=ubuntu:20.04
ARG ENABLE_CUDA=OFF
FROM ${BASE_IMAGE} AS base
# Install system dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y --no-install-recommends \
build-essential \
libgl1-mesa-dev \
libexpat1-dev \
libgtk2.0-dev \
libxt-dev \
libxml2-dev \
libssl-dev \
liblapack-dev \
openssl \
curl \
wget \
git \
libreadline-dev \
zlib1g-dev \
python3 \
python3-dev \
python3-pip
# Install Qt-specific system dependencies
# See https://doc.qt.io/qt-6/linux-requirements.html
RUN apt-get install -y --no-install-recommends \
libfontconfig1-dev \
libfreetype6-dev \
libx11-dev \
libx11-xcb-dev \
libxext-dev \
libxfixes-dev \
libxi-dev \
libxrender-dev \
libxcb1-dev \
libxcb-cursor-dev \
libxcb-glx0-dev \
libxcb-keysyms1-dev \
libxcb-image0-dev \
libxcb-shm0-dev \
libxcb-icccm4-dev \
libxcb-sync-dev \
libxcb-xfixes0-dev \
libxcb-shape0-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-util-dev \
libxcb-xinerama0-dev \
libxcb-xkb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev
# Install python dependencies
RUN pip3 install numpy cmake
RUN ln -s /usr/bin/python3 /usr/local/bin/python
# Remove unnecessary files
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
# Setup build environment
COPY . /fletch
RUN mkdir -p /fletch/build /opt/kitware/fletch
ENV LD_LIBRARY_PATH=/opt/kitware/fletch/lib/:$LD_LIBRARY_PATH
# Configure
RUN cd /fletch/build && \
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-Dfletch_ENABLE_ALL_PACKAGES=ON \
-Dfletch_BUILD_WITH_PYTHON=ON \
-Dfletch_BUILD_WITH_CUDA=${ENABLE_CUDA} \
-Dfletch_PYTHON_MAJOR_VERSION=3 \
-Dfletch_BUILD_INSTALL_PREFIX=/opt/kitware/fletch \
-Wno-dev
# Build
RUN cd /fletch/build && \
make -j$(nproc) -k
# Remove source and temporary build files
RUN rm -rf /fletch
# Remove record of intermediate files
FROM scratch
COPY --from=base / /