forked from hengli/camodocal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
74 lines (65 loc) · 2.64 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
# This uses the nvidia/cuda base image with Ubuntu 20.04 and CUDA 11.2
FROM nvidia/cuda:11.4.3-cudnn8-devel-ubuntu18.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
# setup environment
RUN apt-get clean && apt-get update && apt-get install -y locales && locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
# create user folders
RUN mkdir -p $HOME/input_data
RUN mkdir -p $HOME/output_data
# upgrade existing packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/*
# install necessary packages for OpenCV/Ceres/CamoDocal
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -q -y --no-install-recommends \
wget \
iputils-ping \
build-essential \
ca-certificates \
libtiff5-dev \
libv4l-dev \
libatlas-base-dev \
libgtk2.0-dev \
gfortran \
git \
cmake \
libblas-dev \
libgoogle-glog-dev \
libsuitesparse-dev \
libboost-dev \
libboost-all-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN ping -c 4 github.com
# install eigen library needed by cered <-- 3.2.10 is the one reported to work best without bugs
WORKDIR /root
RUN wget https://gitlab.com/libeigen/eigen/-/archive/3.2.10/eigen-3.2.10.tar.gz
RUN tar zxf eigen-3.2.10.tar.gz
RUN mkdir eigen-bin && cd eigen-bin && cmake ../eigen-3.2.10
RUN cd eigen-bin && make -j6 install
# install ceres library for camodocal <-- version 1.11.0 is the one reported to work best without bugs
# RUN wget http://ceres-solver.org/ceres-solver-1.11.0.tar.gz
# RUN tar zxf ceres-solver-1.11.0.tar.gz
# RUN mkdir ceres-bin && cd ceres-bin && cmake ../ceres-solver-1.11.0
# RUN cd ceres-bin && make -j6
# RUN cd ceres-bin && make install
# download OpenCV <-- 3.4.7 version is the latest check work with ceres and camodocal without error
RUN git clone https://github.com/opencv/opencv.git
RUN git clone https://github.com/opencv/opencv_contrib.git
RUN cd opencv && git checkout 3.4.7
RUN cd opencv_contrib && git checkout 3.4.7
# copy script to install OpenCV
COPY make_opencv.sh /root
RUN chmod a+x $HOME/make_opencv.sh
RUN /bin/bash -c ". $HOME/make_opencv.sh"
# downlaod and install camodocal
RUN git clone https://github.com/hengli/camodocal.git
COPY make_camodocal.sh /root
RUN chmod a+x $HOME/make_camodocal.sh
RUN /bin/bash -c ". $HOME/make_camodocal.sh"
# libdc1394 does not work in Docker, so disable it (we anyways don't need it in here)
RUN ln /dev/null /dev/raw1394 && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get remove -q -y libgtk2.0-dev
#Manual fix to prevent GTK errors
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -q -y --no-install-recommends libgtk2.0-dev -qqy x11-apps