mirror of
https://github.com/bjoernellens1/ros2_docker_template.git
synced 2024-11-23 15:55:05 +00:00
Update my_example.Dockerfile
This commit is contained in:
parent
a559172718
commit
1ab63a12d4
@ -1,9 +1,40 @@
|
||||
# explicitly use Debian for maximum cross-architecture compatibility
|
||||
FROM debian:bullseye-slim AS hello-world
|
||||
ARG ROS_DISTRO=humble
|
||||
ARG UNDERLAY_WS=/rmp_ws
|
||||
|
||||
WORKDIR /APP
|
||||
########################################
|
||||
# Custom ROS2 Base Image #
|
||||
########################################
|
||||
|
||||
COPY ./docker .
|
||||
RUN chmod +x hello.sh
|
||||
FROM osrf/ros:${ROS_DISTRO}-desktop as base
|
||||
#ENV ROS_DISTRO=${ROS_DISTRO}
|
||||
|
||||
CMD ["/APP/hello.sh"]
|
||||
SHELL ["/bin/bash", "-c"] # change shell to bash because of better compatibility (standard shell would be sh otherwise).
|
||||
|
||||
# Create Colcon workspace with external dependencies
|
||||
RUN mkdir -p /${UNDERLAY_WS}/src
|
||||
WORKDIR /${UNDERLAY_WS}/src
|
||||
COPY my.repos .
|
||||
RUN mv my.repos dependencies.repos
|
||||
RUN vcs import < dependencies.repos
|
||||
|
||||
# Build the base Colcon workspace, installing dependencies first.
|
||||
WORKDIR ${UNDERLAY_WS}
|
||||
RUN source /opt/ros/${ROS_DISTRO}/setup.bash \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ros-${ROS_DISTRO}-turtlesim \
|
||||
ros-${ROS_DISTRO}-rqt \
|
||||
&& rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y
|
||||
RUN source /opt/ros/${ROS_DISTRO}/setup.bash \
|
||||
&& colcon build --symlink-install
|
||||
|
||||
#ENV UNDERLAY_WS=${UNDERLAY_WS}
|
||||
|
||||
# Set up the entrypoint
|
||||
COPY ./docker/my_entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# Update repository at the end of this build stage
|
||||
RUN vcs pull src
|
||||
|
||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
||||
|
Loading…
Reference in New Issue
Block a user