Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 20 additions & 62 deletions docker/cloudsim_sim/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
# Ubuntu 18.04 with nvidia-docker2 beta opengl support
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu18.04

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y \
tzdata \
&& ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& apt-get clean
FROM osrf/subt-virtual-testbed:models_latest

# Tools I find useful during development
RUN apt-get update -qq \
&& apt-get install --no-install-recommends -y -qq \
RUN sudo apt-get update -qq \
&& sudo apt-get install --no-install-recommends -y -qq \
build-essential \
bwm-ng \
atop \
Expand All @@ -36,23 +28,21 @@ RUN apt-get update -qq \
ruby2.5 \
ruby2.5-dev \
software-properties-common \
sudo \
vim \
wget \
net-tools \
iputils-ping \
libyaml-cpp-dev \
xvfb \
&& apt-get clean -qq
&& sudo apt-get clean -qq

# Install AWS CLI. This is needed by cloudsim to capture ROS logs.
RUN pip3 install --upgrade awscli=="1.16.220"
VOLUME /root/.aws

# install ROS and required packages
RUN /bin/sh -c 'echo "deb [trusted=yes] http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' \
&& apt-get update \
&& apt-get install -y \
RUN sudo /bin/sh -c 'echo "deb [trusted=yes] http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' \
&& sudo apt-get update -qq \
&& sudo apt-get install -y -qq \
python-catkin-tools \
python-rosdep \
python-rosinstall \
Expand All @@ -65,39 +55,27 @@ RUN /bin/sh -c 'echo "deb [trusted=yes] http://packages.ros.org/ros/ubuntu $(lsb
ros-melodic-twist-mux \
ros-melodic-rviz-imu-plugin \
ros-melodic-rotors-control \
&& rosdep init \
&& apt-get clean
&& sudo rosdep init \
&& sudo apt-get clean

# sdformat8-sdf conflicts with sdformat-sdf installed from gazebo
# so we need to workaround this using a force overwrite
# Do this before installing ign-gazebo
RUN /bin/sh -c 'echo "deb [trusted=yes] http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' \
&& /bin/sh -c 'wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -' \
&& /bin/sh -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'
RUN sudo /bin/sh -c 'echo "deb [trusted=yes] http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' \
&& sudo /bin/sh -c 'wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -' \
&& sudo /bin/sh -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'

# install ign-blueprint
RUN apt-get update \
&& apt-get install -y \
RUN sudo apt-get update \
&& sudo apt-get install -y \
ignition-blueprint \
&& apt-get clean
&& sudo apt-get clean

# install the ros to ign bridge
RUN apt-get update \
&& apt-get install -y \
RUN sudo apt-get update \
&& sudo apt-get install -y \
ros-melodic-ros-ign \
&& apt-get clean

# Add a user with the same user_id as the user outside the container
# Requires a docker build argument `user_id`
ARG user_id
ENV USERNAME developer
RUN useradd -U --uid ${user_id} -ms /bin/bash $USERNAME \
&& echo "$USERNAME:$USERNAME" | chpasswd \
&& adduser $USERNAME sudo \
&& echo "$USERNAME ALL=NOPASSWD: ALL" >> /etc/sudoers.d/$USERNAME

# Commands below run as the developer user
USER $USERNAME
&& sudo apt-get clean -qq

# Make a couple folders for organizing docker volumes
RUN mkdir ~/workspaces ~/other
Expand All @@ -107,33 +85,13 @@ WORKDIR /home/$USERNAME

RUN rosdep update

# Download the public models
RUN ign fuel download -v 4 -j 8 --type model -u "https://fuel.ignitionrobotics.org/OpenRobotics/collections/SubT Tech Repo"

# Download niosh models, set 1.
COPY download_niosh_1.sh ./
RUN ./download_niosh_1.sh

# Download niosh models, set 2.
COPY download_niosh_2.sh ./
RUN ./download_niosh_2.sh

# Download niosh models, set 3.
COPY download_niosh_3.sh ./
RUN ./download_niosh_3.sh

# Clone all the subt models so that you don't download them every time
# docker is run
# Install subt sim
RUN mkdir -p subt_ws/src \
&& cd subt_ws/src \
&& git clone https://github.com/osrf/subt -b cave_circuit_compeition_worlds
&& git clone https://github.com/osrf/subt

WORKDIR /home/$USERNAME/subt_ws

# Install Rotors
# RUN wget https://s3.amazonaws.com/osrf-distributions/subt_robot_examples/releases/subt_robot_examples_latest.tgz
# RUN tar xvf subt_robot_examples_latest.tgz

RUN /bin/bash -c 'source /opt/ros/melodic/setup.bash && catkin_make install'

RUN /bin/sh -c 'echo ". /opt/ros/melodic/setup.bash" >> ~/.bashrc' \
Expand Down
49 changes: 49 additions & 0 deletions docker/subt_models/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Ubuntu 18.04 with nvidia-docker2 beta opengl support
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu18.04

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
tzdata \
sudo \
wget \
gnupg \
lsb-release \
&& ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& apt-get clean

# sdformat8-sdf conflicts with sdformat-sdf installed from gazebo
# so we need to workaround this using a force overwrite
# Do this before installing ign-gazebo
RUN /bin/sh -c 'echo "deb [trusted=yes] http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' \
&& /bin/sh -c 'wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -' \
&& /bin/sh -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'

# install ign-citadel
RUN apt-get update \
&& apt-get install -y \
ignition-citadel \
&& apt-get clean

# Add a user with the same user_id as the user outside the container
# Requires a docker build argument `user_id`
ARG user_id
ENV USERNAME developer
RUN useradd -U --uid ${user_id} -ms /bin/bash $USERNAME \
&& echo "$USERNAME:$USERNAME" | chpasswd \
&& adduser $USERNAME sudo \
&& echo "$USERNAME ALL=NOPASSWD: ALL" >> /etc/sudoers.d/$USERNAME

# Commands below run as the developer user
USER $USERNAME

# When running a container start in the developer's home folder
WORKDIR /home/$USERNAME

# Download the public models
RUN ign fuel download -v 4 -j 8 --type model -u "https://fuel.ignitionrobotics.org/OpenRobotics/collections/SubT Tech Repo"

# Cleanup ignition
RUN sudo apt-get remove ignition-citadel -y \
&& sudo apt-get clean
71 changes: 15 additions & 56 deletions docker/subt_sim_entry/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Ubuntu 18.04 with nvidia-docker2 beta opengl support
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu18.04
FROM osrf/subt-virtual-testbed:models_latest

# Tools I find useful during development
RUN apt-get update -qq \
&& apt-get install -y -qq \
RUN sudo apt-get update -qq \
&& sudo apt-get install --no-install-recommends -y -qq \
build-essential \
cmake \
cppcheck \
Expand All @@ -26,38 +26,10 @@ RUN apt-get update -qq \
ruby2.5 \
ruby2.5-dev \
software-properties-common \
sudo \
vim \
wget \
net-tools \
iputils-ping \
libyaml-cpp-dev \
&& apt-get clean -qq

# Add a user with the same user_id as the user outside the container
# Requires a docker build argument `user_id`
ARG user_id
ENV USERNAME developer
RUN useradd -U --uid ${user_id} -ms /bin/bash $USERNAME \
&& echo "$USERNAME:$USERNAME" | chpasswd \
&& adduser $USERNAME sudo \
&& echo "$USERNAME ALL=NOPASSWD: ALL" >> /etc/sudoers.d/$USERNAME

# Commands below run as the developer user
USER $USERNAME

# Make a couple folders for organizing docker volumes
RUN mkdir ~/workspaces ~/other

# When running a container start in the developer's home folder
WORKDIR /home/$USERNAME

RUN export DEBIAN_FRONTEND=noninteractive \
&& sudo apt-get update -qq \
&& sudo -E apt-get install -y -qq \
tzdata \
&& sudo ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime \
&& sudo dpkg-reconfigure --frontend noninteractive tzdata \
&& sudo apt-get clean -qq

# install ROS and required packages
Expand All @@ -79,24 +51,30 @@ RUN sudo /bin/sh -c 'echo "deb [trusted=yes] http://packages.ros.org/ros/ubuntu
&& sudo rosdep init \
&& sudo apt-get clean -qq

# Make a couple folders for organizing docker volumes
RUN mkdir ~/workspaces ~/other

# When running a container start in the developer's home folder
WORKDIR /home/$USERNAME

RUN rosdep update

# sdformat8-sdf conflicts with sdformat-sdf installed from gazebo
# so we need to workaround this using a force overwrite
# Do this before installing ign-gazebo
RUN sudo /bin/sh -c 'echo "deb [trusted=yes] http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' \
&& sudo /bin/sh -c 'wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -' \
&& sudo /bin/sh -c 'wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -' \
&& sudo /bin/sh -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'

# install ign-blueprint
RUN sudo apt-get update -qq \
&& sudo apt-get install -y -qq \
RUN sudo apt-get update \
&& sudo apt-get install -y \
ignition-blueprint \
&& sudo apt-get clean -qq
&& sudo apt-get clean

# install the ros to ign bridge
RUN sudo apt-get update -qq \
&& sudo apt-get install -y -qq \
RUN sudo apt-get update \
&& sudo apt-get install -y \
ros-melodic-ros-ign \
&& sudo apt-get clean -qq

Expand All @@ -106,27 +84,8 @@ RUN mkdir -p subt_ws/src \
&& cd subt_ws/src \
&& git clone https://github.com/osrf/subt

# Download the public models
RUN ign fuel download -v 4 -j 16 -u "https://fuel.ignitionrobotics.org/OpenRobotics/collections/SubT Tech Repo"

# Download niosh models, set 1.
COPY download_niosh_1.sh ./
RUN ./download_niosh_1.sh

# Download niosh models, set 2.
COPY download_niosh_2.sh ./
RUN ./download_niosh_2.sh

# Download niosh models, set 3.
COPY download_niosh_3.sh ./
RUN ./download_niosh_3.sh

WORKDIR /home/$USERNAME/subt_ws

# Install Rotors
# RUN wget https://s3.amazonaws.com/osrf-distributions/subt_robot_examples/releases/subt_robot_examples_latest.tgz
# RUN tar xvf subt_robot_examples_latest.tgz

RUN /bin/bash -c 'source /opt/ros/melodic/setup.bash && catkin_make install'

RUN /bin/sh -c 'echo ". /opt/ros/melodic/setup.bash" >> ~/.bashrc' \
Expand Down