Skip to content

Commit f9bbd7d

Browse files
author
h3ct0r
committed
fixed paths
1 parent 0189ecb commit f9bbd7d

4 files changed

Lines changed: 51 additions & 86 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"remoteUser": "ubuntu",
66
"service": "ros1",
77
"dockerComposeFile": [
8-
"../compose_macos_host.yaml"
8+
"../compose_linux_host.yaml"
99
],
1010
"waitFor": "postCreateCommand",
1111
"workspaceFolder": "/home/ubuntu",

docker/Dockerfile.amd64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ RUN curl -fOL https://github.com/coder/code-server/releases/download/v4.104.2/c
1010
rm code-server_4.104.2_amd64.deb
1111

1212
INCLUDE+ docker/Dockerfile.user.common
13-
INCLUDE+ docker/Dockerfile.user.common
13+
INCLUDE+ docker/Dockerfile.entrypoint.common
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
ENTRYPOINT [ "docker/entrypoint.sh" ]
1+
RUN sudo chown -R ubuntu:ubuntu /home/ubuntu
2+
3+
ENTRYPOINT [ "/entrypoint.sh" ]
24
CMD [ "sudo", "-E", "/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

docker/Dockerfile.root.common

Lines changed: 46 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,17 @@ RUN usermod -aG sudo ubuntu
2424
RUN apt-get install -y \
2525
xfce4 \
2626
xfce4-goodies \
27+
tigervnc-standalone-server \
28+
tigervnc-common \
29+
gosu \
2730
supervisor
2831

29-
# Install additonal packages
32+
# Install required additonal packages
3033
RUN apt-get install -y \
34+
less \
3135
python3-pip \
3236
python-is-python3 \
33-
python3-catkin-tools \
34-
jq \
35-
ssh \
36-
neovim \
37-
git \
3837
build-essential \
39-
git python3-colcon-common-extensions \
40-
python3-colcon-mixin \
41-
python3-rosdep \
42-
python3-vcstool \
43-
wget \
4438
nano \
4539
vim \
4640
iputils-ping \
@@ -49,53 +43,28 @@ RUN apt-get install -y \
4943
mesa-utils \
5044
libompl-dev \
5145
ompl-demos \
52-
terminator \
5346
tmux \
5447
dbus-x11 \
5548
tree \
56-
curl \
57-
nmap \
58-
tigervnc-standalone-server \
59-
tigervnc-common \
60-
supervisor \
6149
wget \
6250
curl \
63-
gosu \
6451
git \
65-
sudo \
66-
python3-pip \
67-
tini \
6852
lsb-release \
6953
locales \
70-
bash-completion \
7154
tzdata \
7255
terminator \
73-
openssh-server
74-
75-
# Install OpenSSH Server and necessary tools
76-
# Set root password (replace 'your_password' with a strong password)
77-
# Allow root login (optional, but simplifies initial setup)
78-
RUN mkdir /var/run/sshd
79-
RUN echo 'ubuntu:ubuntu' | chpasswd
80-
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
81-
82-
# noVNC and Websockify
83-
RUN git clone https://github.com/AtsushiSaito/noVNC.git -b add_clipboard_support /usr/lib/novnc
84-
RUN pip install --no-cache-dir git+https://github.com/novnc/websockify.git@v0.10.0
85-
RUN ln -s /usr/lib/novnc/vnc.html /usr/lib/novnc/index.html
86-
87-
# Set remote resize function enabled by default
88-
RUN sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'remote');/g" /usr/lib/novnc/app/ui.js
89-
90-
# Disable crash report
91-
RUN sed -i 's/enabled=1/enabled=0/g' /etc/default/apport
56+
ssh \
57+
openssh-server \
58+
libsecret-1-dev \
59+
gnupg2 \
60+
firefox
9261

9362
# install ros packages (fix broken key)
9463
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" \
9564
> /etc/apt/sources.list.d/ros-latest.list' && \
9665
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add - && \
9766
apt update && \
98-
apt install -y python3-catkin-tools \
67+
apt install -y \
9968
ros-noetic-desktop-full \
10069
ros-noetic-velodyne \
10170
ros-noetic-velodyne-description \
@@ -109,34 +78,47 @@ RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main"
10978
ros-noetic-realsense2-camera \
11079
ros-noetic-realsense2-description \
11180
ros-noetic-gazebo-plugins \
112-
python3-rosinstall \
113-
python3-rosinstall-generator \
114-
python3-wstool \
11581
python3-catkin-tools \
116-
python3-osrf-pycommon \
117-
python3-argcomplete \
118-
python3-rosdep python3-vcstool \
119-
gnupg2 lsb-release \
82+
python3-rosdep \
83+
python3-vcstool \
12084
python3-rosinstall \
12185
python3-rosinstall-generator \
12286
python3-wstool \
123-
python3-catkin-tools \
12487
python3-osrf-pycommon \
125-
python3-argcomplete \
126-
python3-rosdep python3-vcstool
88+
python3-argcomplete
12789

128-
# install depending packages
129-
RUN apt-get install -y bash-completion \
130-
less \
131-
wget \
132-
language-pack-en \
133-
vim-tiny \
134-
iputils-ping \
135-
net-tools \
136-
imagemagick \
137-
python-dev \
138-
libsecret-1-dev \
139-
firefox
90+
# copy files from host to container
91+
COPY configs/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
92+
COPY configs/supervisord/custom_programs.conf /etc/supervisor/conf.d/custom_programs.conf
93+
COPY configs/supervisord/code_server.conf /etc/supervisor/conf.d/code_server.conf
94+
COPY configs/xfce4_defaults /usr/share/xfwm4/defaults
95+
96+
COPY docker/entrypoint.sh /entrypoint.sh
97+
RUN chmod +x /entrypoint.sh
98+
COPY .devcontainer/onCreate.sh /onCreate.sh
99+
RUN chmod +x /onCreate.sh
100+
COPY .devcontainer/postCreate.sh /postCreate.sh
101+
RUN chmod +x /postCreate.sh
102+
COPY .devcontainer/postAttach.sh /postAttach.sh
103+
RUN chmod +x /postAttach.sh
104+
105+
# Install OpenSSH Server and necessary tools
106+
# Set root password (replace 'your_password' with a strong password)
107+
# Allow root login (optional, but simplifies initial setup)
108+
RUN mkdir /var/run/sshd
109+
RUN echo 'ubuntu:ubuntu' | chpasswd
110+
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
111+
112+
# noVNC and Websockify
113+
RUN git clone https://github.com/AtsushiSaito/noVNC.git -b add_clipboard_support /usr/lib/novnc
114+
RUN pip install --no-cache-dir git+https://github.com/novnc/websockify.git@v0.10.0
115+
RUN ln -s /usr/lib/novnc/vnc.html /usr/lib/novnc/index.html
116+
117+
# Set remote resize function enabled by default
118+
RUN sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'remote');/g" /usr/lib/novnc/app/ui.js
119+
120+
# Disable crash report
121+
RUN sed -i 's/enabled=1/enabled=0/g' /etc/default/apport
140122

141123
# colorize less
142124
RUN lesspipe >> ~/.bashrc && \
@@ -147,7 +129,6 @@ RUN lesspipe >> ~/.bashrc && \
147129

148130
# prepare vscode and home
149131
ADD .devcontainer/.vscode /home/ubuntu/.vscode
150-
RUN sudo chown -R ubuntu:ubuntu /home/ubuntu
151132

152133
# Source ROS environment automatically
153134
RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> /home/$USERNAME/.bashrc
@@ -162,24 +143,6 @@ RUN rm -rf /var/lib/apt/lists/*
162143
# Enable apt-get completion after running `apt-get update` in the container
163144
RUN rm /etc/apt/apt.conf.d/docker-clean
164145

165-
COPY configs/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
166-
COPY configs/supervisord/custom_programs.conf /etc/supervisor/conf.d/custom_programs.conf
167-
COPY configs/supervisord/code_server.conf /etc/supervisor/conf.d/code_server.conf
168-
169-
COPY configs/xfce4_defaults /usr/share/xfwm4/defaults
170-
171-
COPY docker/entrypoint.sh /entrypoint.sh
172-
RUN chmod +x /entrypoint.sh
173-
174-
COPY .devcontainer/onCreate.sh /onCreate.sh
175-
RUN chmod +x /onCreate.sh
176-
177-
COPY .devcontainer/postCreate.sh /postCreate.sh
178-
RUN chmod +x /postCreate.sh
179-
180-
COPY .devcontainer/postAttach.sh /postAttach.sh
181-
RUN chmod +x /postAttach.sh
182-
183146
# prepare VNC
184147
RUN mkdir -p "/home/ubuntu/.vnc"
185148
RUN echo "$PASSWD" | vncpasswd -f > "/home/ubuntu/.vnc/passwd"

0 commit comments

Comments
 (0)