Skip to content

Commit 9c0e297

Browse files
ologandavidjrenaf
andauthored
Docker Support, IPOPT, Coinbrew Version Update to 3.14 (#408)
* Update Setup with ipopt 3.14 * Add Dockerfile * Update Dockerfile --------- Co-authored-by: jrenaf <jimingre@andrew.cmu.edu>
1 parent 2bc8cfd commit 9c0e297

File tree

2 files changed

+134
-3
lines changed

2 files changed

+134
-3
lines changed

docker/Dockerfile

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
#############################################
2+
# Created from template ros.dockerfile.jinja
3+
#############################################
4+
5+
###########################################
6+
# Base image
7+
###########################################
8+
FROM ubuntu:20.04 AS base
9+
10+
ENV DEBIAN_FRONTEND=noninteractive
11+
12+
# Install language
13+
RUN apt-get update && apt-get install -y \
14+
locales \
15+
&& locale-gen en_US.UTF-8 \
16+
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \
17+
&& rm -rf /var/lib/apt/lists/*
18+
ENV LANG en_US.UTF-8
19+
20+
# Install timezone
21+
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime \
22+
&& export DEBIAN_FRONTEND=noninteractive \
23+
&& apt-get update \
24+
&& apt-get install -y tzdata \
25+
&& dpkg-reconfigure --frontend noninteractive tzdata \
26+
&& rm -rf /var/lib/apt/lists/*
27+
28+
###########################################
29+
# ROS image
30+
###########################################
31+
FROM base AS ros
32+
33+
# Install ROS
34+
RUN apt-get update && apt-get install -y \
35+
curl \
36+
dirmngr \
37+
gnupg2 \
38+
lsb-release \
39+
sudo \
40+
&& apt-get upgrade -y \
41+
&& sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' \
42+
&& curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - \
43+
&& apt-get update && apt-get install -y \
44+
ros-noetic-desktop-full \
45+
&& apt-get upgrade libignition-math4 -y \
46+
&& rm -rf /var/lib/apt/lists/*
47+
48+
# Setup environment
49+
ENV LD_LIBRARY_PATH=/opt/ros/noetic/lib
50+
ENV ROS_DISTRO=noetic
51+
ENV ROS_ROOT=/opt/ros/noetic/share/ros
52+
ENV ROS_PACKAGE_PATH=/opt/ros/noetic/share
53+
ENV ROS_MASTER_URI=http://localhost:11311
54+
ENV ROS_PYTHON_VERSION=
55+
ENV ROS_VERSION=1
56+
ENV PATH=/opt/ros/noetic/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
57+
ENV ROSLISP_PACKAGE_DIRECTORIES=
58+
ENV PYTHONPATH=/opt/ros/noetic/lib/python3.8/dist-packages
59+
ENV PKG_CONFIG_PATH=/opt/ros/noetic/lib/pkgconfig
60+
ENV ROS_ETC_DIR=/opt/ros/noetic/etc/ros
61+
ENV CMAKE_PREFIX_PATH=/opt/ros/noetic
62+
ENV DEBIAN_FRONTEND=
63+
64+
###########################################
65+
# Develop image
66+
###########################################
67+
FROM ros AS dev
68+
69+
ENV DEBIAN_FRONTEND=noninteractive
70+
# Install dev tools
71+
RUN apt-get update && apt-get install -y \
72+
python3-rosdep \
73+
python3-rosinstall \
74+
python3-rosinstall-generator \
75+
python3-wstool \
76+
python3-pip \
77+
python3-pep8 \
78+
python3-autopep8 \
79+
pylint \
80+
build-essential \
81+
bash-completion \
82+
git \
83+
vim \
84+
python3-catkin-tools \
85+
&& rm -rf /var/lib/apt/lists/* \
86+
&& rosdep init || echo "rosdep already initialized"
87+
88+
ARG USERNAME=ros
89+
ARG USER_UID=1000
90+
ARG USER_GID=$USER_UID
91+
92+
# Create a non-root user
93+
RUN groupadd --gid $USER_GID $USERNAME \
94+
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
95+
# [Optional] Add sudo support for the non-root user
96+
&& apt-get update \
97+
&& apt-get install -y sudo git-core bash-completion \
98+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
99+
&& chmod 0440 /etc/sudoers.d/$USERNAME \
100+
# Cleanup
101+
&& rm -rf /var/lib/apt/lists/* \
102+
&& echo "if [ -f /opt/ros/${ROS_DISTRO}/setup.bash ]; then source /opt/ros/${ROS_DISTRO}/setup.bash; fi" >> /home/$USERNAME/.bashrc
103+
ENV DEBIAN_FRONTEND=
104+
105+
###########################################
106+
# ADD SSH into Docker Container
107+
###########################################
108+
109+
110+
#########################################
111+
# Set up auto-source of workspace for ros user
112+
ARG WORKSPACE
113+
RUN echo "if [ -f ${WORKSPACE}/devel/setup.bash ]; then source ${WORKSPACE}/devel/setup.bash; fi" >> /home/ros/.bashrc
114+
115+
116+
ENV CATKIN_WS = /home/catkin_ws
117+
ENV SDK = /home/catkin_ws/src
118+
RUN mkdir -p $CATKIN_WS/src
119+
120+
RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; catkin init;"
121+
WORKDIR $SDK
122+
RUN git clone https://github.com/robomechanics/quad-sdk.git
123+
124+
# ENV QUAD_SDK = /root/catkin_ws/src/quad-sdk
125+
# WORKDIR $QUAD_SDK
126+
# RUN git checkout devel
127+
128+
# ADD coinhsl /home/catkin_ws/src/quad-sdk/external/ipopt/coinhsl
129+
130+
131+

external/setup_deps.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ then
1414
fi
1515
mkdir coinbrew
1616
cd coinbrew
17-
wget https://raw.githubusercontent.com/coin-or/coinbrew/v1.0/coinbrew
17+
wget https://raw.githubusercontent.com/coin-or/coinbrew/v2.0/coinbrew
1818
chmod u+x coinbrew
19-
./coinbrew fetch Ipopt@3.13 --no-prompt
19+
./coinbrew fetch Ipopt --no-prompt
2020
cd ..
2121
if [ -d "./coinhsl" ]
2222
then
@@ -26,7 +26,7 @@ else
2626
echo "Warning: HSL not found."
2727
fi
2828
cd coinbrew
29-
./coinbrew build Ipopt --latest-release --tests none --prefix=/usr/local
29+
./coinbrew build Ipopt --latest-release --tests none --prefix=/usr/local --no-prompt
3030
cd ../..
3131

3232
# Setup and build for rbdl

0 commit comments

Comments
 (0)