forked from jHaselberger/coros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
163 lines (141 loc) · 4.12 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# OPENGL SUPPORT ------------------------------------------------------------------------------
# start with plain ros as base image for testing
FROM ros:melodic AS builder
RUN /bin/bash -c "source /opt/ros/melodic/setup.bash"
# install some needed packages and set gcc-8 as default compiler
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
llvm-7 \
llvm-dev \
autoconf \
automake \
bison \
flex \
gettext \
libtool \
python-dev\
git \
pkgconf \
python-mako \
zlib1g-dev \
x11proto-gl-dev \
libxext-dev \
xcb \
libx11-xcb-dev \
libxcb-dri2-0-dev \
libxcb-xfixes0-dev \
libdrm-dev \
g++ \
make \
xvfb \
x11vnc \
g++-8 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 && \
rm -rf /var/lib/apt/lists/*
# get mesa (using 19.0.2 as later versions dont use the configure script)
WORKDIR /mesa
RUN git clone https://gitlab.freedesktop.org/mesa/mesa.git
WORKDIR /mesa/mesa
RUN git checkout mesa-19.0.2
#RUN git checkout mesa-18.2.2
# build and install mesa
RUN libtoolize && \
autoreconf --install && \
./configure \
--enable-glx=gallium-xlib \
--with-gallium-drivers=swrast,swr \
--disable-dri \
--disable-gbm \
--disable-egl \
--enable-gallium-osmesa \
--enable-autotools \
--enable-llvm \
--with-llvm-prefix=/usr/lib/llvm-7/ \
--enable-gles1 \
--enable-gles2 \
--prefix=/usr/local && \
make -j 4 && \
make install && \
rm -rf /mesa
# UBUNTU WITH MESA GL -----------------------------------------------------------------------
FROM ros:melodic
COPY --from=builder /usr/local /usr/local
RUN /bin/bash -c "source /opt/ros/melodic/setup.bash"
# update ubuntu and install all dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
xterm \
#freeglut3 \
openssh-server \
synaptic \
nfs-common \
mesa-utils \
xfonts-75dpi \
libusb-0.1-4 \
python \
libglu1-mesa \
libqtgui4 \
gedit \
xvfb \
x11vnc \
llvm-7-dev \
expat \
nano \
dos2unix \
ros-melodic-image-transport \
ros-melodic-cv-bridge \
python-pip \
libxkbfile-dev \
libsecret-1-dev \
dos2unix \
wget \
ros-melodic-rqt \
ros-melodic-rqt* \
jwm \
ros-melodic-rviz \
ros-melodic-desktop-full &&\
rm -rf /var/lib/apt/lists/*
# copy some needed libs
COPY ./libs libs/
# insatll libpng12
RUN dpkg -i /libs/libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
# install all needed python packages
RUN pip install \
jupyterlab \
matplotlib \
tqdm \
pymongo \
h5py
# get vs code server
RUN mkdir /code-server &&\
wget -qO- https://github.com/cdr/code-server/releases/download/2.1523-vsc1.38.1/code-server2.1523-vsc1.38.1-linux-x86_64.tar.gz \
| tar xvz --strip-components=1 -C /code-server
# get and setup novnc
WORKDIR /novnc
RUN git clone https://github.com/novnc/noVNC.git
# fix for offline mode -> prefatch websockify
RUN cd ./noVNC/utils && git clone https://github.com/novnc/websockify
# set the environment variables (display -> 99 and LIBGL_ALWAYS_SOFTWARE)
ENV DISPLAY=":99" \
GALLIUM_DRIVER="llvmpipe" \
LIBGL_ALWAYS_SOFTWARE="1" \
LP_DEBUG="" \
LP_NO_RAST="false" \
LP_NUM_THREADS="" \
LP_PERF="" \
MESA_VERSION="19.0.2" \
XVFB_WHD="1920x1080x24" \
MESA_GLSL="errors" \
PASSWORD="dev@ros"
# setup the entrypoint script (starts the xvfb and vnc session)
COPY ./entrypoint_code.sh /entry/
RUN dos2unix /entry/entrypoint_code.sh && chmod +x /entry/entrypoint_code.sh
ENTRYPOINT ["/entry/entrypoint_code.sh"]
# set the default shell
SHELL ["/bin/bash", "-c"]
# source ros for every new terminal session
RUN echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
# set our workdir
WORKDIR /workspace
# expose the vnc, novnc and code-server ports
#EXPOSE 5900
EXPOSE 6080
EXPOSE 8080