-
Notifications
You must be signed in to change notification settings - Fork 60
/
Dockerfile
126 lines (108 loc) · 4.63 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
# Copyright 2020-2024 Tiryoh<tiryoh@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This Dockerfile is based on https://github.com/AtsushiSaito/docker-ubuntu-sweb
# which is released under the Apache-2.0 license.
FROM ubuntu:focal-20241011
ARG TARGETPLATFORM
LABEL maintainer="Tiryoh<tiryoh@gmail.com>"
SHELL ["/bin/bash", "-c"]
# Upgrade OS
RUN apt-get update -q && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Install Ubuntu Mate desktop
RUN apt-get update -q && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ubuntu-mate-desktop && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Add Package
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
tigervnc-standalone-server tigervnc-common \
supervisor wget curl gosu git sudo python3-pip tini \
build-essential vim sudo lsb-release locales \
bash-completion tzdata terminator && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# noVNC and Websockify
RUN git clone https://github.com/AtsushiSaito/noVNC.git -b add_clipboard_support /usr/lib/novnc
RUN pip install --no-cache-dir git+https://github.com/novnc/websockify.git@v0.10.0
RUN ln -s /usr/lib/novnc/vnc.html /usr/lib/novnc/index.html
# Set remote resize function enabled by default
RUN sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'remote');/g" /usr/lib/novnc/app/ui.js
# Disable auto update and crash report
RUN sed -i 's/Prompt=.*/Prompt=never/' /etc/update-manager/release-upgrades
RUN sed -i 's/enabled=1/enabled=0/g' /etc/default/apport
# Install Firefox
RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:mozillateam/ppa -y && \
echo 'Package: *' > /etc/apt/preferences.d/mozilla-firefox && \
echo 'Pin: release o=LP-PPA-mozillateam' >> /etc/apt/preferences.d/mozilla-firefox && \
echo 'Pin-Priority: 1001' >> /etc/apt/preferences.d/mozilla-firefox && \
apt-get update -q && \
apt-get install -y --allow-downgrades \
firefox && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Install VSCodium
RUN wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \
-O /usr/share/keyrings/vscodium-archive-keyring.asc && \
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.asc ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' \
| tee /etc/apt/sources.list.d/vscodium.list && \
apt-get update -q && \
apt-get install -y codium && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Install ROS
ENV ROS_DISTRO noetic
# desktop or ros-base
ARG INSTALL_PACKAGE=desktop
RUN apt-get update -q && \
apt-get install -y curl gnupg2 lsb-release && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros.list > /dev/null && \
apt-get update -q && \
apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE} \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
python3-catkin-tools \
python3-osrf-pycommon \
python3-argcomplete \
python3-rosdep python3-vcstool && \
rosdep init && \
rm -rf /var/lib/apt/lists/*
RUN rosdep update
# Gazebo packages for arm64 are not maintained.
# http://repositories.ros.org/status_page/ros_noetic_dbv8.html?q=ign
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
apt-get update -q && \
apt-get install -y \
ros-${ROS_DISTRO}-gazebo-ros-pkgs \
ros-${ROS_DISTRO}-ros-ign-gazebo && \
rm -rf /var/lib/apt/lists/*; \
fi
# Enable apt-get completion after running `apt-get update` in the container
RUN rm /etc/apt/apt.conf.d/docker-clean
COPY ./entrypoint.sh /
ENTRYPOINT [ "/bin/bash", "-c", "/entrypoint.sh" ]
ENV USER ubuntu
ENV PASSWD ubuntu