-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker Support, IPOPT, Coinbrew Version Update to 3.14 (#408)
* Update Setup with ipopt 3.14 * Add Dockerfile * Update Dockerfile --------- Co-authored-by: jrenaf <[email protected]>
- Loading branch information
1 parent
2bc8cfd
commit 9c0e297
Showing
2 changed files
with
134 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
############################################# | ||
# Created from template ros.dockerfile.jinja | ||
############################################# | ||
|
||
########################################### | ||
# Base image | ||
########################################### | ||
FROM ubuntu:20.04 AS base | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install language | ||
RUN apt-get update && apt-get install -y \ | ||
locales \ | ||
&& locale-gen en_US.UTF-8 \ | ||
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
ENV LANG en_US.UTF-8 | ||
|
||
# Install timezone | ||
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime \ | ||
&& export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get update \ | ||
&& apt-get install -y tzdata \ | ||
&& dpkg-reconfigure --frontend noninteractive tzdata \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
########################################### | ||
# ROS image | ||
########################################### | ||
FROM base AS ros | ||
|
||
# Install ROS | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
dirmngr \ | ||
gnupg2 \ | ||
lsb-release \ | ||
sudo \ | ||
&& apt-get upgrade -y \ | ||
&& sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' \ | ||
&& curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - \ | ||
&& apt-get update && apt-get install -y \ | ||
ros-noetic-desktop-full \ | ||
&& apt-get upgrade libignition-math4 -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Setup environment | ||
ENV LD_LIBRARY_PATH=/opt/ros/noetic/lib | ||
ENV ROS_DISTRO=noetic | ||
ENV ROS_ROOT=/opt/ros/noetic/share/ros | ||
ENV ROS_PACKAGE_PATH=/opt/ros/noetic/share | ||
ENV ROS_MASTER_URI=http://localhost:11311 | ||
ENV ROS_PYTHON_VERSION= | ||
ENV ROS_VERSION=1 | ||
ENV PATH=/opt/ros/noetic/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
ENV ROSLISP_PACKAGE_DIRECTORIES= | ||
ENV PYTHONPATH=/opt/ros/noetic/lib/python3.8/dist-packages | ||
ENV PKG_CONFIG_PATH=/opt/ros/noetic/lib/pkgconfig | ||
ENV ROS_ETC_DIR=/opt/ros/noetic/etc/ros | ||
ENV CMAKE_PREFIX_PATH=/opt/ros/noetic | ||
ENV DEBIAN_FRONTEND= | ||
|
||
########################################### | ||
# Develop image | ||
########################################### | ||
FROM ros AS dev | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
# Install dev tools | ||
RUN apt-get update && apt-get install -y \ | ||
python3-rosdep \ | ||
python3-rosinstall \ | ||
python3-rosinstall-generator \ | ||
python3-wstool \ | ||
python3-pip \ | ||
python3-pep8 \ | ||
python3-autopep8 \ | ||
pylint \ | ||
build-essential \ | ||
bash-completion \ | ||
git \ | ||
vim \ | ||
python3-catkin-tools \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rosdep init || echo "rosdep already initialized" | ||
|
||
ARG USERNAME=ros | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# Create a non-root user | ||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
# [Optional] Add sudo support for the non-root user | ||
&& apt-get update \ | ||
&& apt-get install -y sudo git-core bash-completion \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME \ | ||
# Cleanup | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& echo "if [ -f /opt/ros/${ROS_DISTRO}/setup.bash ]; then source /opt/ros/${ROS_DISTRO}/setup.bash; fi" >> /home/$USERNAME/.bashrc | ||
ENV DEBIAN_FRONTEND= | ||
|
||
########################################### | ||
# ADD SSH into Docker Container | ||
########################################### | ||
|
||
|
||
######################################### | ||
# Set up auto-source of workspace for ros user | ||
ARG WORKSPACE | ||
RUN echo "if [ -f ${WORKSPACE}/devel/setup.bash ]; then source ${WORKSPACE}/devel/setup.bash; fi" >> /home/ros/.bashrc | ||
|
||
|
||
ENV CATKIN_WS = /home/catkin_ws | ||
ENV SDK = /home/catkin_ws/src | ||
RUN mkdir -p $CATKIN_WS/src | ||
|
||
RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; catkin init;" | ||
WORKDIR $SDK | ||
RUN git clone https://github.com/robomechanics/quad-sdk.git | ||
|
||
# ENV QUAD_SDK = /root/catkin_ws/src/quad-sdk | ||
# WORKDIR $QUAD_SDK | ||
# RUN git checkout devel | ||
|
||
# ADD coinhsl /home/catkin_ws/src/quad-sdk/external/ipopt/coinhsl | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters