Skip to content

Commit

Permalink
Merge pull request #186 from BCLab-UNM/docker_devel_env
Browse files Browse the repository at this point in the history
Setup basic docker build and run scripts
  • Loading branch information
Carter90 authored Apr 26, 2021
2 parents 41bdb20 + 07b6927 commit 6705437
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 32 deletions.
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker build -t swarmathon:development -f docker/Dockerfile .
60 changes: 39 additions & 21 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,50 @@
FROM ros:noetic

# set up the ros-ws
RUN mkdir -p /SC2/src
ENV WORKSPACE=/SC2
ENV DEBIAN_FRONTEND noninteractive

# Install dependencies
RUN sudo apt update && apt upgrade -y && sudo apt install -y
RUN sudo apt install -y \
ros-noetic-tf \
ros-noetic-angles \
ros-noetic-gazebo-msgs \
ros-noetic-robot-localization \
ros-noetic-stereo-image-proc \
ros-noetic-gazebo-ros \
ros-noetic-geometry2 \
python3-catkin-tools \
python3-osrf-pycommon

RUN pip install imutils
RUN pip install scipy==1.2.0
RUN apt-get -qq update && \
apt-get -qq upgrade && \
apt-get -qq install \
apt-utils \
build-essential \
ros-noetic-tf \
ros-noetic-angles \
ros-noetic-gazebo-msgs \
ros-noetic-robot-localization \
ros-noetic-stereo-image-proc \
ros-noetic-gazebo-ros \
ros-noetic-geometry2 \
python3-catkin-tools \
python3-osrf-pycommon \
python3 \
python3-pip


RUN rm /bin/sh && ln -s /bin/bash /bin/sh

RUN pip3 install --upgrade setuptools
RUN pip3 install ipython

# Clear apt cache to save on space
RUN rm -rf /var/lib/apt/lists/*

# Copy in SC2 project
COPY . /SC2
RUN chmod 777 /SC2
RUN rm -rf /SC2/devel
RUN rm -rf /SC2/build
COPY . $WORKSPACE
RUN chmod 777 $WORKSPACE
RUN rm -rf $WORKSPACE/devel
RUN rm -rf $WORKSPACE/build

# Build project
RUN /bin/bash -c "source /opt/ros/noetic/setup.bash; source /SC2/srcp2-competitors/ros_workspace/install/setup.bash; cd /SC2; catkin_make"
RUN source /opt/ros/noetic/setup.bash && \
source $WORKSPACE/srcp2-competitors/ros_workspace/install/setup.bash && \
cd $WORKSPACE && \
catkin_make && \
catkin_make install

# Setup Entrypoint
COPY ./docker/entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

CMD ["bash"]
10 changes: 10 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

source /opt/ros/noetic/setup.bash
source /SC2/srcp2-competitors/ros_workspace/install/setup.bash
source /SC2/devel/setup.bash

export ROS_MASTER_URI=http://simmaster:11311

exec "$@"
8 changes: 0 additions & 8 deletions docker/submissionBuild.sh

This file was deleted.

3 changes: 0 additions & 3 deletions docker/submissionTest.sh

This file was deleted.

9 changes: 9 additions & 0 deletions runREPL.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

docker run -it \
--network srcp2net \
-v /SC2:$(pwd) \
swarmathon:development \
/bin/sh -c 'roslaunch scoot scoot.launch "mode:=man" &
sleep 2 &&
ROS_NAMESPACE="/small_scout_1" rosrun scoot repl.py'

0 comments on commit 6705437

Please sign in to comment.