Skip to content
Snippets Groups Projects
Commit 42c1161a authored by Montaño Sarria, Andres Felipe's avatar Montaño Sarria, Andres Felipe
Browse files

Merge branch '1-manage-extralibs-installation' into main

parents 5e4e0038 b449d44c
No related branches found
No related tags found
1 merge request!1Draft: Resolve "Manage extralibs installation"
ARG ROS_DISTRO
FROM osrf/ros:${ROS_DISTRO}-desktop-full
RUN echo "Building devenv for ROS" $ROS_DISTRO
ARG SHELL
RUN echo "Building devenv for ROS" $ROS_DISTRO "with shell" $SHELL
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
......@@ -45,21 +46,27 @@ RUN apt-get update && \
openssh-client \
trash-cli \
valgrind \
xterm \
wget \
zsh
wget
# ZSH tools based on ubuntu version
RUN if [ "$SHELL" = "zsh" ]; \
then \
apt-get -y install zsh; \
fi
# Install extra libs from .deb files
WORKDIR /tmp/srcs/
COPY /extra_libs/* ./
RUN if [ "${ROS_DISTRO}" = "melodic" ]; \
# Enviroment tools based on ubuntu version
RUN if [ -f "common_libs.txt" ]; \
then \
dpkg -i *.deb; \
else \
dpkg -i bat*.deb; \
dpkg -i lsd*.deb; \
dpkg -i ripgrep*.deb; \
grep -v '^#' common_libs.txt | xargs dpkg -i ;\
fi
# Extra libs, e.g. vtk-7.1_20221201-1_amd64.deb
RUN if [ -f "${ROS_DISTRO}_libs.txt" ]; \
then \
grep -v '^#' ${ROS_DISTRO}_libs.txt | xargs dpkg -i ;\
fi
RUN rm -rf *
......@@ -151,11 +158,14 @@ RUN apt-get update \
COPY ./ros_entrypoint.sh /
RUN chmod a+x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["zsh"]
ENV ROS_DISTRO "${ROS_DISTRO}"
ENV SHELL /usr/bin/zsh
ENV SHELL "${SHELL}"
ENV RUNNING_IN_DOCKER true
# SHELL ["/bin/${SHELL}"]
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD /usr/bin/$SHELL
\ No newline at end of file
# List with the additional libraries to install in devenv image
bat-musl_0.24.0_amd64.deb
lsd-musl_1.0.0_amd64.deb
ripgrep_13.0.0_amd64.deb
\ No newline at end of file
# Lits of the particualr libs to install in melodic docker image
pcl-1.9.1_20221201-1_amd64.deb
vtk-7.1_20221201-1_amd64.deb
\ No newline at end of file
# docker common commands
export dockerfiles_DIR=~/srcs/development_environment/dockerfiles;
alias dim="docker images"
alias dpsa="docker ps -a"
alias dps="docker ps"
......@@ -10,8 +12,26 @@ alias dimp="docker image prune"
# Build docker image
# usage: dockbuild {noetic, melodic}
function dockbuild(){
cd ~/srcs/development_environment/dockerfiles;
docker build -t devenv:$1 --build-arg ROS_DISTRO=$1 -f devenv.Dockerfile .
if [ $# -lt 1 ]; then
echo "Usage: dockbuild <ROS_DISTRO> [build_args]"
echo "build_args:"
echo " SHELL - zsh (default) or bash"
return 1
fi
cd $dockerfiles_DIR;
if [ $# -lt 2 ]; then
echo "Building ROS_DISTRO:"$1 "with SHELL_VERISON: zsh"
docker build -t devenv:$1 --build-arg ROS_DISTRO=$1 --build-arg SHELL="zsh" -f devenv.Dockerfile .
else
if [ $2 = "bash" ]; then
echo "Building ROS_DISTRO:"$1 "with SHELL_VERISON:"$2
docker build -t devenv:$1 --build-arg ROS_DISTRO=$1 --build-arg SHELL=$2 -f devenv.Dockerfile .
else
echo "SHELL_VERISON:"$2 "not supported"
fi
fi
}
# Run container with rocker
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment