Skip to content

Conversation

mikaelarguedas
Copy link
Contributor

This PR moves the installation of the build and compilation tools from the ros-core to ros-base
It also adds the flag --no-install-recommends to all apt installation calls to reduce image size

Related to osrf/docker_images#357

also use the --no-install-recommends flag
for all "apt-get install" calls

Signed-off-by: Mikael Arguedas <[email protected]>
@github-actions
Copy link

Diff for 48adfdb:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 82aabf5..6d90863 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -3,80 +3,80 @@ GitRepo: https://github.com/osrf/docker_images.git
 
 Tags: dashing-ros-core, dashing-ros-core-bionic
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: b075c7dbe56055d862f331f19e1e74ba653e181a
+GitCommit: 0b33e61b5bbed5b93b9fba2d5bae5db604ff9b58
 Directory: ros/dashing/ubuntu/bionic/ros-core
 
 Tags: eloquent-ros-core, eloquent-ros-core-bionic
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: b075c7dbe56055d862f331f19e1e74ba653e181a
+GitCommit: 0b33e61b5bbed5b93b9fba2d5bae5db604ff9b58
 Directory: ros/eloquent/ubuntu/bionic/ros-core
 
 Tags: kinetic-ros-core, kinetic-ros-core-xenial
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: b075c7dbe56055d862f331f19e1e74ba653e181a
+GitCommit: 0b33e61b5bbed5b93b9fba2d5bae5db604ff9b58
 Directory: ros/kinetic/ubuntu/xenial/ros-core
 
 Tags: melodic-ros-core, melodic-ros-core-bionic
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: b075c7dbe56055d862f331f19e1e74ba653e181a
+GitCommit: 0b33e61b5bbed5b93b9fba2d5bae5db604ff9b58
 Directory: ros/melodic/ubuntu/bionic/ros-core
 
 Tags: melodic-ros-core-stretch
 Architectures: amd64, arm64v8
-GitCommit: b075c7dbe56055d862f331f19e1e74ba653e181a
+GitCommit: 0b33e61b5bbed5b93b9fba2d5bae5db604ff9b58
 Directory: ros/melodic/debian/stretch/ros-core
 
 Tags: dashing-ros-base, dashing-ros-base-bionic, dashing
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: d188a5a15dba3d3fa266e4578c1ed2e1b4421c72
+GitCommit: 0b33e61b5bbed5b93b9fba2d5bae5db604ff9b58
 Directory: ros/dashing/ubuntu/bionic/ros-base
 
 Tags: eloquent-ros-base, eloquent-ros-base-bionic, eloquent
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: 9b63c2f2a11ef18c93f7c8f35770625fc48181d8
+GitCommit: 0b33e61b5bbed5b93b9fba2d5bae5db604ff9b58
 Directory: ros/eloquent/ubuntu/bionic/ros-base
 
 Tags: kinetic-ros-base, kinetic-ros-base-xenial, kinetic
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: f2b13092747c0f60cf7608369b57ea89bc01e22d
+GitCommit: 0b33e61b5bbed5b93b9fba2d5bae5db604ff9b58
 Directory: ros/kinetic/ubuntu/xenial/ros-base
 
 Tags: melodic-ros-base, melodic-ros-base-bionic, melodic, latest
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: c1585532a5e6ddc4c3ded239a1caff366c34117f
+GitCommit: 0b33e61b5bbed5b93b9fba2d5bae5db604ff9b58
 Directory: ros/melodic/ubuntu/bionic/ros-base
 
 Tags: melodic-ros-base-stretch
 Architectures: amd64, arm64v8
-GitCommit: c1585532a5e6ddc4c3ded239a1caff366c34117f
+GitCommit: 0b33e61b5bbed5b93b9fba2d5bae5db604ff9b58
 Directory: ros/melodic/debian/stretch/ros-base
 
 Tags: kinetic-perception, kinetic-perception-xenial
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: f2b13092747c0f60cf7608369b57ea89bc01e22d
+GitCommit: 7ff09c2a75e902bc2bb25a1f1ae748ec4e9c7a4b
 Directory: ros/kinetic/ubuntu/xenial/perception
 
 Tags: kinetic-robot, kinetic-robot-xenial
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: f2b13092747c0f60cf7608369b57ea89bc01e22d
+GitCommit: 7ff09c2a75e902bc2bb25a1f1ae748ec4e9c7a4b
 Directory: ros/kinetic/ubuntu/xenial/robot
 
 Tags: melodic-perception, melodic-perception-bionic
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: c1585532a5e6ddc4c3ded239a1caff366c34117f
+GitCommit: 7ff09c2a75e902bc2bb25a1f1ae748ec4e9c7a4b
 Directory: ros/melodic/ubuntu/bionic/perception
 
 Tags: melodic-perception-stretch
 Architectures: amd64, arm64v8
-GitCommit: c1585532a5e6ddc4c3ded239a1caff366c34117f
+GitCommit: 7ff09c2a75e902bc2bb25a1f1ae748ec4e9c7a4b
 Directory: ros/melodic/debian/stretch/perception
 
 Tags: melodic-robot, melodic-robot-bionic
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: c1585532a5e6ddc4c3ded239a1caff366c34117f
+GitCommit: 7ff09c2a75e902bc2bb25a1f1ae748ec4e9c7a4b
 Directory: ros/melodic/ubuntu/bionic/robot
 
 Tags: melodic-robot-stretch
 Architectures: amd64, arm64v8
-GitCommit: c1585532a5e6ddc4c3ded239a1caff366c34117f
+GitCommit: 7ff09c2a75e902bc2bb25a1f1ae748ec4e9c7a4b
 Directory: ros/melodic/debian/stretch/robot
diff --git a/ros_dashing-ros-core-bionic/Dockerfile b/ros_dashing-ros-core-bionic/Dockerfile
index 2c6c83b..4e6ba4d 100644
--- a/ros_dashing-ros-core-bionic/Dockerfile
+++ b/ros_dashing-ros-core-bionic/Dockerfile
@@ -5,13 +5,14 @@ FROM ubuntu:bionic
 # setup timezone
 RUN echo 'Etc/UTC' > /etc/timezone && \
     ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
-    apt-get update && apt-get install -q -y tzdata && rm -rf /var/lib/apt/lists/*
+    apt-get update && \
+    apt-get install -q -y --no-install-recommends tzdata && \
+    rm -rf /var/lib/apt/lists/*
 
 # install packages
-RUN apt-get update && apt-get install -q -y \
+RUN apt-get update && apt-get install -q -y --no-install-recommends \
     dirmngr \
     gnupg2 \
-    python3-pip \
     && rm -rf /var/lib/apt/lists/*
 
 # setup keys
@@ -20,38 +21,14 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6
 # setup sources.list
 RUN echo "deb http://packages.ros.org/ros2/ubuntu bionic main" > /etc/apt/sources.list.d/ros2-latest.list
 
-# install bootstrap tools
-RUN apt-get update && apt-get install --no-install-recommends -y \
-    git \
-    python3-colcon-common-extensions \
-    python3-colcon-mixin \
-    python3-rosdep \
-    python3-vcstool \
-    && rm -rf /var/lib/apt/lists/*
-
 # setup environment
 ENV LANG C.UTF-8
 ENV LC_ALL C.UTF-8
 
 ENV ROS_DISTRO dashing
-# bootstrap rosdep
-RUN rosdep init && \
-  rosdep update --rosdistro $ROS_DISTRO
-
-# setup colcon mixin and metadata
-RUN colcon mixin add default \
-      https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
-    colcon mixin update && \
-    colcon metadata add default \
-      https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
-    colcon metadata update
-
-# install python packages
-RUN pip3 install -U \
-    argcomplete
 
 # install ros2 packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-dashing-ros-core=0.7.3-1* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_dashing/Dockerfile b/ros_dashing/Dockerfile
index 7fea3b0..340bbbd 100644
--- a/ros_dashing/Dockerfile
+++ b/ros_dashing/Dockerfile
@@ -1,8 +1,31 @@
 # This is an auto generated Dockerfile for ros:ros-base
 # generated from docker_images_ros2/create_ros_image.Dockerfile.em
 FROM ros:dashing-ros-core-bionic
+
+# install bootstrap tools
+RUN apt-get update && apt-get install --no-install-recommends -y \
+    build-essential \
+    git \
+    python3-colcon-common-extensions \
+    python3-colcon-mixin \
+    python3-rosdep \
+    python3-vcstool \
+    && rm -rf /var/lib/apt/lists/*
+
+# bootstrap rosdep
+RUN rosdep init && \
+  rosdep update --rosdistro $ROS_DISTRO
+
+# setup colcon mixin and metadata
+RUN colcon mixin add default \
+      https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
+    colcon mixin update && \
+    colcon metadata add default \
+      https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
+    colcon metadata update
+
 # install ros2 packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-dashing-ros-base=0.7.3-1* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_eloquent-ros-core-bionic/Dockerfile b/ros_eloquent-ros-core-bionic/Dockerfile
index ebeb85e..4bee053 100644
--- a/ros_eloquent-ros-core-bionic/Dockerfile
+++ b/ros_eloquent-ros-core-bionic/Dockerfile
@@ -5,13 +5,14 @@ FROM ubuntu:bionic
 # setup timezone
 RUN echo 'Etc/UTC' > /etc/timezone && \
     ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
-    apt-get update && apt-get install -q -y tzdata && rm -rf /var/lib/apt/lists/*
+    apt-get update && \
+    apt-get install -q -y --no-install-recommends tzdata && \
+    rm -rf /var/lib/apt/lists/*
 
 # install packages
-RUN apt-get update && apt-get install -q -y \
+RUN apt-get update && apt-get install -q -y --no-install-recommends \
     dirmngr \
     gnupg2 \
-    python3-pip \
     && rm -rf /var/lib/apt/lists/*
 
 # setup keys
@@ -20,38 +21,14 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6
 # setup sources.list
 RUN echo "deb http://packages.ros.org/ros2/ubuntu bionic main" > /etc/apt/sources.list.d/ros2-latest.list
 
-# install bootstrap tools
-RUN apt-get update && apt-get install --no-install-recommends -y \
-    git \
-    python3-colcon-common-extensions \
-    python3-colcon-mixin \
-    python3-rosdep \
-    python3-vcstool \
-    && rm -rf /var/lib/apt/lists/*
-
 # setup environment
 ENV LANG C.UTF-8
 ENV LC_ALL C.UTF-8
 
 ENV ROS_DISTRO eloquent
-# bootstrap rosdep
-RUN rosdep init && \
-  rosdep update --rosdistro $ROS_DISTRO
-
-# setup colcon mixin and metadata
-RUN colcon mixin add default \
-      https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
-    colcon mixin update && \
-    colcon metadata add default \
-      https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
-    colcon metadata update
-
-# install python packages
-RUN pip3 install -U \
-    argcomplete
 
 # install ros2 packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-eloquent-ros-core=0.8.4-1* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_eloquent/Dockerfile b/ros_eloquent/Dockerfile
index bfa4af5..e5541f5 100644
--- a/ros_eloquent/Dockerfile
+++ b/ros_eloquent/Dockerfile
@@ -1,8 +1,31 @@
 # This is an auto generated Dockerfile for ros:ros-base
 # generated from docker_images_ros2/create_ros_image.Dockerfile.em
 FROM ros:eloquent-ros-core-bionic
+
+# install bootstrap tools
+RUN apt-get update && apt-get install --no-install-recommends -y \
+    build-essential \
+    git \
+    python3-colcon-common-extensions \
+    python3-colcon-mixin \
+    python3-rosdep \
+    python3-vcstool \
+    && rm -rf /var/lib/apt/lists/*
+
+# bootstrap rosdep
+RUN rosdep init && \
+  rosdep update --rosdistro $ROS_DISTRO
+
+# setup colcon mixin and metadata
+RUN colcon mixin add default \
+      https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
+    colcon mixin update && \
+    colcon metadata add default \
+      https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
+    colcon metadata update
+
 # install ros2 packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-eloquent-ros-base=0.8.4-1* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_kinetic-perception-xenial/Dockerfile b/ros_kinetic-perception-xenial/Dockerfile
index bcb9493..9508d49 100644
--- a/ros_kinetic-perception-xenial/Dockerfile
+++ b/ros_kinetic-perception-xenial/Dockerfile
@@ -3,7 +3,7 @@
 FROM ros:kinetic-ros-base-xenial
 
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-kinetic-perception=1.3.2-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_kinetic-robot-xenial/Dockerfile b/ros_kinetic-robot-xenial/Dockerfile
index aa5d44d..c25faef 100644
--- a/ros_kinetic-robot-xenial/Dockerfile
+++ b/ros_kinetic-robot-xenial/Dockerfile
@@ -3,7 +3,7 @@
 FROM ros:kinetic-ros-base-xenial
 
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-kinetic-robot=1.3.2-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_kinetic-ros-core-xenial/Dockerfile b/ros_kinetic-ros-core-xenial/Dockerfile
index 0c98e14..d030f14 100644
--- a/ros_kinetic-ros-core-xenial/Dockerfile
+++ b/ros_kinetic-ros-core-xenial/Dockerfile
@@ -3,7 +3,7 @@
 FROM ubuntu:xenial
 
 # install packages
-RUN apt-get update && apt-get install -q -y \
+RUN apt-get update && apt-get install -q -y --no-install-recommends \
     dirmngr \
     gnupg2 \
     && rm -rf /var/lib/apt/lists/*
@@ -14,24 +14,14 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6
 # setup sources.list
 RUN echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros1-latest.list
 
-# install bootstrap tools
-RUN apt-get update && apt-get install --no-install-recommends -y \
-    python-rosdep \
-    python-rosinstall \
-    python-vcstools \
-    && rm -rf /var/lib/apt/lists/*
-
 # setup environment
 ENV LANG C.UTF-8
 ENV LC_ALL C.UTF-8
 
 ENV ROS_DISTRO kinetic
-# bootstrap rosdep
-RUN rosdep init && \
-  rosdep update --rosdistro $ROS_DISTRO
 
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-kinetic-ros-core=1.3.2-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_kinetic/Dockerfile b/ros_kinetic/Dockerfile
index 662c31c..4836712 100644
--- a/ros_kinetic/Dockerfile
+++ b/ros_kinetic/Dockerfile
@@ -2,8 +2,20 @@
 # generated from docker_images/create_ros_image.Dockerfile.em
 FROM ros:kinetic-ros-core-xenial
 
+# install bootstrap tools
+RUN apt-get update && apt-get install --no-install-recommends -y \
+    build-essential \
+    python-rosdep \
+    python-rosinstall \
+    python-vcstools \
+    && rm -rf /var/lib/apt/lists/*
+
+# bootstrap rosdep
+RUN rosdep init && \
+  rosdep update --rosdistro $ROS_DISTRO
+
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-kinetic-ros-base=1.3.2-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_latest/Dockerfile b/ros_latest/Dockerfile
index 430f545..e8a911e 100644
--- a/ros_latest/Dockerfile
+++ b/ros_latest/Dockerfile
@@ -2,8 +2,20 @@
 # generated from docker_images/create_ros_image.Dockerfile.em
 FROM ros:melodic-ros-core-bionic
 
+# install bootstrap tools
+RUN apt-get update && apt-get install --no-install-recommends -y \
+    build-essential \
+    python-rosdep \
+    python-rosinstall \
+    python-vcstools \
+    && rm -rf /var/lib/apt/lists/*
+
+# bootstrap rosdep
+RUN rosdep init && \
+  rosdep update --rosdistro $ROS_DISTRO
+
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-melodic-ros-base=1.4.1-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_melodic-perception-bionic/Dockerfile b/ros_melodic-perception-bionic/Dockerfile
index cdd5fe1..5fc0a66 100644
--- a/ros_melodic-perception-bionic/Dockerfile
+++ b/ros_melodic-perception-bionic/Dockerfile
@@ -3,7 +3,7 @@
 FROM ros:melodic-ros-base-bionic
 
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-melodic-perception=1.4.1-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_melodic-perception-stretch/Dockerfile b/ros_melodic-perception-stretch/Dockerfile
index feceb83..8e495d0 100644
--- a/ros_melodic-perception-stretch/Dockerfile
+++ b/ros_melodic-perception-stretch/Dockerfile
@@ -3,7 +3,7 @@
 FROM ros:melodic-ros-base-stretch
 
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-melodic-perception=1.4.1-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_melodic-robot-bionic/Dockerfile b/ros_melodic-robot-bionic/Dockerfile
index afa9e82..273b7db 100644
--- a/ros_melodic-robot-bionic/Dockerfile
+++ b/ros_melodic-robot-bionic/Dockerfile
@@ -3,7 +3,7 @@
 FROM ros:melodic-ros-base-bionic
 
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-melodic-robot=1.4.1-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_melodic-robot-stretch/Dockerfile b/ros_melodic-robot-stretch/Dockerfile
index 6847d18..417ced8 100644
--- a/ros_melodic-robot-stretch/Dockerfile
+++ b/ros_melodic-robot-stretch/Dockerfile
@@ -3,7 +3,7 @@
 FROM ros:melodic-ros-base-stretch
 
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-melodic-robot=1.4.1-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_melodic-ros-base-stretch/Dockerfile b/ros_melodic-ros-base-stretch/Dockerfile
index c094f02..dfb4bc9 100644
--- a/ros_melodic-ros-base-stretch/Dockerfile
+++ b/ros_melodic-ros-base-stretch/Dockerfile
@@ -2,8 +2,20 @@
 # generated from docker_images/create_ros_image.Dockerfile.em
 FROM ros:melodic-ros-core-stretch
 
+# install bootstrap tools
+RUN apt-get update && apt-get install --no-install-recommends -y \
+    build-essential \
+    python-rosdep \
+    python-rosinstall \
+    python-vcstools \
+    && rm -rf /var/lib/apt/lists/*
+
+# bootstrap rosdep
+RUN rosdep init && \
+  rosdep update --rosdistro $ROS_DISTRO
+
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-melodic-ros-base=1.4.1-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_melodic-ros-core-bionic/Dockerfile b/ros_melodic-ros-core-bionic/Dockerfile
index 2181e02..a7e316a 100644
--- a/ros_melodic-ros-core-bionic/Dockerfile
+++ b/ros_melodic-ros-core-bionic/Dockerfile
@@ -5,10 +5,12 @@ FROM ubuntu:bionic
 # setup timezone
 RUN echo 'Etc/UTC' > /etc/timezone && \
     ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
-    apt-get update && apt-get install -q -y tzdata && rm -rf /var/lib/apt/lists/*
+    apt-get update && \
+    apt-get install -q -y --no-install-recommends tzdata && \
+    rm -rf /var/lib/apt/lists/*
 
 # install packages
-RUN apt-get update && apt-get install -q -y \
+RUN apt-get update && apt-get install -q -y --no-install-recommends \
     dirmngr \
     gnupg2 \
     && rm -rf /var/lib/apt/lists/*
@@ -19,24 +21,14 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6
 # setup sources.list
 RUN echo "deb http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros1-latest.list
 
-# install bootstrap tools
-RUN apt-get update && apt-get install --no-install-recommends -y \
-    python-rosdep \
-    python-rosinstall \
-    python-vcstools \
-    && rm -rf /var/lib/apt/lists/*
-
 # setup environment
 ENV LANG C.UTF-8
 ENV LC_ALL C.UTF-8
 
 ENV ROS_DISTRO melodic
-# bootstrap rosdep
-RUN rosdep init && \
-  rosdep update --rosdistro $ROS_DISTRO
 
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-melodic-ros-core=1.4.1-0* \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/ros_melodic-ros-core-stretch/Dockerfile b/ros_melodic-ros-core-stretch/Dockerfile
index 7592f39..0133531 100644
--- a/ros_melodic-ros-core-stretch/Dockerfile
+++ b/ros_melodic-ros-core-stretch/Dockerfile
@@ -3,7 +3,7 @@
 FROM debian:stretch
 
 # install packages
-RUN apt-get update && apt-get install -q -y \
+RUN apt-get update && apt-get install -q -y --no-install-recommends \
     dirmngr \
     gnupg2 \
     && rm -rf /var/lib/apt/lists/*
@@ -14,24 +14,14 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6
 # setup sources.list
 RUN echo "deb http://packages.ros.org/ros/ubuntu stretch main" > /etc/apt/sources.list.d/ros1-latest.list
 
-# install bootstrap tools
-RUN apt-get update && apt-get install --no-install-recommends -y \
-    python-rosdep \
-    python-rosinstall \
-    python-vcstools \
-    && rm -rf /var/lib/apt/lists/*
-
 # setup environment
 ENV LANG C.UTF-8
 ENV LC_ALL C.UTF-8
 
 ENV ROS_DISTRO melodic
-# bootstrap rosdep
-RUN rosdep init && \
-  rosdep update --rosdistro $ROS_DISTRO
 
 # install ros packages
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     ros-melodic-ros-core=1.4.1-0* \
     && rm -rf /var/lib/apt/lists/*
 

@yosifkit
Copy link
Member

yosifkit commented May 19, 2020

Was build-essential added to ros-base images on purpose? I don't see it discussed on osrf/docker_images#357.

Also, I usually recommend just installing the tools you need rather than build-essential:

If you do not plan to build Debian packages, you don't need this package.

https://packages.debian.org/buster/build-essential

@mikaelarguedas
Copy link
Contributor Author

My bad I forgot to link the original discussion osrf/docker_templates#82 (comment)

Long story short: build-essential was installed as a recommended package before in the ros-core images. With this change build-essential (and any C/C++ compilers) were not installed anymore. To retain user ability to build ROS packages out-of-the-box when using the ros:<distro_name> images (alias for ros:<distro_name>-ros-base we decided to explicitly add build-essential along with the build tools installed in ros-base.

@tianon
Copy link
Member

tianon commented May 20, 2020

The point @yosifkit is making (with his broken link that I've now fixed 😅) is that build-essential is for building Debian packages (dpkg-buildpackage and friends), and that's why the description for that package mentions that it's probably not the right package otherwise. It also has a very short list of dependencies that are easily audited to determine which ones might be useful:

  • dep: dpkg-dev (>= 1.17.11)
    Debian package development tools

  • dep: g++ (>= 4:8.3)
    GNU C++ compiler

  • dep: gcc (>= 4:8.3)
    GNU C compiler

  • dep: libc6-dev
    GNU C Library: Development Libraries and Header Files
    or libc-dev
    virtual package provided by libc6-dev

  • dep: make
    utility for directing compilation

Of these, I imagine you probably only need make, libc6-dev, and gcc? Possibly g++, depending on how common C++ is within ROS? (but then again, g++ then depends on gcc, so if that's the case you're looking at make, libc6-dev, and g++)

You probably don't need dpkg-dev, which pulls in a host of additional dependencies including perl. 😅

@mikaelarguedas
Copy link
Contributor Author

That's a fair point. In our case we needed all but dpkg-dev.

When doing the original testing on ubuntu bionic, it didnt make any difference with regards to the final package list installed as parts of the core of ROS rely on pkg-config that in turn depends on dpkg-dev https://packages.ubuntu.com/bionic/pkg-config

On more recent ubuntu versions that dependency on dpkg-dev was relaxed (though it still depends on perl and friends), so we can save some package installation.
Here is the difference if trying to install build-essential on top of a ROS image that installs gcc,g++,libc6-dev,make:

The following NEW packages will be installed:
  build-essential bzip2 dpkg-dev patch xz-utils
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 2028 kB of archives.
After this operation, 2876 kB of additional disk space will be used.

The impact will be minor but I can make that change for the sake of preciseness in the dependency declaration.
If this is the preferred route, feel free to reject this PR and I'll open a new one with the changes.

@ruffsl
Copy link
Contributor

ruffsl commented May 26, 2020

When doing the original testing on ubuntu bionic, it didnt make any difference with regards to the final package list installed as parts of the core of ROS rely on pkg-config that in turn depends on dpkg-dev

Given this'll take some more downstream work, could we still get this merged as is? We'd like to update the docs in preparation of Foxy next week to reflect the tooling changes, but we'd like all the supported images to be consistent with image tag contents by then: docker-library/docs#1381

@tianon
Copy link
Member

tianon commented May 26, 2020

Ok, fair enough.

@tianon tianon merged commit c1d897f into docker-library:master May 26, 2020
@mikaelarguedas mikaelarguedas deleted the ros_no_recommends branch May 26, 2020 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants