Skip to content

Commit

Permalink
Add docker container for developing superflore
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Woolley <[email protected]>
  • Loading branch information
robwoolley committed Jan 19, 2025
1 parent 7258477 commit 4aec625
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# superflore-devel
# Copyright (C) 2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: MIT
#

FROM osrf/ros2:devel

ENV ROS_HOME="/home/ubuntu"
ENV ROSDEP_SOURCE_PATH="/home/ubuntu/rosdep"
ENV ROS_DISTRO="rolling"
ENV ROSDISTRO_URL="https://raw.githubusercontent.com/ros/rosdistro/master/rosdep"
ENV GIT_FULLNAME="Firstname Lastname"
ENV GIT_EMAIL="[email protected]"

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
apt-utils \
curl \
locales \
python3 \
python3-pip \
python3.12-venv \
python3-virtualenv \
vim \
wget && \
apt-get clean && \
locale-gen en_US en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

USER ubuntu
WORKDIR /home/ubuntu

RUN git config --global user.email "${GIT_EMAIL}" && \
git config --global user.name "${GIT_FULLNAME}"

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

set -x

# export ROS_HOME=${HOME}
if [ -z "$ROS_HOME" ]; then
echo "ROS_HOME is not set"
exit 1
fi

# export ROSDEP_SOURCE_PATH=${ROS_HOME}/rosdep
if [ -z "$ROSDEP_SOURCE_PATH" ]; then
echo "ROSDEP_SOURCE_PATH is not set"
exit 1
fi
mkdir -p ${ROSDEP_SOURCE_PATH}

PROJECT_DIR=$PWD

python3 -m venv $HOME/superflore_venv
source $HOME/superflore_venv/bin/activate
python3 -m pip install .

echo "Running rosdep init"
rosdep init

echo "Running rosdep update"
rosdep update

cd ${PROJECT_DIR}
ROSDISTRO_GIT="https://github.com/ros/rosdistro"
git clone ${ROSDISTRO_GIT} ${HOME}/rosdistro

ROSDISTRO_URL="https://raw.githubusercontent.com/ros/rosdistro/master/rosdep"
sed -i -e "s|${ROSDISTRO_URL}|file://${HOME}/rosdistro/rosdep|" ${ROSDEP_SOURCE_PATH}/20-default.list

0 comments on commit 4aec625

Please sign in to comment.