-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from avcuenes/docker_file
add docker and makefile
- Loading branch information
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Use the official ROS 2 humble base image | ||
ARG ROS_DISTRO=humble | ||
FROM ros:${ROS_DISTRO} as deps | ||
|
||
# Set the working directory | ||
WORKDIR /root/ros2_ws | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
RUN source /opt/ros/${ROS_DISTRO}/setup.bash | ||
RUN apt-get update \ | ||
&& apt-get -y --quiet --no-install-recommends install \ | ||
gcc \ | ||
git \ | ||
python3 \ | ||
python3-pip | ||
|
||
COPY . /root/ros2_ws/src | ||
RUN rosdep install --from-paths src --ignore-src -r -y | ||
|
||
WORKDIR /root/ros2_ws/src | ||
|
||
RUN pip3 install -r requirements.txt | ||
# Run a default command, e.g., starting a bash shell | ||
CMD ["bash"] | ||
|
||
WORKDIR /root/ros2_ws | ||
FROM deps as builder | ||
ARG CMAKE_BUILD_TYPE=Release | ||
|
||
RUN source /opt/ros/${ROS_DISTRO}/setup.bash | ||
RUN source /opt/ros/${ROS_DISTRO}/setup.bash && \ | ||
colcon build | ||
|
||
# Source the ROS2 setup file | ||
RUN echo "source /root/ros2_ws/install/setup.bash" >> ~/.bashrc | ||
|
||
# Run a default command, e.g., starting a bash shell | ||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.PHONY : docker_build | ||
docker_build: | ||
docker build -t yasmin . | ||
|
||
.PHONY : docker_run | ||
docker_run: | ||
docker run -it --net=host --ipc=host --privileged --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --volume="${XAUTHORITY}:/root/.Xauthority" --entrypoint /bin/bash yasmin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters