-
Notifications
You must be signed in to change notification settings - Fork 42
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 #150 from Nicolai-98/dev-humble-docker
#149 Added Dockerfile and scripts. Updated README. thank you @Nicolai-98 for doing this so quickly!
- Loading branch information
Showing
5 changed files
with
58 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
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,26 @@ | ||
FROM ros:humble-ros-base-jammy | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
RUN apt update -y | ||
RUN apt install vim python-is-python3 python3-pip python3-colcon-common-extensions -y | ||
RUN pip3 install scipy numpy | ||
# create workspace and build package | ||
# source workspace | ||
RUN source /opt/ros/humble/setup.bash && echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc | ||
|
||
# create workspace | ||
RUN mkdir -p home/ros2_ws/src | ||
WORKDIR /home/ros2_ws/ | ||
|
||
COPY ./src /home/ros2_ws/src | ||
RUN rosdep install -i --from-path src --rosdistro humble -y | ||
|
||
# "--symlink-install" allows the code in the locally mounted volume ./src to be adjusted without rebuilding | ||
RUN source /opt/ros/humble/setup.bash && colcon build --symlink-install | ||
|
||
# source overlay workspace | ||
RUN source /home/ros2_ws/install/setup.bash && echo "source /home/ros2_ws/install/setup.bash" >> ~/.bashrc | ||
CMD ["/bin/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,19 @@ | ||
# dont forget to chmod +x container_build.sh | ||
xhost + | ||
|
||
docker rm lbr_stack_container | ||
|
||
docker build -t lbr_stack_container . | ||
|
||
docker run -it \ | ||
--network host \ | ||
--ipc host \ | ||
--volume ./src:/home/ros2_ws/src \ | ||
--volume /tmp/.X11-unix:/tmp/.X11-unix \ | ||
--volume /dev/shm:/dev/shm \ | ||
--volume /dev:/dev --privileged \ | ||
--env DISPLAY \ | ||
--env QT_X11_NO_MITSHM=1 \ | ||
--name lbr_stack_container \ | ||
lbr_stack_container | ||
|
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,2 @@ | ||
# dont forget to chmod +x container_new_console.sh | ||
docker exec -it lbr_stack_container 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,5 @@ | ||
# dont forget to chmod +x container_new_console.sh | ||
xhost + | ||
|
||
docker start lbr_stack_container -i | ||
|