-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.amd64
executable file
·195 lines (155 loc) · 6.99 KB
/
Dockerfile.amd64
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
################################################################################
# base system
################################################################################
FROM osrf/ros:noetic-desktop-full as system
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
################################################################################
# VNC
################################################################################
# built-in packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
curl apache2-utils \
apt-utils wget ca-certificates git nano less dconf-cli \
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
supervisor nginx sudo net-tools zenity xz-utils \
dbus-x11 x11-utils alsa-utils \
mesa-utils libgl1-mesa-dri \
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
xvfb x11vnc=0.9.16-3 \
vim-tiny ttf-ubuntu-font-family ttf-wqy-zenhei \
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \
&& apt-get autoclean -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# tini for subreap
RUN curl https://github.com/krallin/tini/releases/download/v0.19.0/tini -o /bin/tini \
&& chmod +x /bin/tini
# ffmpeg
RUN apt update \
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
ffmpeg \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /usr/local/ffmpeg \
&& ln -s /usr/bin/ffmpeg /usr/local/ffmpeg/ffmpeg
# python library
RUN wget https://raw.githubusercontent.com/tccoin/docker-ubuntu-vnc-desktop/develop/rootfs/usr/local/lib/web/backend/requirements.txt \
-O /tmp/requirements.txt \
&& apt-get update \
&& dpkg-query -W -f='${Package}\n' > /tmp/a.txt \
&& apt-get install -y python3-pip python3-dev build-essential \
&& pip3 install setuptools wheel && pip3 install -r /tmp/requirements.txt \
&& dpkg-query -W -f='${Package}\n' > /tmp/b.txt \
&& apt-get remove -y `diff --changed-group-format='%>' --unchanged-group-format='' /tmp/a.txt /tmp/b.txt | xargs` \
&& apt-get autoclean -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/* /tmp/a.txt /tmp/b.txt
###################
# builder
###################
FROM ubuntu:focal as builder
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates gnupg patch git
# nodejs
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y nodejs
# yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn
# build frontend
RUN git clone --recursive https://github.com/tccoin/docker-ubuntu-vnc-desktop /src/docker-ubuntu-vnc-desktop \
&& cp -r /src/docker-ubuntu-vnc-desktop/web /src/web
RUN cd /src/web \
&& yarn \
&& yarn build
RUN sed -i 's#app/locale/#novnc/app/locale/#' /src/web/dist/static/novnc/app/ui.js
# ###################
# # merge
# ###################
FROM system
COPY --from=builder /src/web/dist/ /usr/local/lib/web/frontend/
COPY --from=builder /src/docker-ubuntu-vnc-desktop/rootfs/ /
RUN ln -sf /usr/local/lib/web/frontend/static/websockify /usr/local/lib/web/frontend/static/novnc/utils/websockify \
&& chmod +x /usr/local/lib/web/frontend/static/websockify/run \
&& ln -s /usr/bin/python3 /usr/bin/python
EXPOSE 80
# ################################################################################
# # Development Tools
# ################################################################################
WORKDIR /root/ws
ENV HOME=/root
RUN echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list
RUN apt-key adv --keyserver "hkp://ha.pool.sks-keyservers.net" --recv-key "0xB01FA116" \
|| { wget "https://raw.githubusercontent.com/ros/rosdistro/master/ros.key" -O - | sudo apt-key add -; }
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list' \
&& apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# install build dependency
RUN sed -i "/^# deb.*multiverse/ s/^# //" /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
apt-utils \
wget \
ca-certificates \
git \
sudo \
nano \
less \
ros-${ROS_DISTRO}-ros-base \
ros-${ROS_DISTRO}-catkin \
ros-${ROS_DISTRO}-rosbridge-suite \
build-essential \
ros-${ROS_DISTRO}-catkin \
python3-colcon-common-extensions \
python3-catkin-tools \
python3-osrf-pycommon \
python3-rosdep \
python3-wstool\
python3-pip
WORKDIR /root/build
# install tilix
RUN sudo apt-get install -y \
tilix
# install zsh
RUN git clone https://github.com/tccoin/easy-linux.git \
&& cd easy-linux \
&& ./zsh.sh \
&& touch /root/.z
# install gitstatus
# https://github.com/romkatv/gitstatus/releases/tag/v1.3.1
RUN mkdir -p /root/.cache/gitstatus \
&& wget https://github.com/romkatv/gitstatus/releases/download/v1.3.1/gitstatusd-linux-x86_64.tar.gz -O - \
| tar -zx -C /root/.cache/gitstatus/
# ################################################################################
# # Program Dependency
# ################################################################################
SHELL ["/bin/bash", "-l", "-c"]
WORKDIR /root/build
RUN wget https://github.com/tccoin/container-static-files/releases/download/Galaxy_Linux/Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122.tar.gz -O - \
| tar -zx \
&& cd Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122/ \
&& echo '\n' | ./Galaxy_camera.run
RUN wget https://github.com/tccoin/container-static-files/releases/download/Galaxy_Linux/Galaxy_Linux_Python_2.0.2008.9111.tar.gz -O - \
| tar -zx
RUN apt-get install --no-install-recommends -y libusb-dev \
&& git clone https://github.com/tccoin/MYNT-EYE-D-SDK.git mynt-eye-d-sdk \
&& cd mynt-eye-d-sdk \
&& make init \
&& source /opt/ros/noetic/setup.bash \
&& make all
WORKDIR /root
RUN mkdir -p catkin_ws/src \
&& cd catkin_ws \
&& git clone https://github.com/tccoin/galaxy_camera.git src/galaxy_camera \
&& source /opt/ros/noetic/setup.bash \
&& catkin_make
RUN pip3 install numpy 'opencv-python>=3.4,<3.5' 'opencv-contrib-python>=3.4,<3.5' pyserial toolz pyyaml bitstring
RUN cd ~/build/Galaxy_Linux_Python_2.0.2008.9111/api/ \
&& pip3 install .
HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://127.0.0.1:6079/api/health
ENTRYPOINT ["/bin/zsh"]