-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.sim
55 lines (41 loc) · 2.06 KB
/
Dockerfile.sim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM osrf/ros:humble-desktop
# Install gazebo
RUN sudo apt-get update -y
RUN sudo apt install python3-pip wget lsb-release gnupg curl -y && \
sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null && \
sudo apt-get update -y && \
sudo apt-get upgrade -y
RUN sudo sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros2-latest.list' -y && \
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - && \
sudo apt-get update -y && \
sudo apt-get install python3-vcstool python3-colcon-common-extensions -y
WORKDIR /gz
RUN mkdir -p src && \
cd src && \
wget https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-garden.yaml && \
vcs import < collection-garden.yaml && \
sudo apt-get update && \
sudo apt -y install \
$(sort -u $(find . -iname 'packages-'`lsb_release -cs`'.apt' -o -iname 'packages.apt' | grep -v '/\.git/') | sed '/gz\|sdf/d' | tr '\n' ' ')
RUN cd src && \
rm -rdf gz-sim && \
git clone https://github.com/UoA-CARES/gz-sim.git
RUN colcon build --merge-install
RUN echo ". /gz/install/setup.bash" >> ~/.bashrc
SHELL [ "/bin/bash", "-c" ]
WORKDIR /ws
COPY . .
RUN git clone https://github.com/UoA-CARES/cares_reinforcement_learning.git && \
cd cares_reinforcement_learning && \
pip3 install -r requirements.txt && \
pip3 install --editable .
# Install dep
RUN rosdep update -y && \
rosdep install -r --from-paths src -i -y --rosdistro humble
RUN source /opt/ros/humble/setup.bash && \
source /gz/install/setup.bash && \
colcon build --symlink-install
RUN echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc && \
echo 'source install/setup.bash' >> ~/.bashrc
WORKDIR /ws