-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdev.dockerfile
62 lines (50 loc) · 1.75 KB
/
dev.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
FROM osrf/ros:galactic-desktop-focal
MAINTAINER Kevin DeMarco
ENV DEBIAN_FRONTEND noninteractive
SHELL ["/bin/bash", "-c"]
RUN apt-get update \
&& apt-get install -y \
ros-galactic-gazebo-ros \
&& rm -rf /var/lib/apt/lists/*
# Create the "ros" user, add user to sudo group
ENV USERNAME ros
RUN adduser --disabled-password --gecos '' $USERNAME \
&& usermod --uid 1000 $USERNAME \
&& groupmod --gid 1000 $USERNAME \
&& usermod --shell /bin/bash $USERNAME \
&& adduser $USERNAME sudo \
&& adduser $USERNAME dialout \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# # Build and install librealsense
# RUN mkdir -p /repos/3rd-party \
# && cd /repos/3rd-party \
# && git clone https://github.com/IntelRealSense/librealsense.git \
# && mkdir -p ./librealsense/build \
# && cd librealsense/build \
# && cmake .. \
# && make -j4 \
# && make install
# # librealsense dependencies?
# RUN apt-get update \
# && apt-get install -y \
# libglfw3-dev \
# libgl1-mesa-dev \
# libglu1-mesa-dev \
# && rm -rf /var/lib/apt/lists/*
USER $USERNAME
RUN mkdir -p /home/$USERNAME/workspace/src
WORKDIR /home/$USERNAME/workspace
# Copy code in
COPY --chown=ros ./src ./src
# Install code dependencies
RUN mkdir -p /home/$USERNAME/.ros \
&& sudo apt-get update \
&& rosdep update \
&& sudo rosdep install --from-paths src --ignore-src -r -y --rosdistro=galactic
# Build code
RUN source /opt/ros/galactic/setup.bash \
&& colcon build --symlink-install
# Setup .bashrc environment
RUN echo 'source ~/workspace/install/setup.bash' >> /home/$USERNAME/.bashrc \
&& echo 'source /usr/share/gazebo/setup.sh' >> /home/$USERNAME/.bashrc \
&& mkdir -p /home/$USERNAME/workspace/src