Skip to content

Commit

Permalink
Merge pull request #9 from hanson-hschang/docker-add-torch
Browse files Browse the repository at this point in the history
Update Dockerfile - basic python dependencies
  • Loading branch information
hanson-hschang authored Aug 20, 2024
2 parents d93ccbd + e3ee18f commit 25a488c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ RUN apt-get update && apt-get install -y \
git \
htop \
vim \
python3-pip \
&& rm -rf /var/lib/apt/lists/*

# Install python packages
RUN pip3 install --upgrade pip
RUN pip3 install numpy matplotlib scipy scikit-learn
RUN pip3 install h5py torch==2.1.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
RUN rm -rf /root/.cache/pip

# Clone the ros2-vicon-receiver package
ENV WS /vicon_ws
Expand All @@ -36,8 +42,12 @@ RUN source vicon_ws/install/setup.bash
RUN echo ". /opt/ros/foxy/setup.bash" >> /root/.bashrc
RUN echo ". /vicon_ws/install/setup.bash" >> /root/.bashrc

# Set alias
RUN echo "alias python=python3" >> /root/.bashrc
RUN echo "alias pip=pip3" >> /root/.bashrc

RUN sed -e '/[ -z "$PS1" ] && return/s/^/#/g' -i /root/.bashrc

# Set the entrypoint to use ROS 2
ENTRYPOINT ["/bin/bash", "-c", "source ~/.bashrc && exec \"$@\"", "--"]
CMD ["bash"]
CMD ["bash"]

0 comments on commit 25a488c

Please sign in to comment.