Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Notch committed Sep 24, 2024
1 parent 32d0041 commit 80133dc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ XAUTH=/tmp/.docker.xauth
AVAILABLE_CORES=$(($(nproc) - 1))

DOCKER_USER=tomnotch
IMAGE_NAME=ros-1-noetic-base
IMAGE_TAG=latest
IMAGE_NAME=ros-base
IMAGE_TAG=noetic

CONTAINER_NAME=${IMAGE_NAME}
CONTAINER_HOME_FOLDER=/root
Expand Down
19 changes: 12 additions & 7 deletions docker/latest/Dockerfile → docker/noetic/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Do not add --platform=linux/blabla since this is intended for multiplatform builds
FROM osrf/ros:noetic-desktop-full AS base
# Not using osrf/ros:noetic-desktop-full as base image because it is not multiplatform
FROM ubuntu:20.04 AS base
ENV HOME_FOLDER=/root
WORKDIR $HOME_FOLDER/

Expand Down Expand Up @@ -93,15 +94,19 @@ RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/latest/do
-a "bindkey -M emacs '^[[3;5~' kill-word" \
-a "bindkey '^H' backward-kill-word" \
-a "autoload -U compinit && compinit" \
-a "export PATH=~/.local/bin:$PATH" \
-a "source /opt/ros/noetic/setup.zsh" \
-a "source /opt/ros/noetic/etc/catkin/profile.d/50-rosmon.zsh"
-a "export PATH=~/.local/bin:$PATH"

# change default shell for the $USER in the image building process for extra environment safety
RUN chsh -s $(which zsh)

# Presource ROS env in bashrc, install catkin tools and rosmon
RUN echo "source /opt/ros/noetic/setup.bash" >> $HOME_FOLDER/.bashrc && \
# Install ROS, catkin tools, rosmon + presource workspace
RUN 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 -o Acquire::Check-Valid-Until=false -o Acquire::AllowInsecureRepositories=true -o Acquire::AllowDowngradeToInsecureRepositories=true && \
apt-get install -y ros-noetic-desktop-full && \
echo "source /opt/ros/noetic/setup.zsh" >> $HOME_FOLDER/.zshrc && \
echo "source /opt/ros/noetic/etc/catkin/profile.d/50-rosmon.zsh" >> $HOME_FOLDER/.zshrc && \
echo "source /opt/ros/noetic/setup.bash" >> $HOME_FOLDER/.bashrc && \
echo "source /opt/ros/noetic/etc/catkin/profile.d/50-rosmon.bash" >> $HOME_FOLDER/.bashrc && \
apt-get install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool python3-catkin-tools ros-noetic-rosmon && \
rm /etc/ros/rosdep/sources.list.d/20-default.list && \
Expand Down Expand Up @@ -137,7 +142,7 @@ FROM base
COPY --from=yaml-cpp-build /usr/local/include/yaml-cpp /usr/local/include/yaml-cpp
COPY --from=yaml-cpp-build /usr/local/lib/libyaml-cpp.so* /usr/local/lib/

# end of sudo apt-get installs
# end of apt-get installs
RUN apt-get full-upgrade -y && \
apt-get autoremove -y && \
apt-get autoclean -y && \
Expand Down

0 comments on commit 80133dc

Please sign in to comment.