-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support Dockerfile #1124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support Dockerfile #1124
Changes from 12 commits
04adcbc
41aa268
70feb3d
1f225cc
ef4bd76
b397010
e0efe4f
d6375b2
b5eec21
585ab3f
d150e90
5131d08
9dd5b5a
62c205c
cc66146
49c96c4
35576be
6f718a8
314b6a4
f0c3465
e0d05e1
5fd48d2
c1cae49
a37b7e3
e8d5765
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Use the base ROS2 humble image | ||
| FROM ros:humble-ros-base | ||
|
|
||
| # Set environment variables | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| ENV COLCON_WS=/root/turtlebot3_ws | ||
|
|
||
| # Install the required packages in a single layer and clean up afterwards | ||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| ros-${ROS_DISTRO}-desktop \ | ||
| python3-colcon-common-extensions \ | ||
| git \ | ||
| nano \ | ||
| ros-${ROS_DISTRO}-cartographer \ | ||
| ros-${ROS_DISTRO}-cartographer-ros \ | ||
| ros-${ROS_DISTRO}-navigation2 \ | ||
| ros-${ROS_DISTRO}-nav2-bringup \ | ||
| ros-${ROS_DISTRO}-turtlebot3-msgs \ | ||
| ros-${ROS_DISTRO}-dynamixel-sdk \ | ||
| ros-${ROS_DISTRO}-xacro \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR ${COLCON_WS} | ||
|
|
||
| RUN mkdir -p ${COLCON_WS}/src && \ | ||
| cd ${COLCON_WS}/src && \ | ||
| git clone -b humble https://github.com/ROBOTIS-GIT/turtlebot3.git | ||
|
|
||
| RUN bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && \ | ||
| cd ${COLCON_WS} && \ | ||
| colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release" | ||
|
|
||
| RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc && \ | ||
| echo "source ${COLCON_WS}/install/setup.bash" >> ~/.bashrc && \ | ||
| echo "alias cb='colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release'" >> ~/.bashrc && \ | ||
| echo "export ROS_DOMAIN_ID=30 # TURTLEBOT3" >> ~/.bashrc && \ | ||
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | ||
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc | ||
|
||
|
|
||
| CMD ["bash"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| services: | ||
| turtlebot3: | ||
| container_name: turtlebot3 | ||
| image: robotis/turtlebot3:humble-pc-latest | ||
| # build: | ||
| # context: . | ||
| # dockerfile: Dockerfile.pc | ||
| tty: true | ||
| restart: unless-stopped | ||
| cap_add: | ||
| - SYS_NICE | ||
| ulimits: | ||
| rtprio: 99 | ||
| rttime: -1 | ||
| memlock: 8428281856 | ||
| network_mode: host | ||
| ipc: host | ||
| pid: host | ||
| environment: | ||
| - DISPLAY=${DISPLAY} | ||
| - QT_X11_NO_MITSHM=1 | ||
| volumes: | ||
| - /dev:/dev | ||
| - /dev/shm:/dev/shm | ||
| - /tmp/.X11-unix:/tmp/.X11-unix:rw | ||
| - /tmp/.docker.xauth:/tmp/.docker.xauth:rw | ||
| - ./workspace:/workspace | ||
| - ../../../:/root/turtlebot3_ws/src/turtlebot3 | ||
| privileged: true | ||
| command: bash |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Use the base ROS2 humble image | ||
| FROM ros:humble-ros-base | ||
|
|
||
| # Set environment variables | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| ENV COLCON_WS=/root/turtlebot3_ws | ||
|
|
||
| # Install the required packages in a single layer and clean up afterwards | ||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| python3-argcomplete \ | ||
| python3-colcon-common-extensions \ | ||
| libboost-system-dev \ | ||
| build-essential \ | ||
| libudev-dev \ | ||
| udev \ | ||
| git \ | ||
| nano \ | ||
| ros-${ROS_DISTRO}-turtlebot3-msgs \ | ||
| ros-${ROS_DISTRO}-dynamixel-sdk \ | ||
| ros-${ROS_DISTRO}-xacro \ | ||
| ros-${ROS_DISTRO}-hls-lfcd-lds-driver \ | ||
| ros-${ROS_DISTRO}-ld08-driver \ | ||
| ros-${ROS_DISTRO}-coin-d4-driver \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR ${COLCON_WS} | ||
|
|
||
| RUN mkdir -p ${COLCON_WS}/src && \ | ||
| cd ${COLCON_WS}/src && \ | ||
| git clone -b humble https://github.com/ROBOTIS-GIT/turtlebot3.git | ||
|
|
||
| RUN cd ${COLCON_WS}/src/turtlebot3 && \ | ||
| rm -rf turtlebot3_cartographer turtlebot3_navigation2 | ||
|
||
|
|
||
| RUN bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && \ | ||
| cd ${COLCON_WS} && \ | ||
| colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release" | ||
|
|
||
| RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc && \ | ||
| echo "source ${COLCON_WS}/install/setup.bash" >> ~/.bashrc && \ | ||
| echo "alias cb='colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release'" >> ~/.bashrc && \ | ||
| echo "export ROS_DOMAIN_ID=30 # TURTLEBOT3" >> ~/.bashrc && \ | ||
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | ||
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc | ||
GyuH13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| CMD ["bash"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| services: | ||
| turtlebot3: | ||
| container_name: turtlebot3 | ||
| image: robotis/turtlebot3:humble-sbc-latest | ||
| # build: | ||
| # context: . | ||
| # dockerfile: Dockerfile.sbc | ||
| tty: true | ||
| restart: unless-stopped | ||
| cap_add: | ||
| - SYS_NICE | ||
| ulimits: | ||
| rtprio: 99 | ||
| rttime: -1 | ||
| memlock: 8428281856 | ||
| network_mode: host | ||
| ipc: host | ||
| pid: host | ||
| environment: | ||
| - DISPLAY=${DISPLAY} | ||
| - QT_X11_NO_MITSHM=1 | ||
| volumes: | ||
| - /dev:/dev | ||
| - /dev/shm:/dev/shm | ||
| - /tmp/.X11-unix:/tmp/.X11-unix:rw | ||
| - /tmp/.docker.xauth:/tmp/.docker.xauth:rw | ||
| - ./workspace:/workspace | ||
| - ../../../:/root/turtlebot3_ws/src/turtlebot3 | ||
| privileged: true | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
| command: bash | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,41 @@ | ||||||||||
| # Use the base ROS2 jazzy image | ||||||||||
| FROM ros:jazzy-ros-base | ||||||||||
|
|
||||||||||
| # Set environment variables | ||||||||||
| ENV DEBIAN_FRONTEND=noninteractive | ||||||||||
| ENV COLCON_WS=/root/turtlebot3_ws | ||||||||||
|
|
||||||||||
| # Install the required packages in a single layer and clean up afterwards | ||||||||||
| RUN apt-get update && \ | ||||||||||
| apt-get install -y --no-install-recommends \ | ||||||||||
| ros-${ROS_DISTRO}-desktop \ | ||||||||||
| python3-colcon-common-extensions \ | ||||||||||
| git \ | ||||||||||
| nano \ | ||||||||||
| ros-${ROS_DISTRO}-cartographer \ | ||||||||||
| ros-${ROS_DISTRO}-cartographer-ros \ | ||||||||||
| ros-${ROS_DISTRO}-navigation2 \ | ||||||||||
| ros-${ROS_DISTRO}-nav2-bringup \ | ||||||||||
| ros-${ROS_DISTRO}-turtlebot3-msgs \ | ||||||||||
| ros-${ROS_DISTRO}-dynamixel-sdk \ | ||||||||||
| ros-${ROS_DISTRO}-xacro \ | ||||||||||
| && rm -rf /var/lib/apt/lists/* | ||||||||||
|
|
||||||||||
| WORKDIR ${COLCON_WS} | ||||||||||
|
|
||||||||||
| RUN mkdir -p ${COLCON_WS}/src && \ | ||||||||||
| cd ${COLCON_WS}/src && \ | ||||||||||
| git clone -b jazzy https://github.com/ROBOTIS-GIT/turtlebot3.git | ||||||||||
|
|
||||||||||
| RUN bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && \ | ||||||||||
| cd ${COLCON_WS} && \ | ||||||||||
| colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release" | ||||||||||
|
|
||||||||||
| RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc && \ | ||||||||||
| echo "source ${COLCON_WS}/install/setup.bash" >> ~/.bashrc && \ | ||||||||||
| echo "alias cb='colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release'" >> ~/.bashrc && \ | ||||||||||
| echo "export ROS_DOMAIN_ID=30 # TURTLEBOT3" >> ~/.bashrc && \ | ||||||||||
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | ||||||||||
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc | ||||||||||
|
||||||||||
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | |
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc | |
| echo "export TURTLEBOT3_MODEL=burger # burger, waffle, waffle_pi" >> ~/.bashrc && \ | |
| echo "export LDS_MODEL=LDS-01 # LDS-01, LDS-02, LDS-03" >> ~/.bashrc |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting TURTLEBOT3_MODEL and LDS_MODEL with empty values can lead to runtime errors if scripts expect them to be set. It's more robust and user-friendly to provide sensible defaults. Users can still override them if needed.
echo "export TURTLEBOT3_MODEL=burger # burger, waffle, waffle_pi" >> ~/.bashrc && \
echo "export LDS_MODEL=LDS-01 # LDS-01, LDS-02, LDS-03" >> ~/.bashrc
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,30 @@ | ||
| services: | ||
| ros2: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| turtlebot3: | ||
| container_name: turtlebot3 | ||
| image: robotis/turtlebot3:jazzy-pc-latest | ||
| # build: | ||
| # context: . | ||
| # dockerfile: Dockerfile.pc | ||
| tty: true | ||
| restart: always | ||
| restart: unless-stopped | ||
| cap_add: | ||
| - SYS_NICE | ||
| ulimits: | ||
| rtprio: 99 | ||
| rttime: -1 | ||
| memlock: 8428281856 | ||
| network_mode: host | ||
| ipc: host | ||
| pid: host | ||
| environment: | ||
| - DISPLAY=${DISPLAY} | ||
| - QT_X11_NO_MITSHM=1 | ||
| - ROS_DOMAIN_ID=30 | ||
| volumes: | ||
| - /dev:/dev | ||
| - ./workspace:/workspace | ||
| - /dev/shm:/dev/shm | ||
| - /tmp/.X11-unix:/tmp/.X11-unix:rw | ||
| - /tmp/.docker.xauth:/tmp/.docker.xauth:rw | ||
| - ./workspace:/workspace | ||
| - ../../../:/root/turtlebot3_ws/src/turtlebot3 | ||
| privileged: true | ||
| command: bash |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Use the base ROS2 jazzy image | ||
| FROM ros:jazzy-ros-base | ||
|
|
||
| # Set environment variables | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| ENV COLCON_WS=/root/turtlebot3_ws | ||
|
|
||
| # Install the required packages in a single layer and clean up afterwards | ||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| python3-argcomplete \ | ||
| python3-colcon-common-extensions \ | ||
| libboost-system-dev \ | ||
| build-essential \ | ||
| libudev-dev \ | ||
| udev \ | ||
| git \ | ||
| nano \ | ||
| ros-${ROS_DISTRO}-turtlebot3-msgs \ | ||
| ros-${ROS_DISTRO}-dynamixel-sdk \ | ||
| ros-${ROS_DISTRO}-xacro \ | ||
| ros-${ROS_DISTRO}-hls-lfcd-lds-driver \ | ||
| ros-${ROS_DISTRO}-ld08-driver \ | ||
| ros-${ROS_DISTRO}-coin-d4-driver \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR ${COLCON_WS} | ||
|
|
||
| RUN mkdir -p ${COLCON_WS}/src && \ | ||
| cd ${COLCON_WS}/src && \ | ||
| git clone -b jazzy https://github.com/ROBOTIS-GIT/turtlebot3.git | ||
|
|
||
| RUN cd ${COLCON_WS}/src/turtlebot3 && \ | ||
| rm -rf turtlebot3_cartographer turtlebot3_navigation2 | ||
|
||
|
|
||
| RUN bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && \ | ||
| cd ${COLCON_WS} && \ | ||
| colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release" | ||
|
|
||
| RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc && \ | ||
| echo "source ${COLCON_WS}/install/setup.bash" >> ~/.bashrc && \ | ||
| echo "alias cb='colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release'" >> ~/.bashrc && \ | ||
| echo "export ROS_DOMAIN_ID=30 # TURTLEBOT3" >> ~/.bashrc && \ | ||
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | ||
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc | ||
GyuH13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| CMD ["bash"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| services: | ||
| turtlebot3: | ||
| container_name: turtlebot3 | ||
| image: robotis/turtlebot3:jazzy-sbc-latest | ||
| # build: | ||
| # context: . | ||
| # dockerfile: Dockerfile.sbc | ||
| tty: true | ||
| restart: unless-stopped | ||
| cap_add: | ||
| - SYS_NICE | ||
| ulimits: | ||
| rtprio: 99 | ||
| rttime: -1 | ||
| memlock: 8428281856 | ||
| network_mode: host | ||
| ipc: host | ||
| pid: host | ||
| environment: | ||
| - DISPLAY=${DISPLAY} | ||
| - QT_X11_NO_MITSHM=1 | ||
| volumes: | ||
| - /dev:/dev | ||
| - /dev/shm:/dev/shm | ||
| - /tmp/.X11-unix:/tmp/.X11-unix:rw | ||
| - /tmp/.docker.xauth:/tmp/.docker.xauth:rw | ||
| - ./workspace:/workspace | ||
| - ../../../:/root/turtlebot3_ws/src/turtlebot3 | ||
| privileged: true | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
| command: bash | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variables TURTLEBOT3_MODEL and LDS_MODEL are exported with empty values. This requires users to manually edit ~/.bashrc after container startup. Consider either removing these exports or providing sensible defaults (e.g., 'burger' for TURTLEBOT3_MODEL and 'LDS-01' for LDS_MODEL) to improve the out-of-box experience.