-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile
39 lines (30 loc) · 970 Bytes
/
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
FROM ros:jazzy
ARG USERNAME=openmower
ARG USER_UID=1001
ARG USER_GID=$USER_UID
ARG WORKSPACE=/opt/ws
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& yes $USERNAME | passwd $USERNAME \
&& usermod --shell /bin/bash $USERNAME \
&& usermod -aG dialout $USERNAME
RUN ( \
echo "source /opt/ros/${ROS_DISTRO}/setup.bash"; \
echo "source ${WORKSPACE}/install/local_setup.bash"; \
) >> /home/$USERNAME/.bashrc
SHELL ["/bin/bash", "-c"]
RUN mkdir -p $WORKSPACE
COPY . $WORKSPACE
RUN source /opt/ros/${ROS_DISTRO}/setup.bash \
&& cd $WORKSPACE \
&& sudo apt-get update \
&& rosdep update \
&& make custom-deps deps
RUN source /opt/ros/${ROS_DISTRO}/setup.bash && \
cd $WORKSPACE && \
make build-libs build
RUN chown -R $USERNAME:$USERNAME $WORKSPACE
USER $USERNAME
WORKDIR $WORKSPACE
ENV SHELL /bin/bash
CMD ["bash", "-c", "ros2 launch openmower openmower.launch.py"]