-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathros_dev.dockerfile
More file actions
62 lines (50 loc) · 2 KB
/
ros_dev.dockerfile
File metadata and controls
62 lines (50 loc) · 2 KB
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
# Dockerfile.ros2
FROM automodality/jetson-isaac2:latest
RUN /usr/bin/python3.8 -m pip install websockets
# Make ssh dir
RUN mkdir /home/ubuntu/.ssh/
# Copy over private key
ADD id_orin131_github /home/ubuntu/.ssh/id_orin131_github
# Elevate privileges temporarily
USER root
# Set keyfile permissions
RUN chmod 700 /home/ubuntu/.ssh/id_orin131_github \
&& touch /home/ubuntu/.ssh/known_hosts \
&& chown -R ubuntu:ubuntu /home/ubuntu/.ssh
# Be user again
USER ubuntu
# Pull relevant code for development:
# Strategy:
# 1. register github auth key and ssh config
# 2. pull repos
# 3. modify existing repos if needed
RUN ssh-keyscan github.com >> /home/ubuntu/.ssh/known_hosts \
&& echo "Host github.com\n HostName github.com\n IdentityFile ~/.ssh/id_orin131_github" >> /home/ubuntu/.ssh/config \
&& eval "$(ssh-agent -s)" \
&& ssh-add /home/ubuntu/.ssh/id_orin131_github \
&& source /home/ubuntu/.bashrc \
&& cd /home/ubuntu/ros2_ws/src \
&& git clone git@github.com:AutoModality/am_autosteer.git -b dev \
&& git clone git@github.com:ros-drivers/joystick_drivers.git -b ros2 \
&& rm -rf am_config \
&& git clone git@github.com:AutoModality/am_config -b GV-3544/jd-config \
&& cd amroscli2 \
&& git remote set-url origin git@github.com:AutoModality/amroscli2.git \
&& git fetch \
&& git checkout ros2 \
&& git pull
WORKDIR /home/ubuntu/ros2_ws
# Install easy dependency packages
RUN source /home/ubuntu/.bashrc && \
source /home/ubuntu/ros2_ws/install/setup.bash && \
colcon build --packages-ignore spacenav wiimote_msgs wiimote
# Install tricky dependency packages (separate stage)
RUN source /home/ubuntu/.bashrc \
&& source /home/ubuntu/ros2_ws/install/setup.bash \
&& colcon build --cmake-clean-cache --cmake-clean-first --packages-select am_config
USER root
# allow colcon build to run without sudo
RUN chown -R ubuntu:ubuntu /home/ubuntu/ros2_ws
COPY ros_entrypoint.sh /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]