Skip to content

Commit

Permalink
Fix: nointeractive mode during build
Browse files Browse the repository at this point in the history
  • Loading branch information
joseluizmendonca committed Nov 21, 2024
1 parent 57d383f commit 15c716c
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM ubuntu:22.04

# Avoid timezone prompt
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC

# Install ROS2
RUN apt update -y && \
apt install -y \
Expand All @@ -12,7 +16,7 @@ RUN apt update -y && \
apt install -y \
ros-humble-desktop && \
rm -rf /var/lib/apt/lists/*

RUN apt update -y && \
apt install -y \
vim \
Expand All @@ -24,24 +28,4 @@ RUN apt update -y && \
i2c-tools \
python3-smbus \
can-utils && \
rm -rf /var/lib/apt/lists/*

# Copy local packages to be built
COPY ./src /root/ros2_ws/src

WORKDIR /root/ros2_ws

# Install dependencies and build
RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \
rosdep install --from-paths src -y --ignore-src && \
colcon build --packages-select odrive_can"

# Setup ROS environment
RUN echo "source /opt/ros/humble/setup.bash" >> /root/.bashrc && \
echo "source /root/ros2_ws/install/setup.bash" >> /root/.bashrc

# Set environment variables for hardware access
ENV UDEV=1
ENV DISPLAY=:0

CMD ["bash"]
rm -rf /var/lib/apt/lists/*

0 comments on commit 15c716c

Please # to comment.