docker
This commit is contained in:
parent
3d8b71c4d4
commit
802385f153
143
Dockerfile
143
Dockerfile
@ -1,14 +1,17 @@
|
||||
ARG ROS_ARCHITECTURE_VERSION=latest
|
||||
|
||||
FROM ubuntu:20.04 as base_build
|
||||
SHELL [ "/bin/bash" , "-c" ]
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV PYTHON_VERSION="3.8"
|
||||
ARG BASE_IMAGE=nvcr.io/nvidia/l4t-base:r32.5.0
|
||||
|
||||
ARG ROS_ENVIROMENT_VERSION_GIT_BRANCH=master
|
||||
ARG ROS_ENVIROMENT_VERSION_GIT_COMMIT=HEAD
|
||||
ARG ROS_ARCHITECTURE_VERSION_GIT_BRANCH=master
|
||||
ARG ROS_ARCHITECTURE_VERSION_GIT_COMMIT=HEAD
|
||||
|
||||
LABEL maintainer=ronaldsonbellande@gmail.com
|
||||
LABEL ros_enviroment_github_branchtag=${ROS_ENVIROMENT_VERSION_GIT_BRANCH}
|
||||
LABEL ros_enviroment_github_commit=${ROS_ENVIROMENT_VERSION_GIT_COMMIT}
|
||||
LABEL ROS_architecture_github_branchtag=${ROS_ARCHITECTURE_VERSION_GIT_BRANCH}
|
||||
LABEL ROS_architecture_github_commit=${ROS_ARCHITECTURE_VERSION_GIT_COMMIT}
|
||||
|
||||
# Ubuntu setup
|
||||
RUN apt-get update -y
|
||||
@ -17,98 +20,54 @@ RUN apt-get upgrade -y
|
||||
# RUN workspace and sourcing
|
||||
WORKDIR ./
|
||||
COPY requirements.txt .
|
||||
COPY system_requirements.txt .
|
||||
COPY ros_requirements.txt .
|
||||
COPY ros_repository_requirements.txt .
|
||||
|
||||
ARG ROS_PKG=ros_base
|
||||
ENV ROS_DISTRO=noetic
|
||||
ENV ROS_ROOT=/opt/ros/${ROS_DISTRO}
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# add the ROS deb repo to the apt sources list
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
cmake \
|
||||
build-essential \
|
||||
curl \
|
||||
wget \
|
||||
gnupg2 \
|
||||
lsb-release \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
|
||||
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
|
||||
|
||||
|
||||
# install bootstrap dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
libpython3-dev \
|
||||
python3-rosdep \
|
||||
python3-rosinstall-generator \
|
||||
python3-vcstool \
|
||||
build-essential && \
|
||||
rosdep init && \
|
||||
rosdep update && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
# download/build the ROS source
|
||||
RUN mkdir ros_catkin_ws && \
|
||||
cd ros_catkin_ws && \
|
||||
rosinstall_generator ${ROS_PKG} vision_msgs --rosdistro ${ROS_DISTRO} --deps --tar > ${ROS_DISTRO}-${ROS_PKG}.rosinstall && \
|
||||
mkdir src && \
|
||||
vcs import --input ${ROS_DISTRO}-${ROS_PKG}.rosinstall ./src && \
|
||||
apt-get update && \
|
||||
rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro ${ROS_DISTRO} --skip-keys python3-pykdl -y && \
|
||||
python3 ./src/catkin/bin/catkin_make_isolated --install --install-space ${ROS_ROOT} -DCMAKE_BUILD_TYPE=Release && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
apt-utils \
|
||||
automake \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
curl \
|
||||
git \
|
||||
python3-pip \
|
||||
libcurl3-dev \
|
||||
libfreetype6-dev \
|
||||
libpng-dev \
|
||||
libtool \
|
||||
libzmq3-dev \
|
||||
mlocate \
|
||||
openjdk-8-jdk\
|
||||
openjdk-8-jre-headless \
|
||||
pkg-config \
|
||||
python-dev \
|
||||
software-properties-common \
|
||||
swig \
|
||||
unzip \
|
||||
wget \
|
||||
zip \
|
||||
zlib1g-dev \
|
||||
python3-distutils \
|
||||
&& \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install dependencies for system
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends <system_requirements.txt \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install python 3.8 and make primary
|
||||
RUN add-apt-repository ppa:deadsnakes/ppa && \
|
||||
apt-get update && apt-get install -y \
|
||||
python3.8 python3.8-dev python3-pip python3.8-venv && \
|
||||
update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3.8 python3.8-dev python3-pip python3.8-venv \
|
||||
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
|
||||
|
||||
# pip install
|
||||
# Pip install update
|
||||
RUN pip3 install --upgrade pip
|
||||
|
||||
RUN curl -fSsL -O https://bootstrap.pypa.io/get-pip.py && \
|
||||
python3 get-pip.py && \
|
||||
rm get-pip.py
|
||||
|
||||
|
||||
# Install python libraries
|
||||
RUN pip --no-cache-dir install -r requirements.txt
|
||||
|
||||
# Install dependencies for ros system
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends <ros_requirements.txt \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN apt-get update && apt-get -y upgrade \
|
||||
&& <ros_repository_requirements.txt
|
||||
|
||||
# Create local catkin workspace
|
||||
ENV CATKIN_WS=/root/catkin_ws
|
||||
RUN mkdir -p $CATKIN_WS/src
|
||||
WORKDIR $CATKIN_WS/src
|
||||
|
||||
# Initialize local catkin workspace, install dependencies and build workpsace
|
||||
RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
|
||||
RUN source ~/.bashrc
|
||||
|
||||
RUN cd $CATKIN_WS \
|
||||
&& rosdep init \
|
||||
&& rosdep update \
|
||||
&& rosdep update --rosdistro noetic \
|
||||
&& rosdep fix-permissions \
|
||||
&& rosdep install -y --from-paths . --ignore-src --rosdistro noetic
|
||||
|
||||
# Always source catkin_setup.sh when launching bash
|
||||
RUN echo "source /usr/local/bin/catkin_setup.sh" >> /root/.bashrc
|
||||
COPY catkin_setup.sh /usr/local/bin/catkin_setup.sh
|
||||
RUN chmod +x /usr/local/bin/catkin_setup.sh
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/catkin_setup.sh"]
|
||||
CMD ["bash"]
|
||||
|
5
catkin_setup.sh
Normal file
5
catkin_setup.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
catkin build
|
||||
source "/opt/ros/noetic/setup.bash"
|
||||
source "$CATKIN_WS/devel/setup.bash"
|
176
gpu.Dockerfile
176
gpu.Dockerfile
@ -1,14 +1,21 @@
|
||||
ARG ROS_ARCHITECTURE_VERSION=latest
|
||||
|
||||
FROM ubuntu:20.04 as base_build
|
||||
FROM nvidia/cuda:11.2.1-base-ubuntu20.04
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV PYTHON_VERSION="3.8"
|
||||
ARG BASE_IMAGE=nvcr.io/nvidia/l4t-base:r32.5.0
|
||||
ENV CUDNN_VERSION=8.1.0.77
|
||||
ENV TF_TENSORRT_VERSION=7.2.2
|
||||
ENV CUDA=11.2
|
||||
ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
|
||||
|
||||
ARG ROS_ENVIROMENT_VERSION_GIT_BRANCH=master
|
||||
ARG ROS_ENVIROMENT_VERSION_GIT_COMMIT=HEAD
|
||||
ARG ROS_ARCHITECTURE_VERSION_GIT_BRANCH=master
|
||||
ARG ROS_ARCHITECTURE_VERSION_GIT_COMMIT=HEAD
|
||||
|
||||
LABEL maintainer=ronaldsonbellande@gmail.com
|
||||
LABEL ros_enviroment_github_branchtag=${ROS_ENVIROMENT_VERSION_GIT_BRANCH}
|
||||
LABEL ros_enviroment_github_commit=${ROS_ENVIROMENT_VERSION_GIT_COMMIT}
|
||||
LABEL ROS_architecture_github_branchtag=${ROS_ARCHITECTURE_VERSION_GIT_BRANCH}
|
||||
LABEL ROS_architecture_github_commit=${ROS_ARCHITECTURE_VERSION_GIT_COMMIT}
|
||||
|
||||
# Ubuntu setup
|
||||
RUN apt-get update -y
|
||||
@ -17,128 +24,67 @@ RUN apt-get upgrade -y
|
||||
# RUN workspace and sourcing
|
||||
WORKDIR ./
|
||||
COPY requirements.txt .
|
||||
COPY system_requirements.txt .
|
||||
COPY ros_requirements.txt .
|
||||
COPY ros_repository_requirements.txt .
|
||||
|
||||
ARG ROS_PKG=ros_base
|
||||
ENV ROS_DISTRO=noetic
|
||||
ENV ROS_ROOT=/opt/ros/${ROS_DISTRO}
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# add the ROS deb repo to the apt sources list
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
cmake \
|
||||
build-essential \
|
||||
curl \
|
||||
wget \
|
||||
gnupg2 \
|
||||
lsb-release \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
|
||||
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
|
||||
|
||||
|
||||
# install bootstrap dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
libpython3-dev \
|
||||
python3-rosdep \
|
||||
python3-rosinstall-generator \
|
||||
python3-vcstool \
|
||||
build-essential && \
|
||||
rosdep init && \
|
||||
rosdep update && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
# download/build the ROS source
|
||||
RUN mkdir ros_catkin_ws && \
|
||||
cd ros_catkin_ws && \
|
||||
rosinstall_generator ${ROS_PKG} vision_msgs --rosdistro ${ROS_DISTRO} --deps --tar > ${ROS_DISTRO}-${ROS_PKG}.rosinstall && \
|
||||
mkdir src && \
|
||||
vcs import --input ${ROS_DISTRO}-${ROS_PKG}.rosinstall ./src && \
|
||||
apt-get update && \
|
||||
rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro ${ROS_DISTRO} --skip-keys python3-pykdl -y && \
|
||||
python3 ./src/catkin/bin/catkin_make_isolated --install --install-space ${ROS_ROOT} -DCMAKE_BUILD_TYPE=Release && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
apt-utils \
|
||||
automake \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
curl \
|
||||
git \
|
||||
python3-pip \
|
||||
libcurl3-dev \
|
||||
libfreetype6-dev \
|
||||
libpng-dev \
|
||||
libtool \
|
||||
libzmq3-dev \
|
||||
mlocate \
|
||||
openjdk-8-jdk\
|
||||
openjdk-8-jre-headless \
|
||||
pkg-config \
|
||||
python-dev \
|
||||
software-properties-common \
|
||||
swig \
|
||||
unzip \
|
||||
wget \
|
||||
zip \
|
||||
zlib1g-dev \
|
||||
python3-distutils \
|
||||
&& \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install dependencies for system
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends <system_requirements.txt \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install python 3.8 and make primary
|
||||
RUN add-apt-repository ppa:deadsnakes/ppa && \
|
||||
apt-get update && apt-get install -y \
|
||||
python3.8 python3.8-dev python3-pip python3.8-venv && \
|
||||
update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3.8 python3.8-dev python3-pip python3.8-venv \
|
||||
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
|
||||
|
||||
# pip install
|
||||
# Pip install update
|
||||
RUN pip3 install --upgrade pip
|
||||
|
||||
RUN curl -fSsL -O https://bootstrap.pypa.io/get-pip.py && \
|
||||
python3 get-pip.py && \
|
||||
rm get-pip.py
|
||||
|
||||
|
||||
# Install python libraries
|
||||
RUN pip --no-cache-dir install -r requirements.txt
|
||||
|
||||
# Install dependencies for ros system
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends <ros_requirements.txt \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create local catkin workspace
|
||||
ENV CATKIN_WS=/root/catkin_ws
|
||||
RUN mkdir -p $CATKIN_WS/src
|
||||
WORKDIR $CATKIN_WS/src
|
||||
|
||||
# Initialize local catkin workspace, install dependencies and build workpsace
|
||||
RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
|
||||
RUN source ~/.bashrc
|
||||
|
||||
RUN cd $CATKIN_WS \
|
||||
&& rosdep init \
|
||||
&& rosdep update \
|
||||
&& rosdep update --rosdistro noetic \
|
||||
&& rosdep fix-permissions \
|
||||
&& rosdep install -y --from-paths . --ignore-src --rosdistro noetic
|
||||
|
||||
# Always source catkin_setup.sh when launching bash
|
||||
RUN echo "source /usr/local/bin/catkin_setup.sh" >> /root/.bashrc
|
||||
COPY catkin_setup.sh /usr/local/bin/catkin_setup.sh
|
||||
RUN chmod +x /usr/local/bin/catkin_setup.sh
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/catkin_setup.sh"]
|
||||
CMD ["bash"]
|
||||
|
||||
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
cuda-command-line-tools-11-2 \
|
||||
cuda-nvrtc-${CUDA/./-} \
|
||||
libcublas-11-2 \
|
||||
libcublas-dev-11-2 \
|
||||
libcufft-11-2 \
|
||||
libcurand-11-2 \
|
||||
libcusolver-11-2 \
|
||||
libcusparse-11-2 \
|
||||
libcudnn8=${CUDNN_VERSION}-1+cuda${CUDA} \
|
||||
libgomp1 \
|
||||
build-essential \
|
||||
curl \
|
||||
libfreetype6-dev \
|
||||
pkg-config \
|
||||
software-properties-common \
|
||||
unzip
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
cuda-nvrtc-${CUDA/./-} \
|
||||
libcudnn8=${CUDNN_VERSION}-1+cuda${CUDA} \
|
||||
-r cuda_requirements.txt
|
||||
|
||||
# We don't install libnvinfer-dev since we don't need to build against TensorRT
|
||||
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/7fa2af80.pub && \
|
||||
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/tensorRT.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends libnvinfer7=${TF_TENSORRT_VERSION}-1+cuda11.0 \
|
||||
libnvinfer-plugin7=${TF_TENSORRT_VERSION}-1+cuda11.0 \
|
||||
&& apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*;
|
||||
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/tensorRT.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends libnvinfer7=${TF_TENSORRT_VERSION}-1+cuda11.0 \
|
||||
libnvinfer-plugin7=${TF_TENSORRT_VERSION}-1+cuda11.0 \
|
||||
&& apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*;
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
# Recomandation for noetic build
|
||||
# Recomandation for library to install in python
|
||||
|
||||
setuptools
|
||||
numpy
|
||||
pandas
|
||||
scipy
|
||||
sklearn
|
||||
@ -20,9 +19,21 @@ pytest-shutil
|
||||
DateTime
|
||||
zipfile36
|
||||
urllib3
|
||||
tensorflow
|
||||
keras==2.3.1
|
||||
python-time
|
||||
trimesh
|
||||
librosa
|
||||
gym
|
||||
matplotlib
|
||||
image-slicer
|
||||
nvidia-ml-py3
|
||||
imgaug
|
||||
tqdm
|
||||
rosdep
|
||||
|
||||
protobuf==3.15.2
|
||||
numpy==1.19.2
|
||||
numba==0.55.2
|
||||
imageio==2.9.0
|
||||
pillow==7.2.0
|
||||
tensorflow==2.7.0
|
||||
keras==2.7.0
|
||||
|
9
ros_repository_requirements.txt
Normal file
9
ros_repository_requirements.txt
Normal file
@ -0,0 +1,9 @@
|
||||
git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-msgs
|
||||
git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3
|
||||
git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-Tools
|
||||
git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Framework-msgs
|
||||
git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Framework
|
||||
git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-Common
|
||||
git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Utility
|
||||
git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-Demo
|
||||
git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Math
|
15
ros_requirements.txt
Normal file
15
ros_requirements.txt
Normal file
@ -0,0 +1,15 @@
|
||||
# Recomandation for dependencies for ros system
|
||||
|
||||
ros-noetic-desktop-full
|
||||
build-essential
|
||||
ros-noetic-catkin
|
||||
python-rosdep
|
||||
python-rosinstall
|
||||
python-rosinstall-generator
|
||||
python-wstool
|
||||
python-catkin-tools
|
||||
ros-noetic-pcl-ros
|
||||
ros-noetic-flexbe-behavior-engine
|
||||
ros-noetic-moveit
|
||||
ros-noetic-gazebo-ros-pkgs
|
||||
ros-noetic-gazebo-ros-control
|
29
system_requirements.txt
Normal file
29
system_requirements.txt
Normal file
@ -0,0 +1,29 @@
|
||||
# Recomandation for dependencies for linux system
|
||||
|
||||
software-properties-common
|
||||
python3.8
|
||||
neovim
|
||||
apt-utils
|
||||
automake
|
||||
build-essential
|
||||
ca-certificates
|
||||
pycurl
|
||||
git
|
||||
python3-pip
|
||||
libcurl3-dev
|
||||
libfreetype6-dev
|
||||
libpng-dev
|
||||
libtool
|
||||
libzmq3-dev
|
||||
mlocate
|
||||
openjdk-8-jdk
|
||||
openjdk-8-jre-headless
|
||||
pkg-config
|
||||
python-dev
|
||||
software-properties-common
|
||||
swig
|
||||
unzip
|
||||
wget
|
||||
zip
|
||||
zlib1g-dev
|
||||
python3-distutils
|
Loading…
x
Reference in New Issue
Block a user