1
+ FROM nvidia/cudagl:11.4.2-devel-ubuntu20.04
2
+ LABEL org.opencontainers.image.authors=
"[email protected] "
3
+ LABEL description="Container for Elastic Bridge (ROS wrapper for ElasticFusion)"
4
+ LABEL version="0.1"
5
+
6
+ ENV DEBIAN_FRONTEND noninteractive
7
+ RUN apt-get update \
8
+ && DEBIAN_FRONTEND=noninteractive apt-get install -y locales \
9
+ && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
10
+ && dpkg-reconfigure --frontend=noninteractive locales \
11
+ && update-locale LANG=en_US.UTF-8
12
+
13
+ # nvidia-container-runtime
14
+ ENV NVIDIA_VISIBLE_DEVICES \
15
+ ${NVIDIA_VISIBLE_DEVICES:-all}
16
+ ENV NVIDIA_DRIVER_CAPABILITIES \
17
+ ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics,compute,utility,display
18
+
19
+
20
+ # install libraries and tools
21
+ RUN apt-get update && apt-get install -y --no-install-recommends \
22
+ sudo \
23
+ dialog \
24
+ apt-utils \
25
+ git \
26
+ mercurial \
27
+ pkg-config \
28
+ mesa-utils \
29
+ libxau-dev \
30
+ libxdmcp-dev \
31
+ libxcb1-dev \
32
+ libxext-dev \
33
+ libx11-dev \
34
+ git \
35
+ tmux \
36
+ wget \
37
+ curl \
38
+ cmake \
39
+ vim \
40
+ build-essential \
41
+ unzip \
42
+ autoconf \
43
+ autogen \
44
+ automake \
45
+ libtool \
46
+ mlocate \
47
+ zlib1g-dev \
48
+ libopenblas-dev \
49
+ libflann-dev \
50
+ libpcl-dev \
51
+ libboost-all-dev \
52
+ libsuitesparse-dev \
53
+ libtbb-dev \
54
+ libusb-1.0-0-dev \
55
+ libgtest-dev \
56
+ pkg-config \
57
+ cmake-curses-gui \
58
+ gdb \
59
+ clang \
60
+ emacs \
61
+ libpcap-dev \
62
+ gnupg2 \
63
+ x11-xserver-utils \
64
+ lsb-release \
65
+ tilix \
66
+ && apt clean \
67
+ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
68
+
69
+ # install ROS
70
+ RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
71
+
72
+ RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
73
+
74
+ RUN apt-get update
75
+
76
+ RUN apt-get install -y --no-install-recommends ros-noetic-desktop-full
77
+
78
+ # install zsh
79
+ RUN git clone https://github.com/tccoin/easy-linux.git /root/easy-linux \
80
+ && cd /root/easy-linux \
81
+ && bash zsh.sh \
82
+ && touch /root/.z \
83
+ && rm -r /root/easy-linux
84
+
85
+ # install gitstatus
86
+ # https://github.com/romkatv/gitstatus/releases/tag/v1.3.1
87
+ RUN mkdir -p /root/.cache/gitstatus \
88
+ && wget https://github.com/romkatv/gitstatus/releases/download/v1.5.1/gitstatusd-linux-x86_64.tar.gz -O - \
89
+ | tar -zx -C /root/.cache/gitstatus/
90
+
91
+ # install slam libraries
92
+
93
+ RUN sudo apt install libpcl-dev
94
+
95
+ RUN mkdir /root/elstic_ws/src -p
96
+ WORKDIR /root/elstic_ws/src
97
+
98
+ # Download libraries
99
+ RUN git clone https://github.com/RMonica/elastic_bridge.git \
100
+ && git clone https://github.com/RMonica/init_fake_opengl_context.git \
101
+ && git clone https://github.com/mp3guy/ElasticFusion.git elastic_bridge/deps/ElasticFusion
102
+
103
+ # Compile ElasticFusion Core module
104
+ # # Update cmake
105
+ RUN sudo apt-get install -y --no-install-recommends software-properties-common \
106
+ && wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - \
107
+ && sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' \
108
+ && sudo apt-get update \
109
+ && sudo apt-get install -y --no-install-recommends cmake
110
+
111
+ # # Compile dependencies
112
+ RUN cd /root/elstic_ws/src/elastic_bridge/deps/ElasticFusion/ \
113
+ && git submodule update --init \
114
+ && cd third-party/Pangolin/ \
115
+ && mkdir build \
116
+ && cd build \
117
+ && cmake .. -DEIGEN_INCLUDE_DIR=/root/elstic_ws/src/elastic_bridge/deps/ElasticFusion/third-party/Eigen/ -DBUILD_PANGOLIN_PYTHON=false \
118
+ && make -j8
119
+
120
+
121
+ RUN sudo apt-get install -y --no-install-recommends cmake-qt-gui git build-essential libusb-1.0-0-dev libudev-dev openjdk-11-jdk freeglut3-dev libglew-dev libsuitesparse-dev zlib1g-dev libjpeg-dev \
122
+ && cd /root/elstic_ws/src/elastic_bridge/deps/ElasticFusion/third-party/OpenNI2/ \
123
+ && make -j8
124
+
125
+ # # Install CUDA
126
+ # RUN sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cuda
127
+
128
+ # # Compile elastic fusion
129
+ RUN cd /root/elstic_ws/src/elastic_bridge/deps/ElasticFusion/ \
130
+ && mkdir build \
131
+ && cd build \
132
+ && cmake .. \
133
+ && make -j8
134
+
135
+ # Compile the package
136
+ RUN cd /root/elstic_ws \
137
+ && . /opt/ros/noetic/setup.sh \
138
+ && catkin_make
139
+
140
+ # Apply the GUID patch
141
+ # COPY guid.patch /root/elstic_ws/src/elastic_bridge/patches/guid.patch
142
+ # RUN cd /root/elstic_ws/src/elastic_bridge/deps/ElasticFusion \
143
+ # && patch -p1 -i ../../patches/guid.patch
0 commit comments