cps_ros_builder/dockerfile.amd64

71 lines
2.3 KiB
Plaintext
Raw Normal View History

2023-04-13 10:39:14 +00:00
#FROM --platform=$BUILDPLATFORM ros:foxy AS build
#FROM ros:foxy AS build
#WORKDIR /my_ws
#SHELL ["/bin/bash", "-c"]
#RUN source /opt/ros/foxy/setup.bash
#RUN mkdir src
#WORKDIR /my_ws/src
#RUN git clone https://github.com/bjoernellens1/segway_msgs
#RUN git clone https://github.com/bjoernellens1/segwayrmp -b x86
#WORKDIR /my_ws
#RUN apt update && apt -y install gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
#RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
# colcon build --symlink-install
#RUN echo "source /build/install/setup.bash" >> /root/.bashrc
#FROM ros:foxy AS run-run-stage
#COPY --from=build /my_ws/. /my_ws
#CMD /bin/bash
FROM ros:humble
# Install any additional packages you need
#RUN apt-get update && apt-get install -y \
# <package1> \
# <package2> \
# && rm -rf /var/lib/apt/lists/*
# Create a non-root user to run the container
2023-04-17 08:37:55 +00:00
# RUN groupadd -r ros && useradd -r -g ros ros
# USER ros
2023-04-13 10:39:14 +00:00
# Create a workspace directory and copy your project into it
2023-04-17 08:37:55 +00:00
# RUN mkdir -p /home/ros/workspace/src
# WORKDIR /home/ros/workspace/src
# RUN git clone https://github.com/bjoernellens1/segway_msgs
# RUN git clone https://github.com/bjoernellens1/segwayrmp -b x86
2023-04-13 10:39:14 +00:00
2023-04-17 08:37:55 +00:00
RUN mkdir -p /root/workspace/src
WORKDIR /root/workspace/src
RUN git clone https://github.com/bjoernellens1/segway_msgs
RUN git clone https://github.com/bjoernellens1/segwayrmp -b humble
RUN git clone https://github.com/bjoernellens1/rmp220_teleop
2023-04-13 10:39:14 +00:00
# Build the workspace
2023-04-17 08:37:55 +00:00
# WORKDIR /home/ros/workspace
# RUN . /opt/ros/humble/setup.sh && \
# colcon build
WORKDIR /root/workspace
2023-04-13 10:39:14 +00:00
RUN . /opt/ros/humble/setup.sh && \
colcon build
2023-04-17 08:37:55 +00:00
RUN apt update && apt install -y ros-humble-joy
RUN apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2023-04-17 06:57:48 +00:00
2023-04-13 10:39:14 +00:00
# Set the entrypoint to the workspace and run the shell
2023-04-17 06:57:48 +00:00
#ENTRYPOINT ["/bin/bash", "-c", ". /opt/ros/humble/setup.sh && . install/setup.sh && /bin/bash"]
# Set up the ROS environment
2023-04-17 08:37:55 +00:00
# RUN echo "source /opt/ros/humble/setup.bash" >> /home/ros/.bashrc && \
# echo "source /home/ros/workspace/install/setup.bash" >> /home/ros/.bashrc
RUN echo "source /opt/ros/humble/setup.bash" >> /root/.bashrc && \
echo "source /root/workspace/install/setup.bash" >> /root/.bashrc
2023-04-13 10:39:14 +00:00
# Set the default command to start a new shell in the workspace
CMD ["/bin/bash"]